@@ -58,15 +58,16 @@ module.exports = class schemaBrowser {
58
58
vscode . commands . registerCommand ( `vscode-db2i.addSchemaToSchemaBrowser` , async ( ) => {
59
59
const config = instance . getConfig ( ) ;
60
60
61
- const schemas = config . get ( `databaseBrowserList` ) || [ ] ;
61
+ const schemas = config [ `databaseBrowserList` ] || [ ] ;
62
62
63
63
const newSchema = await vscode . window . showInputBox ( {
64
64
prompt : `Library to add to Database Browser`
65
65
} ) ;
66
66
67
67
if ( newSchema && ! schemas . includes ( newSchema . toUpperCase ( ) ) ) {
68
68
schemas . push ( newSchema . toUpperCase ( ) ) ;
69
- await config . set ( `databaseBrowserList` , schemas ) ;
69
+ config [ `databaseBrowserList` ] = schemas ;
70
+ await instance . setConfig ( config ) ;
70
71
this . refresh ( ) ;
71
72
}
72
73
} ) ,
@@ -76,14 +77,14 @@ module.exports = class schemaBrowser {
76
77
//Running from right click
77
78
const config = instance . getConfig ( ) ;
78
79
79
- let schemas = config . get ( `databaseBrowserList` ) ;
80
+ let schemas = config [ `databaseBrowserList` ] ;
80
81
81
82
let index = schemas . findIndex ( file => file . toUpperCase ( ) === node . schema )
82
83
if ( index >= 0 ) {
83
84
schemas . splice ( index , 1 ) ;
84
85
}
85
86
86
- await config . set ( `databaseBrowserList` , schemas ) ;
87
+ await instance . setConfig ( config ) ;
87
88
this . refresh ( ) ;
88
89
}
89
90
} ) ,
@@ -126,7 +127,8 @@ module.exports = class schemaBrowser {
126
127
const currentLibrary = config . currentLibrary . toUpperCase ( ) ;
127
128
128
129
if ( schema && schema !== currentLibrary ) {
129
- await config . set ( `currentLibrary` , schema ) ;
130
+ config . currentLibrary = schema ;
131
+ await instance . setConfig ( config ) ;
130
132
}
131
133
132
134
vscode . window . showInformationMessage ( `Current schema set to ${ schema } .` ) ;
@@ -222,7 +224,7 @@ module.exports = class schemaBrowser {
222
224
if ( connection ) {
223
225
const config = instance . getConfig ( ) ;
224
226
225
- const libraries = config . get ( `databaseBrowserList` ) || [ ] ;
227
+ const libraries = config [ `databaseBrowserList` ] || [ ] ;
226
228
227
229
for ( let library of libraries ) {
228
230
items . push ( new Schema ( library ) ) ;
0 commit comments