Merge pull request #2201 from github/koesie10/eval-log-viewer-typed-command
Convert codeQLEvalLogViewer.clear to a typed command
This commit is contained in:
@@ -138,11 +138,16 @@ export type DatabasePanelCommands = {
|
||||
"codeQLVariantAnalysisRepositories.removeItemContextMenu": SingleSelectionCommandFunction<DbTreeViewItem>;
|
||||
};
|
||||
|
||||
export type EvalLogViewerCommands = {
|
||||
"codeQLEvalLogViewer.clear": () => Promise<void>;
|
||||
};
|
||||
|
||||
export type AllCommands = BaseCommands &
|
||||
QueryHistoryCommands &
|
||||
LocalDatabasesCommands &
|
||||
VariantAnalysisCommands &
|
||||
DatabasePanelCommands;
|
||||
DatabasePanelCommands &
|
||||
EvalLogViewerCommands;
|
||||
|
||||
export type AppCommandManager = CommandManager<AllCommands>;
|
||||
|
||||
|
||||
@@ -8,11 +8,11 @@ import {
|
||||
EventEmitter,
|
||||
TreeItemCollapsibleState,
|
||||
} from "vscode";
|
||||
import { commandRunner } from "./commandRunner";
|
||||
import { DisposableObject } from "./pure/disposable-object";
|
||||
import { showAndLogExceptionWithTelemetry } from "./helpers";
|
||||
import { asError, getErrorMessage } from "./pure/helpers-pure";
|
||||
import { redactableError } from "./pure/errors";
|
||||
import { EvalLogViewerCommands } from "./common/commands";
|
||||
|
||||
export interface EvalLogTreeItem {
|
||||
label?: string;
|
||||
@@ -80,11 +80,12 @@ export class EvalLogViewer extends DisposableObject {
|
||||
|
||||
this.push(this.treeView);
|
||||
this.push(this.treeDataProvider);
|
||||
this.push(
|
||||
commandRunner("codeQLEvalLogViewer.clear", async () => {
|
||||
this.clear();
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
public getCommands(): EvalLogViewerCommands {
|
||||
return {
|
||||
"codeQLEvalLogViewer.clear": async () => this.clear(),
|
||||
};
|
||||
}
|
||||
|
||||
private clear(): void {
|
||||
|
||||
@@ -804,6 +804,7 @@ async function activateWithInstalledDistribution(
|
||||
...variantAnalysisManager.getCommands(),
|
||||
...databaseUI.getCommands(),
|
||||
...dbModule.getCommands(),
|
||||
...evalLogViewer.getCommands(),
|
||||
};
|
||||
|
||||
for (const [commandName, command] of Object.entries(allCommands)) {
|
||||
|
||||
Reference in New Issue
Block a user