1
1
// The module 'vscode' contains the VS Code extensibility API
2
2
// Import the module and reference it with the alias vscode in your code below
3
- import vscode from "vscode"
3
+ import vscode from "vscode" ;
4
4
import schemaBrowser from "./views/schemaBrowser" ;
5
5
6
6
import * as JSONServices from "./language/json" ;
7
7
import * as resultsProvider from "./views/results" ;
8
8
9
+ import { JDBCOptions } from "@ibm/mapepire-js/dist/src/types" ;
9
10
import { getInstance , loadBase } from "./base" ;
10
- import { JobManager , onConnectOrServerInstall , initConfig } from "./config" ;
11
- import { queryHistory } from "./views/queryHistoryView" ;
12
- import { ExampleBrowser } from "./views/examples/exampleBrowser" ;
13
- import { languageInit } from "./language/providers" ;
14
- import { initialiseTestSuite } from "./testing" ;
15
- import { JobManagerView } from "./views/jobManager/jobManagerView" ;
16
- import { ServerComponent } from "./connection/serverComponent" ;
11
+ import { JobManager , initConfig , onConnectOrServerInstall } from "./config" ;
12
+ import Configuration from "./configuration" ;
17
13
import { SQLJobManager } from "./connection/manager" ;
14
+ import { ServerComponent } from "./connection/serverComponent" ;
18
15
import { OldSQLJob } from "./connection/sqlJob" ;
16
+ import { languageInit } from "./language/providers" ;
17
+ import { DbCache } from "./language/providers/logic/cache" ;
19
18
import { notebookInit } from "./notebooks/IBMiSerializer" ;
20
- import { SelfTreeDecorationProvider , selfCodesResultsView } from "./views/jobManager/selfCodes/selfCodesResultsView" ;
21
- import Configuration from "./configuration" ;
22
- import { JDBCOptions } from "@ibm/mapepire-js/dist/src/types" ;
19
+ import { initialiseTestSuite } from "./testing" ;
23
20
import { Db2iUriHandler , getStatementUri } from "./uriHandler" ;
24
- import { DbCache } from "./language/providers/logic/cache" ;
21
+ import { ExampleBrowser } from "./views/examples/exampleBrowser" ;
22
+ import { JobManagerView } from "./views/jobManager/jobManagerView" ;
23
+ import { SelfTreeDecorationProvider , selfCodesResultsView } from "./views/jobManager/selfCodes/selfCodesResultsView" ;
24
+ import { queryHistory } from "./views/queryHistoryView" ;
25
25
26
26
export interface Db2i {
27
27
sqlJobManager : SQLJobManager ,
@@ -32,7 +32,7 @@ export interface Db2i {
32
32
// your extension is activated the very first time the command is executed
33
33
34
34
export function activate ( context : vscode . ExtensionContext ) : Db2i {
35
-
35
+
36
36
// Use the console to output diagnostic information (console.log) and errors (console.error)
37
37
// This line of code will only be executed once when your extension is activated
38
38
console . log ( `Congratulations, your extension "vscode-db2i" is now active!` ) ;
@@ -80,7 +80,7 @@ export function activate(context: vscode.ExtensionContext): Db2i {
80
80
81
81
console . log ( `Developer environment: ${ process . env . DEV } ` ) ;
82
82
const devMode = process . env . DEV !== undefined ;
83
- let runTests : Function | undefined ;
83
+ let runTests : Function | undefined ;
84
84
if ( devMode ) {
85
85
// Run tests if not in production build
86
86
runTests = initialiseTestSuite ( context ) ;
@@ -103,6 +103,8 @@ export function activate(context: vscode.ExtensionContext): Db2i {
103
103
} ) ;
104
104
} ) ;
105
105
106
+ instance . subscribe ( context , `disconnected` , `db2i-disconnected` , ( ) => ServerComponent . reset ( ) ) ;
107
+
106
108
return { sqlJobManager : JobManager , sqlJob : ( options ?: JDBCOptions ) => new OldSQLJob ( options ) } ;
107
109
}
108
110
0 commit comments