Skip to content

Commit

Permalink
Fix plan and apply item tooltip (#1595)
Browse files Browse the repository at this point in the history
With the introduction of TFCRunTreeItem, any method that operates on a specific type of treeitem must check it's type. This is especially important in order to only resolve the tooltip for the RunTreeItem and not for Plan or Apply treeitems.

This also makes the Plan and Apply buttons use the same codeicon.
  • Loading branch information
jpogran committed Nov 6, 2023
1 parent fdd750f commit a653b74
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@
{
"command": "terraform.cloud.run.plan.downloadLog",
"title": "View raw plan log",
"icon": "$(book)"
"icon": "$(output)"
},
{
"command": "terraform.cloud.run.apply.downloadLog",
Expand Down
6 changes: 4 additions & 2 deletions src/providers/tfc/runProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,10 @@ export class RunTreeDataProvider implements vscode.TreeDataProvider<TFCRunTreeIt
}
}

async resolveTreeItem(item: vscode.TreeItem, element: RunTreeItem): Promise<vscode.TreeItem> {
item.tooltip = await runMarkdown(element);
async resolveTreeItem(item: vscode.TreeItem, element: TFCRunTreeItem): Promise<vscode.TreeItem> {
if (element instanceof RunTreeItem) {
item.tooltip = await runMarkdown(element);
}
return item;
}

Expand Down

0 comments on commit a653b74

Please sign in to comment.