@@ -11,7 +11,7 @@ import { getTitleForKey, handleMessage } from './utils'
1111import { ViewId } from './constants'
1212import { logger } from './logger'
1313import { registerUriHandler } from './utils/handleUri'
14- import * as extensionApi from './extensionApi '
14+ import * as extensionApiMock from './extensionApiMock '
1515
1616dotenv . config ( { path : path . join ( __dirname , '..' , '.env' ) } )
1717
@@ -217,24 +217,32 @@ export async function activate(context: vscode.ExtensionContext) {
217217 vscode . commands . registerCommand ( 'RedisForVSCode.refreshDatabases' , ( ) => {
218218 sidebarProvider . view ?. webview . postMessage ( { action : 'RefreshTree' } )
219219 } ) ,
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+ } ) ,
220228 )
221229
222230 registerUriHandler ( )
223231
224232 // Return the extension API to expose functionalities to the outer world
225233 return {
226234 // Core database operations
227- getAllDatabases : extensionApi . getAllDatabases ,
228- getDatabaseById : extensionApi . getDatabaseById ,
235+ getAllDatabases : extensionApiMock . getAllDatabases ,
236+ getDatabaseById : extensionApiMock . getDatabaseById ,
229237
230238 // 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 ,
234242
235243 // CLI operations
236- openCliForDatabase : extensionApi . openCliForDatabase ,
237- executeRedisCommand : extensionApi . executeRedisCommand ,
244+ openCliForDatabase : extensionApiMock . openCliForDatabase ,
245+ executeRedisCommand : extensionApiMock . executeRedisCommand ,
238246 }
239247}
240248
0 commit comments