update-grammar.mjs 831 B

123456789101112131415161718
  1. /*---------------------------------------------------------------------------------------------
  2. * Copyright (c) Microsoft Corporation. All rights reserved.
  3. * Licensed under the MIT License. See License.txt in the project root for license information.
  4. *--------------------------------------------------------------------------------------------*/
  5. // @ts-check
  6. import * as vscodeGrammarUpdater from 'vscode-grammar-updater';
  7. function patchGrammar(grammar) {
  8. grammar.scopeName = 'text.html.cshtml';
  9. return grammar;
  10. }
  11. const razorGrammarRepo = 'dotnet/razor';
  12. const grammarPath = 'src/Razor/src/Microsoft.VisualStudio.RazorExtension/EmbeddedGrammars/aspnetcorerazor.tmLanguage.json';
  13. vscodeGrammarUpdater.update(razorGrammarRepo, grammarPath, './syntaxes/cshtml.tmLanguage.json', grammar => patchGrammar(grammar), 'main');