Skip to content

Commit f6c10ac

Browse files
committed
adjusting how children are added to clipboard
1 parent b238ca8 commit f6c10ac

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/views/live-watch/live-watch.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export interface LiveWatchValue {
3030
result: string;
3131
variablesReference: number;
3232
type?: string;
33+
evaluateName?: string;
3334
}
3435

3536
export class LiveWatchTreeDataProvider implements vscode.TreeDataProvider<LiveWatchNode> {
@@ -65,7 +66,9 @@ export class LiveWatchTreeDataProvider implements vscode.TreeDataProvider<LiveWa
6566
parent: element,
6667
value: {
6768
result: child.value,
68-
variablesReference: child.variablesReference
69+
variablesReference: child.variablesReference,
70+
type: child.type,
71+
evaluateName: child.evaluateName
6972
}
7073
})) ?? [];
7174

@@ -81,7 +84,7 @@ export class LiveWatchTreeDataProvider implements vscode.TreeDataProvider<LiveWa
8184
const item = new vscode.TreeItem(element.expression + ' = ');
8285
item.description = element.value.result;
8386
item.contextValue = 'expression';
84-
item.tooltip = element.value.type;
87+
item.tooltip = element.value.type ?? '';
8588
item.collapsibleState = element.value.variablesReference !== 0 ? vscode.TreeItemCollapsibleState.Collapsed : vscode.TreeItemCollapsibleState.None;
8689
return item;
8790
}
@@ -203,7 +206,7 @@ export class LiveWatchTreeDataProvider implements vscode.TreeDataProvider<LiveWa
203206
if(!node) {
204207
return;
205208
}
206-
await vscode.env.clipboard.writeText(node.expression);
209+
await vscode.env.clipboard.writeText(node.value.evaluateName ?? node.expression);
207210
}
208211

209212
private async handleAddFromSelectionCommand() {

0 commit comments

Comments
 (0)