mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 13:00:58 +00:00
Fixes #132802 by making maxTokenizationLineLength configurable per language and reducing the default for TypeScript.
This commit is contained in:
parent
077c5749d2
commit
1a2749d798
|
@ -13,6 +13,11 @@
|
||||||
"update-grammar": "node ./build/update-grammars.js"
|
"update-grammar": "node ./build/update-grammars.js"
|
||||||
},
|
},
|
||||||
"contributes": {
|
"contributes": {
|
||||||
|
"configurationDefaults": {
|
||||||
|
"[typescript]": {
|
||||||
|
"editor.maxTokenizationLineLength": 2500
|
||||||
|
}
|
||||||
|
},
|
||||||
"languages": [
|
"languages": [
|
||||||
{
|
{
|
||||||
"id": "typescript",
|
"id": "typescript",
|
||||||
|
|
|
@ -280,7 +280,7 @@ export abstract class AbstractTextMateService extends Disposable implements ITex
|
||||||
this._onDidEncounterLanguage.fire(languageId);
|
this._onDidEncounterLanguage.fire(languageId);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return new TMTokenizationSupport(r.languageId, tokenization, this._configurationService);
|
return new TMTokenizationSupport(languageIdentifier, tokenization, this._configurationService);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
onUnexpectedError(err);
|
onUnexpectedError(err);
|
||||||
return null;
|
return null;
|
||||||
|
@ -418,16 +418,20 @@ class TMTokenizationSupport implements ITokenizationSupport {
|
||||||
private _maxTokenizationLineLength: number;
|
private _maxTokenizationLineLength: number;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
languageId: LanguageId,
|
languageId: LanguageIdentifier,
|
||||||
actual: TMTokenization,
|
actual: TMTokenization,
|
||||||
@IConfigurationService private readonly _configurationService: IConfigurationService,
|
@IConfigurationService private readonly _configurationService: IConfigurationService,
|
||||||
) {
|
) {
|
||||||
this._languageId = languageId;
|
this._languageId = languageId.id;
|
||||||
this._actual = actual;
|
this._actual = actual;
|
||||||
this._maxTokenizationLineLength = this._configurationService.getValue<number>('editor.maxTokenizationLineLength');
|
this._maxTokenizationLineLength = this._configurationService.getValue<number>('editor.maxTokenizationLineLength', {
|
||||||
|
overrideIdentifier: languageId.language
|
||||||
|
});
|
||||||
this._configurationService.onDidChangeConfiguration(e => {
|
this._configurationService.onDidChangeConfiguration(e => {
|
||||||
if (e.affectsConfiguration('editor.maxTokenizationLineLength')) {
|
if (e.affectsConfiguration('editor.maxTokenizationLineLength')) {
|
||||||
this._maxTokenizationLineLength = this._configurationService.getValue<number>('editor.maxTokenizationLineLength');
|
this._maxTokenizationLineLength = this._configurationService.getValue<number>('editor.maxTokenizationLineLength', {
|
||||||
|
overrideIdentifier: languageId.language
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue