Skip to content

Commit a6070a2

Browse files
committed
Use newer config APIs from base
Signed-off-by: Liam Barry Allan <[email protected]>
1 parent 1be78c5 commit a6070a2

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/views/schemaBrowser.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,16 @@ module.exports = class schemaBrowser {
5858
vscode.commands.registerCommand(`vscode-db2i.addSchemaToSchemaBrowser`, async () => {
5959
const config = instance.getConfig();
6060

61-
const schemas = config.get(`databaseBrowserList`) || [];
61+
const schemas = config[`databaseBrowserList`] || [];
6262

6363
const newSchema = await vscode.window.showInputBox({
6464
prompt: `Library to add to Database Browser`
6565
});
6666

6767
if (newSchema && !schemas.includes(newSchema.toUpperCase())) {
6868
schemas.push(newSchema.toUpperCase());
69-
await config.set(`databaseBrowserList`, schemas);
69+
config[`databaseBrowserList`] = schemas;
70+
await instance.setConfig(config);
7071
this.refresh();
7172
}
7273
}),
@@ -76,14 +77,14 @@ module.exports = class schemaBrowser {
7677
//Running from right click
7778
const config = instance.getConfig();
7879

79-
let schemas = config.get(`databaseBrowserList`);
80+
let schemas = config[`databaseBrowserList`];
8081

8182
let index = schemas.findIndex(file => file.toUpperCase() === node.schema)
8283
if (index >= 0) {
8384
schemas.splice(index, 1);
8485
}
8586

86-
await config.set(`databaseBrowserList`, schemas);
87+
await instance.setConfig(config);
8788
this.refresh();
8889
}
8990
}),
@@ -126,7 +127,8 @@ module.exports = class schemaBrowser {
126127
const currentLibrary = config.currentLibrary.toUpperCase();
127128

128129
if (schema && schema !== currentLibrary) {
129-
await config.set(`currentLibrary`, schema);
130+
config.currentLibrary = schema;
131+
await instance.setConfig(config);
130132
}
131133

132134
vscode.window.showInformationMessage(`Current schema set to ${schema}.`);
@@ -222,7 +224,7 @@ module.exports = class schemaBrowser {
222224
if (connection) {
223225
const config = instance.getConfig();
224226

225-
const libraries = config.get(`databaseBrowserList`) || [];
227+
const libraries = config[`databaseBrowserList`] || [];
226228

227229
for (let library of libraries) {
228230
items.push(new Schema(library));

0 commit comments

Comments
 (0)