Add history tree item command to open task

Signed-off-by: Sanjula Ganepola <sanjulagane@gmail.com>
This commit is contained in:
Sanjula Ganepola
2024-11-18 20:16:25 -05:00
parent fbd1371d70
commit 8d7c9e1fbf
2 changed files with 17 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
import { CancellationToken, commands, EventEmitter, ExtensionContext, extensions, TreeDataProvider, TreeItem, workspace } from "vscode";
import { CancellationToken, commands, EventEmitter, ExtensionContext, extensions, TreeDataProvider, TreeItem, window, workspace } from "vscode";
import { act } from "../../extension";
import { HistoryStatus } from "../../historyManager";
import { Utils } from "../../utils";
@@ -26,6 +26,14 @@ export default class HistoryTreeDataProvider implements TreeDataProvider<GithubL
commands.registerCommand('githubLocalActions.refreshHistory', async () => {
this.refresh();
}),
commands.registerCommand('githubLocalActions.focusTask', async (historyTreeItem: HistoryTreeItem) => {
const terminals = window.terminals;
for (const terminal of terminals) {
if (terminal.creationOptions.name === `${historyTreeItem.history.name} #${historyTreeItem.history.count}`) {
terminal.show();
}
}
}),
commands.registerCommand('githubLocalActions.viewOutput', async (historyTreeItem: HistoryTreeItem) => {
await act.historyManager.viewOutput(historyTreeItem.history);
}),