@@ -3,7 +3,6 @@ import { DisposableObject } from './vscode-utils/disposable-object';
33import {
44 Event ,
55 EventEmitter ,
6- ExtensionContext ,
76 ProviderResult ,
87 TreeDataProvider ,
98 TreeItem ,
@@ -83,8 +82,8 @@ class DatabaseTreeDataProvider extends DisposableObject
8382 private currentDatabaseItem : DatabaseItem | undefined ;
8483
8584 constructor (
86- private ctx : ExtensionContext ,
87- private databaseManager : DatabaseManager
85+ private databaseManager : DatabaseManager ,
86+ private readonly extensionPath : string
8887 ) {
8988 super ( ) ;
9089
@@ -131,12 +130,12 @@ class DatabaseTreeDataProvider extends DisposableObject
131130 const item = new TreeItem ( element . name ) ;
132131 if ( element === this . currentDatabaseItem ) {
133132 item . iconPath = joinThemableIconPath (
134- this . ctx . extensionPath ,
133+ this . extensionPath ,
135134 SELECTED_DATABASE_ICON
136135 ) ;
137136 } else if ( element . error !== undefined ) {
138137 item . iconPath = joinThemableIconPath (
139- this . ctx . extensionPath ,
138+ this . extensionPath ,
140139 INVALID_DATABASE_ICON
141140 ) ;
142141 }
@@ -213,16 +212,16 @@ export class DatabaseUI extends DisposableObject {
213212 private treeDataProvider : DatabaseTreeDataProvider ;
214213
215214 public constructor (
216- ctx : ExtensionContext ,
217215 private cliserver : cli . CodeQLCliServer ,
218216 private databaseManager : DatabaseManager ,
219217 private readonly queryServer : qsClient . QueryServerClient | undefined ,
220- private readonly storagePath : string
218+ private readonly storagePath : string ,
219+ readonly extensionPath : string
221220 ) {
222221 super ( ) ;
223222
224223 this . treeDataProvider = this . push (
225- new DatabaseTreeDataProvider ( ctx , databaseManager )
224+ new DatabaseTreeDataProvider ( databaseManager , extensionPath )
226225 ) ;
227226 this . push (
228227 window . createTreeView ( 'codeQLDatabases' , {
@@ -232,7 +231,7 @@ export class DatabaseUI extends DisposableObject {
232231 ) ;
233232
234233 logger . log ( 'Registering database panel commands.' ) ;
235- ctx . subscriptions . push (
234+ this . push (
236235 commandRunnerWithProgress (
237236 'codeQL.setCurrentDatabase' ,
238237 this . handleSetCurrentDatabase ,
@@ -241,7 +240,7 @@ export class DatabaseUI extends DisposableObject {
241240 }
242241 )
243242 ) ;
244- ctx . subscriptions . push (
243+ this . push (
245244 commandRunnerWithProgress (
246245 'codeQL.upgradeCurrentDatabase' ,
247246 this . handleUpgradeCurrentDatabase ,
@@ -251,7 +250,7 @@ export class DatabaseUI extends DisposableObject {
251250 }
252251 )
253252 ) ;
254- ctx . subscriptions . push (
253+ this . push (
255254 commandRunnerWithProgress (
256255 'codeQL.clearCache' ,
257256 this . handleClearCache ,
@@ -260,7 +259,7 @@ export class DatabaseUI extends DisposableObject {
260259 } )
261260 ) ;
262261
263- ctx . subscriptions . push (
262+ this . push (
264263 commandRunnerWithProgress (
265264 'codeQLDatabases.chooseDatabaseFolder' ,
266265 this . handleChooseDatabaseFolder ,
@@ -269,7 +268,7 @@ export class DatabaseUI extends DisposableObject {
269268 }
270269 )
271270 ) ;
272- ctx . subscriptions . push (
271+ this . push (
273272 commandRunnerWithProgress (
274273 'codeQLDatabases.chooseDatabaseArchive' ,
275274 this . handleChooseDatabaseArchive ,
@@ -278,7 +277,7 @@ export class DatabaseUI extends DisposableObject {
278277 }
279278 )
280279 ) ;
281- ctx . subscriptions . push (
280+ this . push (
282281 commandRunnerWithProgress (
283282 'codeQLDatabases.chooseDatabaseInternet' ,
284283 this . handleChooseDatabaseInternet ,
@@ -287,39 +286,39 @@ export class DatabaseUI extends DisposableObject {
287286 }
288287 )
289288 ) ;
290- ctx . subscriptions . push (
289+ this . push (
291290 commandRunnerWithProgress (
292291 'codeQLDatabases.chooseDatabaseLgtm' ,
293292 this . handleChooseDatabaseLgtm ,
294293 {
295294 title : 'Adding database from LGTM' ,
296295 } )
297296 ) ;
298- ctx . subscriptions . push (
297+ this . push (
299298 commandRunner (
300299 'codeQLDatabases.setCurrentDatabase' ,
301300 this . handleMakeCurrentDatabase
302301 )
303302 ) ;
304- ctx . subscriptions . push (
303+ this . push (
305304 commandRunner (
306305 'codeQLDatabases.sortByName' ,
307306 this . handleSortByName
308307 )
309308 ) ;
310- ctx . subscriptions . push (
309+ this . push (
311310 commandRunner (
312311 'codeQLDatabases.sortByDateAdded' ,
313312 this . handleSortByDateAdded
314313 )
315314 ) ;
316- ctx . subscriptions . push (
315+ this . push (
317316 commandRunner (
318317 'codeQLDatabases.removeDatabase' ,
319318 this . handleRemoveDatabase
320319 )
321320 ) ;
322- ctx . subscriptions . push (
321+ this . push (
323322 commandRunnerWithProgress (
324323 'codeQLDatabases.upgradeDatabase' ,
325324 this . handleUpgradeDatabase ,
@@ -329,13 +328,13 @@ export class DatabaseUI extends DisposableObject {
329328 }
330329 )
331330 ) ;
332- ctx . subscriptions . push (
331+ this . push (
333332 commandRunner (
334333 'codeQLDatabases.renameDatabase' ,
335334 this . handleRenameDatabase
336335 )
337336 ) ;
338- ctx . subscriptions . push (
337+ this . push (
339338 commandRunner (
340339 'codeQLDatabases.openDatabaseFolder' ,
341340 this . handleOpenFolder
0 commit comments