Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
loadGrammar: async (scopeName) => {
if (scopeName === 'source.cs') {
scopeName //?
// https://github.com/textmate/javascript.tmbundle/blob/master/Syntaxes/JavaScript.plist
const response = await new Promise((resolve, reject) => {
readFile('./grammars/csharp.tmLanguage', (e, v) => e ? reject(e) : resolve(v.toString()));
});
const g = parseRawGrammar(response, resolve('./grammars/csharp.tmLanguage'));
g //?
return g;
}
console.log(`Unknown scope name: ${scopeName}`);
return null;
}
});
static async loadGrammar(path) {
const rawGrammar = await fs.promises.readFile(path, 'utf-8')
return vsctm.parseRawGrammar(rawGrammar.toString(), path)
}
loadGrammar: async scopeName => {
const grammarInfo = getGrammar(scopeName, grammars);
const fileName = grammarInfo && getGrammarLocation(grammarInfo);
if (fileName) {
const contents = await readFile(fileName, 'utf8');
return parseRawGrammar(contents, fileName);
}
warnMissingLanguageFile(scopeName, rootScopeName);
},
getInjections: scopeName => {