mirror of
https://github.com/Microsoft/vscode
synced 2024-07-17 02:57:19 +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"
|
||||
},
|
||||
"contributes": {
|
||||
"configurationDefaults": {
|
||||
"[typescript]": {
|
||||
"editor.maxTokenizationLineLength": 2500
|
||||
}
|
||||
},
|
||||
"languages": [
|
||||
{
|
||||
"id": "typescript",
|
||||
|
|
|
@ -280,7 +280,7 @@ export abstract class AbstractTextMateService extends Disposable implements ITex
|
|||
this._onDidEncounterLanguage.fire(languageId);
|
||||
}
|
||||
});
|
||||
return new TMTokenizationSupport(r.languageId, tokenization, this._configurationService);
|
||||
return new TMTokenizationSupport(languageIdentifier, tokenization, this._configurationService);
|
||||
} catch (err) {
|
||||
onUnexpectedError(err);
|
||||
return null;
|
||||
|
@ -418,16 +418,20 @@ class TMTokenizationSupport implements ITokenizationSupport {
|
|||
private _maxTokenizationLineLength: number;
|
||||
|
||||
constructor(
|
||||
languageId: LanguageId,
|
||||
languageId: LanguageIdentifier,
|
||||
actual: TMTokenization,
|
||||
@IConfigurationService private readonly _configurationService: IConfigurationService,
|
||||
) {
|
||||
this._languageId = languageId;
|
||||
this._languageId = languageId.id;
|
||||
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 => {
|
||||
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