|
@@ -19,27 +19,6 @@ class GrammarStore {
|
|
|
|
|
|
constructor(private registry: Registry) {}
|
|
|
|
|
|
- // This does not seem to work. Note VS Code does not appear to be going this route.
|
|
|
- async createTokensProvider(scopeName: string): Promise<monaco.languages.TokensProvider> {
|
|
|
- const grammar = await this.getGrammar(scopeName);
|
|
|
- if (grammar == null) {
|
|
|
- throw Error(`no grammar for ${scopeName}`);
|
|
|
- }
|
|
|
-
|
|
|
- return {
|
|
|
- getInitialState(): IState {
|
|
|
- return INITIAL;
|
|
|
- },
|
|
|
-
|
|
|
- tokenize(line: string, state: IState): monaco.languages.ILineTokens {
|
|
|
- const lineTokens = grammar.tokenizeLine(line, <StackElement>state);
|
|
|
- const {tokens, ruleStack} = lineTokens;
|
|
|
- // @ts-ignore: probably should not be ignoring this
|
|
|
- return {tokens, endState: ruleStack};
|
|
|
- },
|
|
|
- };
|
|
|
- }
|
|
|
-
|
|
|
// https://github.com/NeekSandhu/monaco-editor-textmate/issues/11#issuecomment-561984387
|
|
|
// provides some insight as to why this isn't working.
|
|
|
async createEncodedTokensProvider(
|