@@ -11,7 +11,7 @@ import { getTitleForKey, handleMessage } from './utils'
11
11
import { ViewId } from './constants'
12
12
import { logger } from './logger'
13
13
import { registerUriHandler } from './utils/handleUri'
14
- import * as extensionApi from './extensionApi '
14
+ import * as extensionApiMock from './extensionApiMock '
15
15
16
16
dotenv . config ( { path : path . join ( __dirname , '..' , '.env' ) } )
17
17
@@ -217,24 +217,32 @@ export async function activate(context: vscode.ExtensionContext) {
217
217
vscode . commands . registerCommand ( 'RedisForVSCode.refreshDatabases' , ( ) => {
218
218
sidebarProvider . view ?. webview . postMessage ( { action : 'RefreshTree' } )
219
219
} ) ,
220
+
221
+ // TODO [DA]: Remove, added for testing purposes
222
+ vscode . commands . registerCommand ( 'RedisForVSCode.getAllDatabases' , async ( ) => {
223
+ const dbs = await extensionApiMock . getAllDatabases ( )
224
+ vscode . window . showInformationMessage (
225
+ `Found ${ dbs . length } database(s).: ${ dbs . map ( ( db ) => db . name ) . join ( ', ' ) } ` ,
226
+ )
227
+ } ) ,
220
228
)
221
229
222
230
registerUriHandler ( )
223
231
224
232
// Return the extension API to expose functionalities to the outer world
225
233
return {
226
234
// Core database operations
227
- getAllDatabases : extensionApi . getAllDatabases ,
228
- getDatabaseById : extensionApi . getDatabaseById ,
235
+ getAllDatabases : extensionApiMock . getAllDatabases ,
236
+ getDatabaseById : extensionApiMock . getDatabaseById ,
229
237
230
238
// Index operations
231
- getIndexDefinition : extensionApi . getIndexDefinition ,
232
- getAllIndexes : extensionApi . getAllIndexes ,
233
- hasRedisSearchModule : extensionApi . hasRedisSearchModule ,
239
+ getIndexDefinition : extensionApiMock . getIndexDefinition ,
240
+ getAllIndexes : extensionApiMock . getAllIndexes ,
241
+ hasRedisSearchModule : extensionApiMock . hasRedisSearchModule ,
234
242
235
243
// CLI operations
236
- openCliForDatabase : extensionApi . openCliForDatabase ,
237
- executeRedisCommand : extensionApi . executeRedisCommand ,
244
+ openCliForDatabase : extensionApiMock . openCliForDatabase ,
245
+ executeRedisCommand : extensionApiMock . executeRedisCommand ,
238
246
}
239
247
}
240
248
0 commit comments