File tree Expand file tree Collapse file tree 7 files changed +73
-1
lines changed
Expand file tree Collapse file tree 7 files changed +73
-1
lines changed Original file line number Diff line number Diff line change 313313 "command" : " codeQL.exportVariantAnalysisResults" ,
314314 "title" : " CodeQL: Export Variant Analysis Results"
315315 },
316+ {
317+ "command" : " codeQL.mockVariantAnalysisView" ,
318+ "title" : " CodeQL: Open Variant Analysis Mock View"
319+ },
316320 {
317321 "command" : " codeQL.runQueries" ,
318322 "title" : " CodeQL: Run Queries in Selected Files"
893897 "command" : " codeQL.exportVariantAnalysisResults" ,
894898 "when" : " config.codeQL.canary"
895899 },
900+ {
901+ "command" : " codeQL.mockVariantAnalysisView" ,
902+ "when" : " config.codeQL.canary && config.codeQL.variantAnalysis.liveResults"
903+ },
896904 {
897905 "command" : " codeQL.runQueries" ,
898906 "when" : " false"
Original file line number Diff line number Diff line change @@ -387,3 +387,13 @@ export function getActionBranch(): string {
387387export function isIntegrationTestMode ( ) {
388388 return process . env . INTEGRATION_TEST_MODE === 'true' ;
389389}
390+
391+ /**
392+ * A flag indicating whether to enable the experimental "live results" feature
393+ * for multi-repo variant analyses.
394+ */
395+ const LIVE_RESULTS = new Setting ( 'liveResults' , REMOTE_QUERIES_SETTING ) ;
396+
397+ export function isVariantAnalysisLiveResultsEnabled ( ) : boolean {
398+ return ! ! LIVE_RESULTS . getValue < boolean > ( ) ;
399+ }
Original file line number Diff line number Diff line change @@ -102,6 +102,7 @@ import { EvalLogViewer } from './eval-log-viewer';
102102import { SummaryLanguageSupport } from './log-insights/summary-language-support' ;
103103import { JoinOrderScannerProvider } from './log-insights/join-order' ;
104104import { LogScannerService } from './log-insights/log-scanner-service' ;
105+ import { VariantAnalysisInterfaceManager } from './remote-queries/variant-analysis-interface' ;
105106
106107/**
107108 * extension.ts
@@ -919,6 +920,13 @@ async function activateWithInstalledDistribution(
919920 } )
920921 ) ;
921922
923+ ctx . subscriptions . push (
924+ commandRunner ( 'codeQL.mockVariantAnalysisView' , async ( ) => {
925+ const variantAnalysisView = new VariantAnalysisInterfaceManager ( ctx ) ;
926+ variantAnalysisView . openView ( ) ;
927+ } )
928+ ) ;
929+
922930 ctx . subscriptions . push (
923931 commandRunner (
924932 'codeQL.openReferencedFile' ,
Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ export function tryResolveLocation(
112112 }
113113}
114114
115- export type WebviewView = 'results' | 'compare' | 'remote-queries' ;
115+ export type WebviewView = 'results' | 'compare' | 'remote-queries' | 'variant-analysis' ;
116116
117117export interface WebviewMessage {
118118 t : string ;
Original file line number Diff line number Diff line change 1+ import { ViewColumn } from 'vscode' ;
2+ import { AbstractInterfaceManager , InterfacePanelConfig } from '../abstract-interface-manager' ;
3+ import { WebviewMessage } from '../interface-utils' ;
4+ import { logger } from '../logging' ;
5+
6+ export class VariantAnalysisInterfaceManager extends AbstractInterfaceManager < WebviewMessage , WebviewMessage > {
7+ public openView ( ) {
8+ this . getPanel ( ) . reveal ( undefined , true ) ;
9+ }
10+
11+ protected getPanelConfig ( ) : InterfacePanelConfig {
12+ return {
13+ viewId : 'variantAnalysisView' ,
14+ title : 'CodeQL Query Results' ,
15+ viewColumn : ViewColumn . Active ,
16+ preserveFocus : true ,
17+ view : 'variant-analysis'
18+ } ;
19+ }
20+
21+ protected onPanelDispose ( ) : void {
22+ // Nothing to dispose currently.
23+ }
24+
25+ protected async onMessage ( msg : WebviewMessage ) : Promise < void > {
26+ void logger . log ( 'Received message on variant analysis view: ' + msg . t ) ;
27+ }
28+ }
Original file line number Diff line number Diff line change 1+ import * as React from 'react' ;
2+
3+ export function VariantAnalysis ( ) : JSX . Element {
4+ return < span > Hello!</ span > ;
5+ }
Original file line number Diff line number Diff line change 1+ import * as React from 'react' ;
2+ import { WebviewDefinition } from '../webview-interface' ;
3+ import { VariantAnalysis } from './VariantAnalysis' ;
4+
5+ const definition : WebviewDefinition = {
6+ component : < VariantAnalysis /> ,
7+
8+ // This is temporarily using the wrong message type.
9+ // We will change it in the near future.
10+ loadedMessage : 'remoteQueryLoaded'
11+ } ;
12+
13+ export default definition ;
You can’t perform that action at this time.
0 commit comments