Skip to content

Commit c7d4a9f

Browse files
committed
move register tables provider to refresh function
1 parent b8ab3b8 commit c7d4a9f

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/views/jobManager/jobManagerView.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,6 @@ export class JobManagerView implements TreeDataProvider<any> {
126126

127127
try {
128128
await selected.job.connect();
129-
130-
// re register tables provider with potential new Schema
131-
const schema = selected.job.options.libraries[0];
132-
await registerDb2iTablesProvider(schema);
133129
} catch (e) {
134130
window.showErrorMessage(`Failed to start new job with updated properties.`);
135131
}
@@ -281,8 +277,6 @@ export class JobManagerView implements TreeDataProvider<any> {
281277
vscode.commands.registerCommand(selectJobCommand, async (selectedName: string) => {
282278
if (selectedName) {
283279
await JobManager.setSelection(selectedName);
284-
const schema = JobManager.getSelection().job.options.libraries[0];
285-
await registerDb2iTablesProvider(schema);
286280
this.refresh();
287281
}
288282
}),
@@ -310,6 +304,9 @@ export class JobManagerView implements TreeDataProvider<any> {
310304
updateStatusBar();
311305

312306
const selectedJob = JobManager.getSelection();
307+
308+
// re-register db2i tables context provider with current schema
309+
registerDb2iTablesProvider(selectedJob.job.options.libraries[0]);
313310

314311
setCancelButtonVisibility(selectedJob && selectedJob.job.getStatus() === "busy");
315312
sqlLanguageStatus.setState(selectedJob !== undefined);

0 commit comments

Comments
 (0)