File tree Expand file tree Collapse file tree 4 files changed +16
-11
lines changed Expand file tree Collapse file tree 4 files changed +16
-11
lines changed Original file line number Diff line number Diff line change 875
875
"group" : " navigation@1" ,
876
876
"when" : " view == jobManager"
877
877
},
878
- {
879
- "command" : " vscode-db2i.jobManager.continue" ,
880
- "group" : " navigation@1" ,
881
- "when" : " view == jobManager"
882
- },
883
878
{
884
879
"command" : " vscode-db2i.jobManager.defaultSelfSettings" ,
885
880
"group" : " navigation" ,
1093
1088
},
1094
1089
{
1095
1090
"command" : " vscode-db2i.self.explainSelf" ,
1096
- "when" : " view == vscode-db2i.self.nodes && viewItem == selfCodeNode" ,
1091
+ "when" : " view == vscode-db2i.self.nodes && viewItem == selfCodeNode && continueExtensionActive " ,
1097
1092
"group" : " navigation"
1098
1093
}
1099
1094
],
Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ import {
13
13
} from "../../.." ;
14
14
import { DB2_SELF_PROMPT , DB2_SYSTEM_PROMPT } from "./prompts" ;
15
15
16
+ export let isContinueActive = false ;
17
+
16
18
const db2ContextProviderDesc : ContextProviderDescription = {
17
19
title : "db2i" ,
18
20
displayTitle : "Db2i" ,
@@ -176,6 +178,15 @@ export async function registerContinueProvider() {
176
178
const provider = new db2ContextProvider ( ) ;
177
179
const continueID = `Continue.continue` ;
178
180
const continueEx = vscode . extensions . getExtension ( continueID ) ;
179
- const continueAPI = continueEx ?. exports ;
180
- continueAPI ?. registerCustomContextProvider ( provider ) ;
181
+ if ( continueEx ) {
182
+ if ( ! continueEx . isActive ) {
183
+ await continueEx . activate ( ) ;
184
+ }
185
+
186
+ isContinueActive = true ;
187
+ const continueAPI = continueEx ?. exports ;
188
+ continueAPI ?. registerCustomContextProvider ( provider ) ;
189
+ vscode . commands . executeCommand ( 'setContext' , 'continueExtensionActive' , true ) ;
190
+ vscode . window . showInformationMessage ( `@Db2i context provider enabled in Continue!` ) ;
191
+ }
181
192
}
Original file line number Diff line number Diff line change @@ -9,9 +9,7 @@ import { displayJobLog } from "./jobLog";
9
9
import { SelfValue , selfCodesMap } from "./selfCodes/nodes" ;
10
10
import { SelfCodesQuickPickItem } from "./selfCodes/selfCodesBrowser" ;
11
11
import { updateStatusBar } from "./statusBar" ;
12
- import { selfCodesResultsView } from "./selfCodes/selfCodesResultsView" ;
13
12
import { setCancelButtonVisibility } from "../results" ;
14
- import { registerContinueProvider } from "../../aiProviders/continue/continueContextProvider" ;
15
13
import { JDBCOptions } from "@ibm/mapepire-js/dist/src/types" ;
16
14
17
15
const selectJobCommand = `vscode-db2i.jobManager.selectJob` ;
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import { SQLExample } from "../../examples";
16
16
import { JobInfo } from "../../../connection/manager" ;
17
17
import { OldSQLJob } from "../../../connection/sqlJob" ;
18
18
import { JobLogEntry } from "../../../connection/types" ;
19
+ import { isContinueActive } from "../../../aiProviders/continue/continueContextProvider" ;
19
20
20
21
type ChangeTreeDataEventType = SelfCodeTreeItem | undefined | null | void ;
21
22
@@ -70,7 +71,7 @@ export class selfCodesResultsView implements TreeDataProvider<any> {
70
71
}
71
72
} ) ,
72
73
vscode . commands . registerCommand ( `vscode-db2i.self.explainSelf` , async ( item : SelfCodeTreeItem ) => {
73
- if ( item && item . error ) {
74
+ if ( item && item . error && isContinueActive ) {
74
75
const jsonData = JSON . stringify ( item . error , null , 2 ) ;
75
76
const document = await vscode . workspace . openTextDocument ( {
76
77
content : jsonData ,
You can’t perform that action at this time.
0 commit comments