@@ -47,6 +47,7 @@ export async function activate(context: vscode.ExtensionContext)
4747 return ;
4848 }
4949 let client = possiblyNullClient ;
50+ let supportedLangId = [ "hlsl" , "glsl" , "wgsl" ] ;
5051
5152 // Create sidebar
5253 sidebar = new ShaderVariantTreeDataProvider ( context , client ) ;
@@ -61,7 +62,7 @@ export async function activate(context: vscode.ExtensionContext)
6162 } ) ) ;
6263 context . subscriptions . push ( vscode . commands . registerCommand ( "shader-validator.dumpAst" , ( ) => {
6364 let activeTextEditor = vscode . window . activeTextEditor ;
64- if ( activeTextEditor && activeTextEditor . document . uri . scheme === 'file' ) {
65+ if ( activeTextEditor && activeTextEditor . document . uri . scheme === 'file' && supportedLangId . includes ( activeTextEditor . document . languageId ) ) {
6566 client . sendRequest ( dumpAstRequest , {
6667 uri : client . code2ProtocolConverter . asUri ( activeTextEditor . document . uri )
6768 } ) . then ( ( value : string | null ) => {
@@ -76,7 +77,7 @@ export async function activate(context: vscode.ExtensionContext)
7677 } ) ) ;
7778 context . subscriptions . push ( vscode . commands . registerCommand ( "shader-validator.dumpDependency" , ( ) => {
7879 let activeTextEditor = vscode . window . activeTextEditor ;
79- if ( activeTextEditor && activeTextEditor . document . uri . scheme === 'file' ) {
80+ if ( activeTextEditor && activeTextEditor . document . uri . scheme === 'file' && supportedLangId . includes ( activeTextEditor . document . languageId ) ) {
8081 client . sendRequest ( dumpDependencyRequest , {
8182 uri : client . code2ProtocolConverter . asUri ( activeTextEditor . document . uri )
8283 } ) . then ( ( value : string | null ) => {
0 commit comments