How to use the vscode-textmate.StandardTokenType.Other function in vscode-textmate

To help you get started, we’ve selected a few vscode-textmate examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github eclipse-theia / theia / packages / plugin-ext / src / main / browser / plugin-contribution-handler.ts View on Github external
if (typeof tokenTypes === 'undefined' || tokenTypes === null) {
            return undefined;
        }
        // tslint:disable-next-line:no-null-keyword
        const result = Object.create(null);
        const scopes = Object.keys(tokenTypes);
        const len = scopes.length;
        for (let i = 0; i < len; i++) {
            const scope = scopes[i];
            const tokenType = tokenTypes[scope];
            switch (tokenType) {
                case 'string':
                    result[scope] = StandardTokenType.String;
                    break;
                case 'other':
                    result[scope] = StandardTokenType.Other;
                    break;
                case 'comment':
                    result[scope] = StandardTokenType.Comment;
                    break;
            }
        }
        return result;
    }
github eclipse-theia / theia / packages / textmate-grammars / src / browser / js.ts View on Github external
format: 'plist',
                    content: regExpGrammar,
                };
            }
        });

        registry.registerGrammarConfiguration(this.js_id, {
            embeddedLanguages: {
                'meta.tag.js': getEncodedLanguageId('jsx-tags'),
                'meta.tag.without-attributes.js': getEncodedLanguageId('jsx-tags'),
                'meta.tag.attributes.js.jsx': getEncodedLanguageId('javascriptreact'),
                'meta.embedded.expression.js': getEncodedLanguageId('javascriptreact')
            },
            tokenTypes: {
                'entity.name.type.instance.jsdoc': StandardTokenType.Other,
                'entity.name.function.tagged-template': StandardTokenType.Other,
                'meta.import string.quoted': StandardTokenType.Other,
                'variable.other.jsdoc': StandardTokenType.Other
            }
        });

        registry.mapLanguageIdToTextmateGrammar(this.js_id, 'source.js');

        const jsxGrammar = require('../../data/javascript.jsx.tmlanguage.json');
        registry.registerTextmateGrammarScope('source.jsx', {
            async getGrammarDefinition(): Promise {
                return {
                    format: 'json',
                    content: jsxGrammar,
                };
            }
        });
github eclipse-theia / theia / packages / textmate-grammars / src / browser / js.ts View on Github external
return {
                    format: 'plist',
                    content: regExpGrammar,
                };
            }
        });

        registry.registerGrammarConfiguration(this.js_id, {
            embeddedLanguages: {
                'meta.tag.js': getEncodedLanguageId('jsx-tags'),
                'meta.tag.without-attributes.js': getEncodedLanguageId('jsx-tags'),
                'meta.tag.attributes.js.jsx': getEncodedLanguageId('javascriptreact'),
                'meta.embedded.expression.js': getEncodedLanguageId('javascriptreact')
            },
            tokenTypes: {
                'entity.name.type.instance.jsdoc': StandardTokenType.Other,
                'entity.name.function.tagged-template': StandardTokenType.Other,
                'meta.import string.quoted': StandardTokenType.Other,
                'variable.other.jsdoc': StandardTokenType.Other
            }
        });

        registry.mapLanguageIdToTextmateGrammar(this.js_id, 'source.js');

        const jsxGrammar = require('../../data/javascript.jsx.tmlanguage.json');
        registry.registerTextmateGrammarScope('source.jsx', {
            async getGrammarDefinition(): Promise {
                return {
                    format: 'json',
                    content: jsxGrammar,
                };
            }
github eclipse-theia / theia / packages / textmate-grammars / src / browser / js.ts View on Github external
};
            }
        });

        registry.registerGrammarConfiguration(this.js_id, {
            embeddedLanguages: {
                'meta.tag.js': getEncodedLanguageId('jsx-tags'),
                'meta.tag.without-attributes.js': getEncodedLanguageId('jsx-tags'),
                'meta.tag.attributes.js.jsx': getEncodedLanguageId('javascriptreact'),
                'meta.embedded.expression.js': getEncodedLanguageId('javascriptreact')
            },
            tokenTypes: {
                'entity.name.type.instance.jsdoc': StandardTokenType.Other,
                'entity.name.function.tagged-template': StandardTokenType.Other,
                'meta.import string.quoted': StandardTokenType.Other,
                'variable.other.jsdoc': StandardTokenType.Other
            }
        });

        registry.mapLanguageIdToTextmateGrammar(this.js_id, 'source.js');

        const jsxGrammar = require('../../data/javascript.jsx.tmlanguage.json');
        registry.registerTextmateGrammarScope('source.jsx', {
            async getGrammarDefinition(): Promise {
                return {
                    format: 'json',
                    content: jsxGrammar,
                };
            }
        });

        registry.mapLanguageIdToTextmateGrammar(this.js_react_id, 'source.jsx');
github eclipse-theia / theia / packages / textmate-grammars / src / browser / js.ts View on Github external
content: regExpGrammar,
                };
            }
        });

        registry.registerGrammarConfiguration(this.js_id, {
            embeddedLanguages: {
                'meta.tag.js': getEncodedLanguageId('jsx-tags'),
                'meta.tag.without-attributes.js': getEncodedLanguageId('jsx-tags'),
                'meta.tag.attributes.js.jsx': getEncodedLanguageId('javascriptreact'),
                'meta.embedded.expression.js': getEncodedLanguageId('javascriptreact')
            },
            tokenTypes: {
                'entity.name.type.instance.jsdoc': StandardTokenType.Other,
                'entity.name.function.tagged-template': StandardTokenType.Other,
                'meta.import string.quoted': StandardTokenType.Other,
                'variable.other.jsdoc': StandardTokenType.Other
            }
        });

        registry.mapLanguageIdToTextmateGrammar(this.js_id, 'source.js');

        const jsxGrammar = require('../../data/javascript.jsx.tmlanguage.json');
        registry.registerTextmateGrammarScope('source.jsx', {
            async getGrammarDefinition(): Promise {
                return {
                    format: 'json',
                    content: jsxGrammar,
                };
            }
        });