File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change
1
+ import type { ExtensionContext } from "vscode" ;
2
+
3
+ export class ContextProvider {
4
+ private static ctx : ExtensionContext | undefined ;
5
+
6
+ public static setContext ( context : ExtensionContext ) {
7
+ ContextProvider . ctx = context ;
8
+ }
9
+
10
+ public static getContext ( ) : ExtensionContext {
11
+ if ( ! ContextProvider . ctx ) {
12
+ throw new Error ( "Context is not set yet" ) ;
13
+ }
14
+ return ContextProvider . ctx ;
15
+ }
16
+ }
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ import { queryHistory } from "./views/queryHistoryView";
26
26
import { registerCopilotProvider } from "./aiProviders/copilot" ;
27
27
import { registerDb2iTablesProvider } from "./aiProviders/continue/listTablesContextProvider" ;
28
28
import { setCheckerAvailableContext } from "./language/providers/problemProvider" ;
29
+ import { ContextProvider } from "./contextProvider" ;
29
30
30
31
export interface Db2i {
31
32
sqlJobManager : SQLJobManager ,
@@ -42,6 +43,7 @@ export function activate(context: vscode.ExtensionContext): Db2i {
42
43
console . log ( `Congratulations, your extension "vscode-db2i" is now active!` ) ;
43
44
44
45
loadBase ( context ) ;
46
+ ContextProvider . setContext ( context ) ;
45
47
46
48
const exampleBrowser = new ExampleBrowser ( context ) ;
47
49
const selfCodesView = new selfCodesResultsView ( context ) ;
You can’t perform that action at this time.
0 commit comments