File tree Expand file tree Collapse file tree 4 files changed +22
-27
lines changed
Expand file tree Collapse file tree 4 files changed +22
-27
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,9 @@ export type QueryHistoryCommands = {
7676 "codeQLQueryHistory.itemClicked" : SelectionCommandFunction < QueryHistoryInfo > ;
7777 "codeQLQueryHistory.openOnGithub" : SelectionCommandFunction < QueryHistoryInfo > ;
7878 "codeQLQueryHistory.copyRepoList" : SelectionCommandFunction < QueryHistoryInfo > ;
79+
80+ // Commands in the command palette
81+ "codeQL.exportSelectedVariantAnalysisResults" : ( ) => Promise < void > ;
7982} ;
8083
8184// Commands used for the local databases panel
Original file line number Diff line number Diff line change @@ -101,7 +101,6 @@ import {
101101 handleInstallPackDependencies ,
102102} from "./packaging" ;
103103import { HistoryItemLabelProvider } from "./query-history/history-item-label-provider" ;
104- import { exportSelectedVariantAnalysisResults } from "./variant-analysis/export-results" ;
105104import { EvalLogViewer } from "./eval-log-viewer" ;
106105import { SummaryLanguageSupport } from "./log-insights/summary-language-support" ;
107106import { JoinOrderScannerProvider } from "./log-insights/join-order" ;
@@ -892,12 +891,6 @@ async function activateWithInstalledDistribution(
892891 ) ,
893892 ) ;
894893
895- ctx . subscriptions . push (
896- commandRunner ( "codeQL.exportSelectedVariantAnalysisResults" , async ( ) => {
897- await exportSelectedVariantAnalysisResults ( variantAnalysisManager , qhm ) ;
898- } ) ,
899- ) ;
900-
901894 ctx . subscriptions . push (
902895 commandRunner (
903896 "codeQL.loadVariantAnalysisRepoResults" ,
Original file line number Diff line number Diff line change @@ -271,6 +271,9 @@ export class QueryHistoryManager extends DisposableObject {
271271 "codeQLQueryHistory.itemClicked" : this . handleItemClicked . bind ( this ) ,
272272 "codeQLQueryHistory.openOnGithub" : this . handleOpenOnGithub . bind ( this ) ,
273273 "codeQLQueryHistory.copyRepoList" : this . handleCopyRepoList . bind ( this ) ,
274+
275+ "codeQL.exportSelectedVariantAnalysisResults" :
276+ this . exportSelectedVariantAnalysisResults . bind ( this ) ,
274277 } ;
275278 }
276279
@@ -1127,6 +1130,22 @@ export class QueryHistoryManager extends DisposableObject {
11271130 ) ;
11281131 }
11291132
1133+ /**
1134+ * Exports the results of the currently-selected variant analysis.
1135+ */
1136+ async exportSelectedVariantAnalysisResults ( ) : Promise < void > {
1137+ const queryHistoryItem = this . getCurrentQueryHistoryItem ( ) ;
1138+ if ( ! queryHistoryItem || queryHistoryItem . t !== "variant-analysis" ) {
1139+ throw new Error (
1140+ "No variant analysis results currently open. To open results, click an item in the query history view." ,
1141+ ) ;
1142+ }
1143+
1144+ await this . variantAnalysisManager . exportResults (
1145+ queryHistoryItem . variantAnalysis . id ,
1146+ ) ;
1147+ }
1148+
11301149 addQuery ( item : QueryHistoryInfo ) {
11311150 this . treeDataProvider . pushQuery ( item ) ;
11321151 this . updateTreeViewSelectionIfVisible ( ) ;
Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ import {
1616} from "../commandRunner" ;
1717import { showInformationMessageWithAction } from "../helpers" ;
1818import { extLogger } from "../common" ;
19- import { QueryHistoryManager } from "../query-history/query-history-manager" ;
2019import { createGist } from "./gh-api/gh-api-client" ;
2120import {
2221 generateVariantAnalysisMarkdown ,
@@ -37,25 +36,6 @@ import {
3736} from "../pure/variant-analysis-filter-sort" ;
3837import { Credentials } from "../common/authentication" ;
3938
40- /**
41- * Exports the results of the currently-selected variant analysis.
42- */
43- export async function exportSelectedVariantAnalysisResults (
44- variantAnalysisManager : VariantAnalysisManager ,
45- queryHistoryManager : QueryHistoryManager ,
46- ) : Promise < void > {
47- const queryHistoryItem = queryHistoryManager . getCurrentQueryHistoryItem ( ) ;
48- if ( ! queryHistoryItem || queryHistoryItem . t !== "variant-analysis" ) {
49- throw new Error (
50- "No variant analysis results currently open. To open results, click an item in the query history view." ,
51- ) ;
52- }
53-
54- await variantAnalysisManager . exportResults (
55- queryHistoryItem . variantAnalysis . id ,
56- ) ;
57- }
58-
5939const MAX_VARIANT_ANALYSIS_EXPORT_PROGRESS_STEPS = 2 ;
6040
6141/**
You can’t perform that action at this time.
0 commit comments