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:
Andrew Eisenberg
2021-10-19 11:04:22 -07:00
committed by GitHub
3 changed files with 4 additions and 1 deletions

View File

@@ -604,7 +604,7 @@
{
"command": "codeQLDatabases.setCurrentDatabase",
"group": "inline",
"when": "view == codeQLDatabases"
"when": "view == codeQLDatabases && viewItem != currentDatabase"
},
{
"command": "codeQLDatabases.removeDatabase",

View File

@@ -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,

View File

@@ -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