Merge pull request #976 from marcnjaramillo/selected-database-view
Fix issue where 'Set current database' shows on selected database in …
This commit is contained in:
@@ -604,7 +604,7 @@
|
||||
{
|
||||
"command": "codeQLDatabases.setCurrentDatabase",
|
||||
"group": "inline",
|
||||
"when": "view == codeQLDatabases"
|
||||
"when": "view == codeQLDatabases && viewItem != currentDatabase"
|
||||
},
|
||||
{
|
||||
"command": "codeQLDatabases.removeDatabase",
|
||||
|
||||
@@ -135,6 +135,7 @@ class DatabaseTreeDataProvider extends DisposableObject
|
||||
this.extensionPath,
|
||||
SELECTED_DATABASE_ICON
|
||||
);
|
||||
item.contextValue = 'currentDatabase';
|
||||
} else if (element.error !== undefined) {
|
||||
item.iconPath = joinThemableIconPath(
|
||||
this.extensionPath,
|
||||
|
||||
@@ -731,6 +731,8 @@ export class DatabaseManager extends DisposableObject {
|
||||
this._currentDatabaseItem = item;
|
||||
this.updatePersistedCurrentDatabaseItem();
|
||||
|
||||
await vscode.commands.executeCommand('setContext', 'codeQL.currentDatabaseItem', item?.name);
|
||||
|
||||
this._onDidChangeCurrentDatabaseItem.fire({
|
||||
item,
|
||||
kind: DatabaseEventKind.Change
|
||||
|
||||
Reference in New Issue
Block a user