File tree Expand file tree Collapse file tree 3 files changed +22
-9
lines changed
Expand file tree Collapse file tree 3 files changed +22
-9
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import type { DbTreeViewItem } from "../databases/ui/db-tree-view-item";
55import type { DatabaseItem } from "../local-databases" ;
66import type { QueryHistoryInfo } from "../query-history/query-history-info" ;
77import type { RepositoriesFilterSortStateWithIds } from "../pure/variant-analysis-filter-sort" ;
8+ import type { TestTreeNode } from "../test-tree-node" ;
89import type {
910 VariantAnalysis ,
1011 VariantAnalysisScannedRepository ,
@@ -195,6 +196,11 @@ export type SummaryLanguageSupportCommands = {
195196 "codeQL.gotoQL" : ( ) => Promise < void > ;
196197} ;
197198
199+ export type TestUICommands = {
200+ "codeQLTests.showOutputDifferences" : ( node : TestTreeNode ) => Promise < void > ;
201+ "codeQLTests.acceptOutput" : ( node : TestTreeNode ) => Promise < void > ;
202+ } ;
203+
198204export type AllCommands = BaseCommands &
199205 QueryHistoryCommands &
200206 LocalDatabasesCommands &
@@ -204,7 +210,8 @@ export type AllCommands = BaseCommands &
204210 AstViewerCommands &
205211 PackagingCommands &
206212 EvalLogViewerCommands &
207- SummaryLanguageSupportCommands ;
213+ SummaryLanguageSupportCommands &
214+ Partial < TestUICommands > ;
208215
209216export type AppCommandManager = CommandManager < AllCommands > ;
210217
Original file line number Diff line number Diff line change @@ -115,6 +115,7 @@ import {
115115 AllCommands ,
116116 BaseCommands ,
117117 QueryServerCommands ,
118+ TestUICommands ,
118119} from "./common/commands" ;
119120import {
120121 getLocalQueryCommands ,
@@ -795,6 +796,7 @@ async function activateWithInstalledDistribution(
795796 const testExplorerExtension = extensions . getExtension < TestHub > (
796797 testExplorerExtensionId ,
797798 ) ;
799+ let testUiCommands : Partial < TestUICommands > = { } ;
798800 if ( testExplorerExtension ) {
799801 const testHub = testExplorerExtension . exports ;
800802 const testAdapterFactory = new QLTestAdapterFactory (
@@ -806,6 +808,8 @@ async function activateWithInstalledDistribution(
806808
807809 const testUIService = new TestUIService ( testHub ) ;
808810 ctx . subscriptions . push ( testUIService ) ;
811+
812+ testUiCommands = testUIService . getCommands ( ) ;
809813 }
810814
811815 const astViewer = new AstViewer ( ) ;
@@ -846,6 +850,7 @@ async function activateWithInstalledDistribution(
846850 } ) ,
847851 ...evalLogViewer . getCommands ( ) ,
848852 ...summaryLanguageSupport . getCommands ( ) ,
853+ ...testUiCommands ,
849854 } ;
850855
851856 for ( const [ commandName , command ] of Object . entries ( allCommands ) ) {
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ import { TestTreeNode } from "./test-tree-node";
1616import { DisposableObject } from "./pure/disposable-object" ;
1717import { UIService } from "./vscode-utils/ui-service" ;
1818import { QLTestAdapter , getExpectedFile , getActualFile } from "./test-adapter" ;
19- import { extLogger } from "./common" ;
19+ import { TestUICommands } from "./common/commands " ;
2020
2121type VSCodeTestEvent =
2222 | TestRunStartedEvent
@@ -48,16 +48,17 @@ export class TestUIService extends UIService implements TestController {
4848 constructor ( private readonly testHub : TestHub ) {
4949 super ( ) ;
5050
51- void extLogger . log ( "Registering CodeQL test panel commands." ) ;
52- this . registerCommand (
53- "codeQLTests.showOutputDifferences" ,
54- this . showOutputDifferences ,
55- ) ;
56- this . registerCommand ( "codeQLTests.acceptOutput" , this . acceptOutput ) ;
57-
5851 testHub . registerTestController ( this ) ;
5952 }
6053
54+ public getCommands ( ) : TestUICommands {
55+ return {
56+ "codeQLTests.showOutputDifferences" :
57+ this . showOutputDifferences . bind ( this ) ,
58+ "codeQLTests.acceptOutput" : this . acceptOutput . bind ( this ) ,
59+ } ;
60+ }
61+
6162 public dispose ( ) : void {
6263 this . testHub . unregisterTestController ( this ) ;
6364
You can’t perform that action at this time.
0 commit comments