@@ -4,28 +4,28 @@ import {
44 CancellationTokenSource ,
55 commands ,
66 Disposable ,
7+ env ,
78 ExtensionContext ,
89 extensions ,
910 languages ,
1011 ProgressLocation ,
1112 ProgressOptions ,
13+ ProviderResult ,
14+ QuickPickItem ,
15+ Range ,
1216 Uri ,
17+ version as vscodeVersion ,
1318 window as Window ,
14- env ,
1519 window ,
16- QuickPickItem ,
17- Range ,
1820 workspace ,
19- ProviderResult ,
20- version as vscodeVersion ,
2121} from "vscode" ;
2222import { LanguageClient } from "vscode-languageclient/node" ;
23- import { platform , arch } from "os" ;
23+ import { arch , platform } from "os" ;
2424import { ensureDir } from "fs-extra" ;
25- import { join , basename } from "path" ;
25+ import { basename , join } from "path" ;
2626import { dirSync } from "tmp-promise" ;
2727import { testExplorerExtensionId , TestHub } from "vscode-test-adapter-api" ;
28- import { parse , lt } from "semver" ;
28+ import { lt , parse } from "semver" ;
2929
3030import { AstViewer } from "./astViewer" ;
3131import {
@@ -38,7 +38,6 @@ import {
3838 CliConfigListener ,
3939 DistributionConfigListener ,
4040 isCanary ,
41- isVariantAnalysisLiveResultsEnabled ,
4241 joinOrderWarningThreshold ,
4342 MAX_QUERIES ,
4443 QueryHistoryConfigListener ,
@@ -48,10 +47,10 @@ import { install } from "./languageSupport";
4847import { DatabaseItem , DatabaseManager } from "./databases" ;
4948import { DatabaseUI } from "./databases-ui" ;
5049import {
51- TemplateQueryDefinitionProvider ,
52- TemplateQueryReferenceProvider ,
5350 TemplatePrintAstProvider ,
5451 TemplatePrintCfgProvider ,
52+ TemplateQueryDefinitionProvider ,
53+ TemplateQueryReferenceProvider ,
5554} from "./contextual/templateProvider" ;
5655import {
5756 DEFAULT_DISTRIBUTION_VERSION_RANGE ,
@@ -65,22 +64,22 @@ import {
6564} from "./distribution" ;
6665import {
6766 findLanguage ,
68- tmpDirDisposal ,
69- showBinaryChoiceDialog ,
7067 showAndLogErrorMessage ,
71- showAndLogWarningMessage ,
68+ showAndLogExceptionWithTelemetry ,
7269 showAndLogInformationMessage ,
70+ showAndLogWarningMessage ,
71+ showBinaryChoiceDialog ,
7372 showInformationMessageWithAction ,
7473 tmpDir ,
75- showAndLogExceptionWithTelemetry ,
74+ tmpDirDisposal ,
7675} from "./helpers" ;
7776import { asError , assertNever , getErrorMessage } from "./pure/helpers-pure" ;
7877import { spawnIdeServer } from "./ide-server" ;
7978import { ResultsView } from "./interface" ;
8079import { WebviewReveal } from "./interface-utils" ;
8180import {
82- ideServerLogger ,
8381 extLogger ,
82+ ideServerLogger ,
8483 ProgressReporter ,
8584 queryServerLogger ,
8685} from "./common" ;
@@ -98,25 +97,20 @@ import {
9897 commandRunner ,
9998 commandRunnerWithProgress ,
10099 ProgressCallback ,
101- withProgress ,
102100 ProgressUpdate ,
101+ withProgress ,
103102} from "./commandRunner" ;
104103import { CodeQlStatusBarHandler } from "./status-bar" ;
105-
106- import { RemoteQueriesManager } from "./remote-queries/remote-queries-manager" ;
107- import { RemoteQueryResult } from "./remote-queries/remote-query-result" ;
108104import { URLSearchParams } from "url" ;
109105import {
110106 handleDownloadPacks ,
111107 handleInstallPackDependencies ,
112108} from "./packaging" ;
113109import { HistoryItemLabelProvider } from "./query-history/history-item-label-provider" ;
114110import {
115- exportRemoteQueryResults ,
116111 exportSelectedRemoteQueryResults ,
117112 exportVariantAnalysisResults ,
118113} from "./remote-queries/export-results" ;
119- import { RemoteQuery } from "./remote-queries/remote-query" ;
120114import { EvalLogViewer } from "./eval-log-viewer" ;
121115import { SummaryLanguageSupport } from "./log-insights/summary-language-support" ;
122116import { JoinOrderScannerProvider } from "./log-insights/join-order" ;
@@ -656,23 +650,11 @@ async function activateWithInstalledDistribution(
656650 ) ,
657651 ) ;
658652
659- void extLogger . log ( "Initializing remote queries manager." ) ;
660- const rqm = new RemoteQueriesManager (
661- ctx ,
662- app ,
663- cliServer ,
664- queryStorageDir ,
665- extLogger ,
666- ) ;
667- ctx . subscriptions . push ( rqm ) ;
668-
669653 void extLogger . log ( "Initializing query history." ) ;
670654 const qhm = new QueryHistoryManager (
671- app ,
672655 qs ,
673656 dbm ,
674657 localQueryResultsView ,
675- rqm ,
676658 variantAnalysisManager ,
677659 evalLogViewer ,
678660 queryStorageDir ,
@@ -1112,19 +1094,11 @@ async function activateWithInstalledDistribution(
11121094 message : "Getting credentials" ,
11131095 } ) ;
11141096
1115- if ( isVariantAnalysisLiveResultsEnabled ( ) ) {
1116- await variantAnalysisManager . runVariantAnalysis (
1117- uri || window . activeTextEditor ?. document . uri ,
1118- progress ,
1119- token ,
1120- ) ;
1121- } else {
1122- await rqm . runRemoteQuery (
1123- uri || window . activeTextEditor ?. document . uri ,
1124- progress ,
1125- token ,
1126- ) ;
1127- }
1097+ await variantAnalysisManager . runVariantAnalysis (
1098+ uri || window . activeTextEditor ?. document . uri ,
1099+ progress ,
1100+ token ,
1101+ ) ;
11281102 } else {
11291103 throw new Error (
11301104 "Variant analysis requires the CodeQL Canary version to run." ,
@@ -1138,21 +1112,6 @@ async function activateWithInstalledDistribution(
11381112 ) ,
11391113 ) ;
11401114
1141- ctx . subscriptions . push (
1142- commandRunner (
1143- "codeQL.monitorRemoteQuery" ,
1144- async ( queryId : string , query : RemoteQuery , token : CancellationToken ) => {
1145- await rqm . monitorRemoteQuery ( queryId , query , token ) ;
1146- } ,
1147- ) ,
1148- ) ;
1149-
1150- ctx . subscriptions . push (
1151- commandRunner ( "codeQL.copyRepoList" , async ( queryId : string ) => {
1152- await rqm . copyRemoteQueryRepoListToClipboard ( queryId ) ;
1153- } ) ,
1154- ) ;
1155-
11561115 ctx . subscriptions . push (
11571116 commandRunner (
11581117 "codeQL.openVariantAnalysisLogs" ,
@@ -1215,30 +1174,12 @@ async function activateWithInstalledDistribution(
12151174 ) ,
12161175 ) ;
12171176
1218- ctx . subscriptions . push (
1219- commandRunner (
1220- "codeQL.autoDownloadRemoteQueryResults" ,
1221- async ( queryResult : RemoteQueryResult , token : CancellationToken ) => {
1222- await rqm . autoDownloadRemoteQueryResults ( queryResult , token ) ;
1223- } ,
1224- ) ,
1225- ) ;
1226-
12271177 ctx . subscriptions . push (
12281178 commandRunner ( "codeQL.exportSelectedVariantAnalysisResults" , async ( ) => {
12291179 await exportSelectedRemoteQueryResults ( qhm ) ;
12301180 } ) ,
12311181 ) ;
12321182
1233- ctx . subscriptions . push (
1234- commandRunner (
1235- "codeQL.exportRemoteQueryResults" ,
1236- async ( queryId : string ) => {
1237- await exportRemoteQueryResults ( qhm , rqm , queryId , app . credentials ) ;
1238- } ,
1239- ) ,
1240- ) ;
1241-
12421183 ctx . subscriptions . push (
12431184 commandRunnerWithProgress (
12441185 "codeQL.exportVariantAnalysisResults" ,
0 commit comments