@@ -2,7 +2,7 @@ import * as vscode from 'vscode';
22import * as vscodeOniguruma from 'vscode-oniguruma' ;
33// import * as vscodeTextmate from 'vscode-textmate';
44import { stringify } from "../extension" ;
5- import { getScopeName , grammarLanguages , tokenizeFile } from "../TextMate" ;
5+ import { getScopeName , grammarLanguages , initTextMate , tokenizeFile } from "../TextMate" ;
66import { getTrees , queryNode , toRange } from "../TreeSitter" ;
77import { IGrammar , IMatchResult , IToken , RegExpSource , RuleId , endRuleId , whileRuleId } from "../ITextMate" ;
88import { IRawGrammar } from "../textmate/main" ;
@@ -854,6 +854,7 @@ export function initCallStackView(context: vscode.ExtensionContext): void {
854854 context . subscriptions . push (
855855 vscode . commands . registerTextEditorCommand ( "textmate.callstack" , CallStackView ) ,
856856 vscode . commands . registerCommand ( "textmate.refresh" , refresh ) ,
857+ vscode . commands . registerCommand ( "textmate.reload.grammars" , reloadGrammars ) ,
857858 vscode . commands . registerCommand ( "textmate.find" , find ) ,
858859 vscode . commands . registerCommand ( "textmate.copytoclipboard.grammar" , copyGrammarToClipBoard ) ,
859860 vscode . commands . registerCommand ( "textmate.call.details" , callDetails ) ,
@@ -1033,6 +1034,14 @@ async function refresh(element?: element) {
10331034 onDidChangeTreeDataCall . fire ( undefined ) ;
10341035}
10351036
1037+ async function reloadGrammars ( element ?: element ) {
1038+ // vscode.window.showInformationMessage(`reloadGrammars\n${JSON.stringify(element)}`);
1039+
1040+ initTextMate ( ) ;
1041+
1042+ onDidChangeTreeData . fire ( undefined ) ;
1043+ }
1044+
10361045async function find ( element ?: element ) {
10371046 // vscode.window.showInformationMessage(`find\n${JSON.stringify(element)}`);
10381047 await treeView . reveal ( undefined , { focus : true } ) ;
0 commit comments