File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -463,6 +463,25 @@ export async function activate(
463
463
) ;
464
464
unsupportedWarningShown = true ;
465
465
} ) ;
466
+
467
+ // Expose the CodeQL CLI features to the extension context under `codeQL.cliFeatures.*`.
468
+ let cliFeatures : { [ feature : string ] : boolean | undefined } = { } ;
469
+ codeQlExtension . cliServer . addVersionChangedListener ( async ( ver ) => {
470
+ for ( const feat of Object . keys ( cliFeatures ) ) {
471
+ cliFeatures [ feat ] = false ;
472
+ }
473
+ cliFeatures = {
474
+ ...cliFeatures ,
475
+ ...( ver ?. features ?? { } ) ,
476
+ } ;
477
+ for ( const feat of Object . keys ( cliFeatures ) ) {
478
+ await app . commands . execute (
479
+ "setContext" ,
480
+ `codeQL.cliFeatures.${ feat } ` ,
481
+ cliFeatures [ feat ] ?? false ,
482
+ ) ;
483
+ }
484
+ } ) ;
466
485
}
467
486
468
487
return codeQlExtension ;
You can’t perform that action at this time.
0 commit comments