Adopt vscode-textmate@2.1.0
This commit is contained in:
parent
2ed511ea28
commit
93ea49c1e1
11
npm-shrinkwrap.json
generated
11
npm-shrinkwrap.json
generated
|
@ -102,6 +102,11 @@
|
|||
"from": "extract-opts@>=2.2.0 <3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/extract-opts/-/extract-opts-2.2.0.tgz"
|
||||
},
|
||||
"fast-plist": {
|
||||
"version": "0.1.0",
|
||||
"from": "fd-slicer@>=0.1.0 <0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/fast-plist/-/fast-plist-0.1.0.tgz"
|
||||
},
|
||||
"fd-slicer": {
|
||||
"version": "1.0.1",
|
||||
"from": "fd-slicer@>=1.0.1 <1.1.0",
|
||||
|
@ -413,9 +418,9 @@
|
|||
"resolved": "https://registry.npmjs.org/vscode-debugprotocol/-/vscode-debugprotocol-1.11.0.tgz"
|
||||
},
|
||||
"vscode-textmate": {
|
||||
"version": "2.0.1",
|
||||
"from": "vscode-textmate@2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-2.0.1.tgz"
|
||||
"version": "2.1.0",
|
||||
"from": "vscode-textmate@2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-2.1.0.tgz"
|
||||
},
|
||||
"windows-mutex": {
|
||||
"version": "0.2.0",
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
"sax": "1.1.2",
|
||||
"semver": "4.3.6",
|
||||
"vscode-debugprotocol": "1.11.0",
|
||||
"vscode-textmate": "2.0.1",
|
||||
"vscode-textmate": "2.1.0",
|
||||
"winreg": "1.2.0",
|
||||
"xterm": "git+https://github.com/sourcelair/xterm.js.git#b32a34b",
|
||||
"yauzl": "2.3.1"
|
||||
|
|
|
@ -14,7 +14,6 @@ import {LineTokens, Token} from 'vs/editor/common/modes/supports';
|
|||
import {IModeService} from 'vs/editor/common/services/modeService';
|
||||
import {IGrammar, Registry, StackElement} from 'vscode-textmate';
|
||||
import {ModeTransition} from 'vs/editor/common/core/modeTransition';
|
||||
import {IConfigurationService} from 'vs/platform/configuration/common/configuration';
|
||||
|
||||
export interface ITMSyntaxExtensionPoint {
|
||||
language: string;
|
||||
|
@ -55,10 +54,6 @@ let grammarsExtPoint = ExtensionsRegistry.registerExtensionPoint<ITMSyntaxExtens
|
|||
}
|
||||
});
|
||||
|
||||
interface MyEditorConfig {
|
||||
useExperimentalParser: boolean;
|
||||
}
|
||||
|
||||
export class MainProcessTextMateSyntax {
|
||||
private _grammarRegistry: Registry;
|
||||
private _modeService: IModeService;
|
||||
|
@ -66,21 +61,12 @@ export class MainProcessTextMateSyntax {
|
|||
private _injections: { [scopeName:string]: string[]; };
|
||||
|
||||
constructor(
|
||||
@IModeService modeService: IModeService,
|
||||
@IConfigurationService configurationService: IConfigurationService
|
||||
@IModeService modeService: IModeService
|
||||
) {
|
||||
this._modeService = modeService;
|
||||
this._scopeNameToFilePath = {};
|
||||
this._injections = {};
|
||||
|
||||
let editorConfig = configurationService.getConfiguration<MyEditorConfig>('editor');
|
||||
let useExperimentalParser = true;
|
||||
if (typeof editorConfig.useExperimentalParser !== 'undefined') {
|
||||
if (Boolean(editorConfig.useExperimentalParser) === false) {
|
||||
useExperimentalParser = false;
|
||||
}
|
||||
}
|
||||
|
||||
this._grammarRegistry = new Registry({
|
||||
getFilePath: (scopeName:string) => {
|
||||
return this._scopeNameToFilePath[scopeName];
|
||||
|
@ -88,7 +74,7 @@ export class MainProcessTextMateSyntax {
|
|||
getInjections: (scopeName:string) => {
|
||||
return this._injections[scopeName];
|
||||
}
|
||||
}, useExperimentalParser);
|
||||
});
|
||||
|
||||
grammarsExtPoint.setHandler((extensions) => {
|
||||
for (let i = 0; i < extensions.length; i++) {
|
||||
|
|
|
@ -18,7 +18,7 @@ export interface IGrammarLocator {
|
|||
*/
|
||||
export class Registry {
|
||||
|
||||
constructor(locator?:IGrammarLocator, useExperimentalParser?:boolean);
|
||||
constructor(locator?:IGrammarLocator);
|
||||
|
||||
/**
|
||||
* Load the grammar for `scopeName` and all referenced included grammars asynchronously.
|
||||
|
|
Loading…
Reference in a new issue