Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private convertEmbeddedLanguages(languages?: ScopeMap): IEmbeddedLanguagesMap | undefined {
if (typeof languages === 'undefined' || languages === null) {
return undefined;
}
// tslint:disable-next-line:no-null-keyword
const result = Object.create(null);
const scopes = Object.keys(languages);
const len = scopes.length;
for (let i = 0; i < len; i++) {
const scope = scopes[i];
const langId = languages[scope];
result[scope] = getEncodedLanguageId(langId);
}
return result;
}
}
});
registry.registerTextmateGrammarScope('source.js.regexp', {
async getGrammarDefinition(): Promise {
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 {
registry.registerTextmateGrammarScope('source.js.regexp', {
async getGrammarDefinition(): Promise {
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',
});
registry.registerTextmateGrammarScope('source.js.regexp', {
async getGrammarDefinition(): Promise {
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 {
};
}
});
registry.registerTextmateGrammarScope('source.js.regexp', {
async getGrammarDefinition(): Promise {
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', {