File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ const listDb2Table: ContextProviderDescription = {
25
25
type : "submenu" ,
26
26
} ;
27
27
28
- let provider : ListDb2iTables = undefined ;
28
+ export let provider : ListDb2iTables = undefined ;
29
29
30
30
class ListDb2iTables implements IContextProvider {
31
31
constructor ( private schema : string ) {
@@ -40,6 +40,10 @@ class ListDb2iTables implements IContextProvider {
40
40
this . schema = schema ;
41
41
}
42
42
43
+ getCurrentSchema ( ) {
44
+ return this . schema ;
45
+ }
46
+
43
47
async getColumnInfoForAllTables ( schema : string ) {
44
48
const items : TableColumn [ ] = await Table . getItems ( schema ) ;
45
49
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import { SelfCodesQuickPickItem } from "./selfCodes/selfCodesBrowser";
12
12
import { updateStatusBar } from "./statusBar" ;
13
13
import { setCancelButtonVisibility } from "../results" ;
14
14
import { JDBCOptions } from "@ibm/mapepire-js/dist/src/types" ;
15
- import { registerDb2iTablesProvider } from "../../aiProviders/continue/listTablesContextProvider" ;
15
+ import { provider , registerDb2iTablesProvider } from "../../aiProviders/continue/listTablesContextProvider" ;
16
16
import { sqlLanguageStatus } from "../../language/providers" ;
17
17
18
18
const selectJobCommand = `vscode-db2i.jobManager.selectJob` ;
@@ -304,9 +304,12 @@ export class JobManagerView implements TreeDataProvider<any> {
304
304
updateStatusBar ( ) ;
305
305
306
306
const selectedJob = JobManager . getSelection ( ) ;
307
+ const selectedSchema = selectedJob . job . options . libraries [ 0 ] ;
307
308
308
309
// re-register db2i tables context provider with current schema
309
- registerDb2iTablesProvider ( selectedJob . job . options . libraries [ 0 ] ) ;
310
+ if ( provider && provider . getCurrentSchema ( ) . toLowerCase ( ) !== selectedSchema . toLowerCase ( ) ) {
311
+ registerDb2iTablesProvider ( selectedJob . job . options . libraries [ 0 ] ) ;
312
+ }
310
313
311
314
setCancelButtonVisibility ( selectedJob && selectedJob . job . getStatus ( ) === "busy" ) ;
312
315
sqlLanguageStatus . setState ( selectedJob !== undefined ) ;
You can’t perform that action at this time.
0 commit comments