Skip to content

Commit

Permalink
Re-sort databases list after db rename
Browse files Browse the repository at this point in the history
  • Loading branch information
aeisenberg committed Nov 20, 2020
1 parent 83f64fb commit f48176b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions extensions/ql-vscode/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- Alter structure of the _Test Explorer_ tree. It now follows the structure of the filesystem instead of the QL Packs. [#624](https://github.com/github/vscode-codeql/pull/624)
- Add more structured output for tests. [#626](https://github.com/github/vscode-codeql/pull/626)
- Whenever the extension restarts, orphaned databases will be cleaned up. These are databases whose files are located inside of the extension's storage area, but are not imported into the workspace.
- After renaming a database, the database list is re-sorted. [#685](https://github.com/github/vscode-codeql/pull/685)

## 1.3.6 - 4 November 2020

Expand Down
2 changes: 1 addition & 1 deletion extensions/ql-vscode/src/databases-ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import {
promptImportInternetDatabase,
promptImportLgtmDatabase,
} from './databaseFetcher';
import { CancellationToken } from 'vscode-jsonrpc';
import { CancellationToken } from 'vscode';
import { asyncFilter } from './pure/helpers-pure';

type ThemableIconPath = { light: string; dark: string } | string;
Expand Down
3 changes: 2 additions & 1 deletion extensions/ql-vscode/src/databases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,8 @@ export class DatabaseManager extends DisposableObject {
item.name = newName;
this.updatePersistedDatabaseList();
this._onDidChangeDatabaseItem.fire({
item,
// pass undefined so that the entire tree is rebuilt in order to re-sort
item: undefined,
kind: DatabaseEventKind.Rename
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ describe('databases', () => {
expect(mockDbItem.name).to.eq('new name');
expect(updateSpy).to.have.been.calledWith('databaseList', ['new name']);
expect(spy).to.have.been.calledWith({
item: mockDbItem,
item: undefined,
kind: DatabaseEventKind.Rename
});
});
Expand Down

0 comments on commit f48176b

Please sign in to comment.