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";
2626import { registerCopilotProvider } from "./aiProviders/copilot" ;
2727import { registerDb2iTablesProvider } from "./aiProviders/continue/listTablesContextProvider" ;
2828import { setCheckerAvailableContext } from "./language/providers/problemProvider" ;
29+ import { ContextProvider } from "./contextProvider" ;
2930
3031export interface Db2i {
3132 sqlJobManager : SQLJobManager ,
@@ -42,6 +43,7 @@ export function activate(context: vscode.ExtensionContext): Db2i {
4243 console . log ( `Congratulations, your extension "vscode-db2i" is now active!` ) ;
4344
4445 loadBase ( context ) ;
46+ ContextProvider . setContext ( context ) ;
4547
4648 const exampleBrowser = new ExampleBrowser ( context ) ;
4749 const selfCodesView = new selfCodesResultsView ( context ) ;
You can’t perform that action at this time.
0 commit comments