Skip to content

Commit 92bf068

Browse files
authored
debug: fix variables view does not show custom hover (microsoft#209058)
* debug: fix variables view does not show custom hover Fixes microsoft#208429 Also adds easy access to copy expression/evaluateName since a user is likely to do that after looking at the value (which is often incomplete or summarized in the variables view) ![](https://memes.peet.io/img/24-03-26f2738f-6b21-4223-90ea-4e6938720582.png) cc @amunger if you want to adopt this for notebook variables: extra commands can be added in the hover by passing an object into `hover`. Note: the hover is too persistent right now due to microsoft#209057 * fix formatting * use action bar instead
1 parent fdca786 commit 92bf068

File tree

10 files changed

+95
-35
lines changed

10 files changed

+95
-35
lines changed

src/vs/workbench/contrib/debug/browser/baseDebugView.ts

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ import { KeyCode } from 'vs/base/common/keyCodes';
1818
import { DisposableStore, IDisposable, dispose, toDisposable } from 'vs/base/common/lifecycle';
1919
import { ThemeIcon } from 'vs/base/common/themables';
2020
import { localize } from 'vs/nls';
21+
import { CommandsRegistry, ICommandService } from 'vs/platform/commands/common/commands';
2122
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
2223
import { defaultInputBoxStyles } from 'vs/platform/theme/browser/defaultStyles';
24+
import { COPY_EVALUATE_PATH_ID, COPY_VALUE_ID } from 'vs/workbench/contrib/debug/browser/debugCommands';
2325
import { LinkDetector } from 'vs/workbench/contrib/debug/browser/linkDetector';
2426
import { IDebugService, IExpression, IExpressionValue } from 'vs/workbench/contrib/debug/common/debug';
2527
import { Expression, ExpressionContainer, Variable } from 'vs/workbench/contrib/debug/common/debugModel';
@@ -34,7 +36,12 @@ const $ = dom.$;
3436
export interface IRenderValueOptions {
3537
showChanged?: boolean;
3638
maxValueLength?: number;
37-
showHover?: boolean;
39+
/** If set, a hover will be shown on the element. Requires a disposable store for usage. */
40+
hover?: DisposableStore | {
41+
store: DisposableStore;
42+
commands: { id: string; args: unknown[] }[];
43+
commandService: ICommandService;
44+
};
3845
colorize?: boolean;
3946
linkDetector?: LinkDetector;
4047
}
@@ -99,12 +106,31 @@ export function renderExpressionValue(expressionOrValue: IExpressionValue | stri
99106
} else {
100107
container.textContent = value;
101108
}
102-
if (options.showHover) {
103-
container.title = value || '';
109+
110+
if (options.hover) {
111+
const { store, commands, commandService } = options.hover instanceof DisposableStore ? { store: options.hover, commands: [], commandService: undefined } : options.hover;
112+
store.add(setupCustomHover(getDefaultHoverDelegate('mouse'), container, () => {
113+
const container = dom.$('div');
114+
const markdownHoverElement = dom.$('div.hover-row');
115+
const hoverContentsElement = dom.append(markdownHoverElement, dom.$('div.hover-contents'));
116+
const hoverContentsPre = dom.append(hoverContentsElement, dom.$('pre.debug-var-hover-pre'));
117+
hoverContentsPre.textContent = value;
118+
container.appendChild(markdownHoverElement);
119+
return container;
120+
}, {
121+
actions: commands.map(({ id, args }) => {
122+
const description = CommandsRegistry.getCommand(id)?.metadata?.description;
123+
return {
124+
label: typeof description === 'string' ? description : description ? description.value : id,
125+
commandId: id,
126+
run: () => commandService!.executeCommand(id, ...args),
127+
};
128+
})
129+
}));
104130
}
105131
}
106132

107-
export function renderVariable(variable: Variable, data: IVariableTemplateData, showChanged: boolean, highlights: IHighlight[], linkDetector?: LinkDetector): void {
133+
export function renderVariable(store: DisposableStore, commandService: ICommandService, variable: Variable, data: IVariableTemplateData, showChanged: boolean, highlights: IHighlight[], linkDetector?: LinkDetector): void {
108134
if (variable.available) {
109135
let text = variable.name;
110136
if (variable.value && typeof variable.name === 'string') {
@@ -118,10 +144,17 @@ export function renderVariable(variable: Variable, data: IVariableTemplateData,
118144
}
119145

120146
data.expression.classList.toggle('lazy', !!variable.presentationHint?.lazy);
147+
const commands = [
148+
{ id: COPY_VALUE_ID, args: [variable, [variable]] as unknown[] }
149+
];
150+
if (variable.evaluateName) {
151+
commands.push({ id: COPY_EVALUATE_PATH_ID, args: [{ variable }] });
152+
}
153+
121154
renderExpressionValue(variable, data.value, {
122155
showChanged,
123156
maxValueLength: MAX_VALUE_RENDER_LENGTH_IN_VIEWLET,
124-
showHover: true,
157+
hover: { store, commands, commandService },
125158
colorize: true,
126159
linkDetector
127160
});

src/vs/workbench/contrib/debug/browser/debug.contribution.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import { BreakpointsView } from 'vs/workbench/contrib/debug/browser/breakpointsV
2929
import { CallStackEditorContribution } from 'vs/workbench/contrib/debug/browser/callStackEditorContribution';
3030
import { CallStackView } from 'vs/workbench/contrib/debug/browser/callStackView';
3131
import { registerColors } from 'vs/workbench/contrib/debug/browser/debugColors';
32-
import { ADD_CONFIGURATION_ID, CALLSTACK_BOTTOM_ID, CALLSTACK_BOTTOM_LABEL, CALLSTACK_DOWN_ID, CALLSTACK_DOWN_LABEL, CALLSTACK_TOP_ID, CALLSTACK_TOP_LABEL, CALLSTACK_UP_ID, CALLSTACK_UP_LABEL, CONTINUE_ID, CONTINUE_LABEL, COPY_STACK_TRACE_ID, DEBUG_COMMAND_CATEGORY, DEBUG_CONSOLE_QUICK_ACCESS_PREFIX, DEBUG_QUICK_ACCESS_PREFIX, DEBUG_RUN_COMMAND_ID, DEBUG_RUN_LABEL, DEBUG_START_COMMAND_ID, DEBUG_START_LABEL, DISCONNECT_AND_SUSPEND_ID, DISCONNECT_AND_SUSPEND_LABEL, DISCONNECT_ID, DISCONNECT_LABEL, EDIT_EXPRESSION_COMMAND_ID, FOCUS_REPL_ID, JUMP_TO_CURSOR_ID, NEXT_DEBUG_CONSOLE_ID, NEXT_DEBUG_CONSOLE_LABEL, OPEN_LOADED_SCRIPTS_LABEL, PAUSE_ID, PAUSE_LABEL, PREV_DEBUG_CONSOLE_ID, PREV_DEBUG_CONSOLE_LABEL, REMOVE_EXPRESSION_COMMAND_ID, RESTART_FRAME_ID, RESTART_LABEL, RESTART_SESSION_ID, SELECT_AND_START_ID, SELECT_AND_START_LABEL, SELECT_DEBUG_CONSOLE_ID, SELECT_DEBUG_CONSOLE_LABEL, SELECT_DEBUG_SESSION_ID, SELECT_DEBUG_SESSION_LABEL, SET_EXPRESSION_COMMAND_ID, SHOW_LOADED_SCRIPTS_ID, STEP_INTO_ID, STEP_INTO_LABEL, STEP_INTO_TARGET_ID, STEP_INTO_TARGET_LABEL, STEP_OUT_ID, STEP_OUT_LABEL, STEP_OVER_ID, STEP_OVER_LABEL, STOP_ID, STOP_LABEL, TERMINATE_THREAD_ID, TOGGLE_INLINE_BREAKPOINT_ID } from 'vs/workbench/contrib/debug/browser/debugCommands';
32+
import { ADD_CONFIGURATION_ID, ADD_TO_WATCH_ID, ADD_TO_WATCH_LABEL, CALLSTACK_BOTTOM_ID, CALLSTACK_BOTTOM_LABEL, CALLSTACK_DOWN_ID, CALLSTACK_DOWN_LABEL, CALLSTACK_TOP_ID, CALLSTACK_TOP_LABEL, CALLSTACK_UP_ID, CALLSTACK_UP_LABEL, CONTINUE_ID, CONTINUE_LABEL, COPY_EVALUATE_PATH_ID, COPY_EVALUATE_PATH_LABEL, COPY_STACK_TRACE_ID, COPY_VALUE_ID, COPY_VALUE_LABEL, DEBUG_COMMAND_CATEGORY, DEBUG_CONSOLE_QUICK_ACCESS_PREFIX, DEBUG_QUICK_ACCESS_PREFIX, DEBUG_RUN_COMMAND_ID, DEBUG_RUN_LABEL, DEBUG_START_COMMAND_ID, DEBUG_START_LABEL, DISCONNECT_AND_SUSPEND_ID, DISCONNECT_AND_SUSPEND_LABEL, DISCONNECT_ID, DISCONNECT_LABEL, EDIT_EXPRESSION_COMMAND_ID, FOCUS_REPL_ID, JUMP_TO_CURSOR_ID, NEXT_DEBUG_CONSOLE_ID, NEXT_DEBUG_CONSOLE_LABEL, OPEN_LOADED_SCRIPTS_LABEL, PAUSE_ID, PAUSE_LABEL, PREV_DEBUG_CONSOLE_ID, PREV_DEBUG_CONSOLE_LABEL, REMOVE_EXPRESSION_COMMAND_ID, RESTART_FRAME_ID, RESTART_LABEL, RESTART_SESSION_ID, SELECT_AND_START_ID, SELECT_AND_START_LABEL, SELECT_DEBUG_CONSOLE_ID, SELECT_DEBUG_CONSOLE_LABEL, SELECT_DEBUG_SESSION_ID, SELECT_DEBUG_SESSION_LABEL, SET_EXPRESSION_COMMAND_ID, SHOW_LOADED_SCRIPTS_ID, STEP_INTO_ID, STEP_INTO_LABEL, STEP_INTO_TARGET_ID, STEP_INTO_TARGET_LABEL, STEP_OUT_ID, STEP_OUT_LABEL, STEP_OVER_ID, STEP_OVER_LABEL, STOP_ID, STOP_LABEL, TERMINATE_THREAD_ID, TOGGLE_INLINE_BREAKPOINT_ID } from 'vs/workbench/contrib/debug/browser/debugCommands';
3333
import { DebugConsoleQuickAccess } from 'vs/workbench/contrib/debug/browser/debugConsoleQuickAccess';
3434
import { RunToCursorAction, SelectionToReplAction, SelectionToWatchExpressionsAction } from 'vs/workbench/contrib/debug/browser/debugEditorActions';
3535
import { DebugEditorContribution } from 'vs/workbench/contrib/debug/browser/debugEditorContribution';
@@ -45,7 +45,7 @@ import { DisassemblyView, DisassemblyViewContribution } from 'vs/workbench/contr
4545
import { LoadedScriptsView } from 'vs/workbench/contrib/debug/browser/loadedScriptsView';
4646
import { Repl } from 'vs/workbench/contrib/debug/browser/repl';
4747
import { StatusBarColorProvider } from 'vs/workbench/contrib/debug/browser/statusbarColorProvider';
48-
import { ADD_TO_WATCH_ID, BREAK_WHEN_VALUE_CHANGES_ID, BREAK_WHEN_VALUE_IS_ACCESSED_ID, BREAK_WHEN_VALUE_IS_READ_ID, COPY_EVALUATE_PATH_ID, COPY_VALUE_ID, SET_VARIABLE_ID, VIEW_MEMORY_ID, VariablesView } from 'vs/workbench/contrib/debug/browser/variablesView';
48+
import { BREAK_WHEN_VALUE_CHANGES_ID, BREAK_WHEN_VALUE_IS_ACCESSED_ID, BREAK_WHEN_VALUE_IS_READ_ID, SET_VARIABLE_ID, VIEW_MEMORY_ID, VariablesView } from 'vs/workbench/contrib/debug/browser/variablesView';
4949
import { ADD_WATCH_ID, ADD_WATCH_LABEL, REMOVE_WATCH_EXPRESSIONS_COMMAND_ID, REMOVE_WATCH_EXPRESSIONS_LABEL, WatchExpressionsView } from 'vs/workbench/contrib/debug/browser/watchExpressionsView';
5050
import { WelcomeView } from 'vs/workbench/contrib/debug/browser/welcomeView';
5151
import { BREAKPOINTS_VIEW_ID, BREAKPOINT_EDITOR_CONTRIBUTION_ID, CALLSTACK_VIEW_ID, CONTEXT_BREAKPOINTS_EXIST, CONTEXT_BREAK_WHEN_VALUE_CHANGES_SUPPORTED, CONTEXT_BREAK_WHEN_VALUE_IS_ACCESSED_SUPPORTED, CONTEXT_BREAK_WHEN_VALUE_IS_READ_SUPPORTED, CONTEXT_CALLSTACK_ITEM_TYPE, CONTEXT_CAN_VIEW_MEMORY, CONTEXT_DEBUGGERS_AVAILABLE, CONTEXT_DEBUG_STATE, CONTEXT_DEBUG_UX, CONTEXT_FOCUSED_SESSION_IS_ATTACH, CONTEXT_FOCUSED_SESSION_IS_NO_DEBUG, CONTEXT_HAS_DEBUGGED, CONTEXT_IN_DEBUG_MODE, CONTEXT_JUMP_TO_CURSOR_SUPPORTED, CONTEXT_LOADED_SCRIPTS_SUPPORTED, CONTEXT_RESTART_FRAME_SUPPORTED, CONTEXT_SET_EXPRESSION_SUPPORTED, CONTEXT_SET_VARIABLE_SUPPORTED, CONTEXT_STACK_FRAME_SUPPORTS_RESTART, CONTEXT_STEP_INTO_TARGETS_SUPPORTED, CONTEXT_SUSPEND_DEBUGGEE_SUPPORTED, CONTEXT_TERMINATE_DEBUGGEE_SUPPORTED, CONTEXT_VARIABLE_EVALUATE_NAME_PRESENT, CONTEXT_VARIABLE_IS_READONLY, CONTEXT_VARIABLE_VALUE, CONTEXT_WATCH_ITEM_TYPE, DEBUG_PANEL_ID, DISASSEMBLY_VIEW_ID, EDITOR_CONTRIBUTION_ID, IDebugService, INTERNAL_CONSOLE_OPTIONS_SCHEMA, LOADED_SCRIPTS_VIEW_ID, REPL_VIEW_ID, State, VARIABLES_VIEW_ID, VIEWLET_ID, WATCH_VIEW_ID, getStateLabel } from 'vs/workbench/contrib/debug/common/debug';
@@ -174,17 +174,17 @@ registerDebugViewMenuItem(MenuId.DebugCallStackContext, COPY_STACK_TRACE_ID, nls
174174

175175
registerDebugViewMenuItem(MenuId.DebugVariablesContext, VIEW_MEMORY_ID, nls.localize('viewMemory', "View Binary Data"), 15, CONTEXT_CAN_VIEW_MEMORY, CONTEXT_IN_DEBUG_MODE, 'inline', icons.debugInspectMemory);
176176
registerDebugViewMenuItem(MenuId.DebugVariablesContext, SET_VARIABLE_ID, nls.localize('setValue', "Set Value"), 10, ContextKeyExpr.or(CONTEXT_SET_VARIABLE_SUPPORTED, ContextKeyExpr.and(CONTEXT_VARIABLE_EVALUATE_NAME_PRESENT, CONTEXT_SET_EXPRESSION_SUPPORTED)), CONTEXT_VARIABLE_IS_READONLY.toNegated(), '3_modification');
177-
registerDebugViewMenuItem(MenuId.DebugVariablesContext, COPY_VALUE_ID, nls.localize('copyValue', "Copy Value"), 10, undefined, undefined, '5_cutcopypaste');
178-
registerDebugViewMenuItem(MenuId.DebugVariablesContext, COPY_EVALUATE_PATH_ID, nls.localize('copyAsExpression', "Copy as Expression"), 20, CONTEXT_VARIABLE_EVALUATE_NAME_PRESENT, undefined, '5_cutcopypaste');
179-
registerDebugViewMenuItem(MenuId.DebugVariablesContext, ADD_TO_WATCH_ID, nls.localize('addToWatchExpressions', "Add to Watch"), 100, CONTEXT_VARIABLE_EVALUATE_NAME_PRESENT, undefined, 'z_commands');
177+
registerDebugViewMenuItem(MenuId.DebugVariablesContext, COPY_VALUE_ID, COPY_VALUE_LABEL, 10, undefined, undefined, '5_cutcopypaste');
178+
registerDebugViewMenuItem(MenuId.DebugVariablesContext, COPY_EVALUATE_PATH_ID, COPY_EVALUATE_PATH_LABEL, 20, CONTEXT_VARIABLE_EVALUATE_NAME_PRESENT, undefined, '5_cutcopypaste');
179+
registerDebugViewMenuItem(MenuId.DebugVariablesContext, ADD_TO_WATCH_ID, ADD_TO_WATCH_LABEL, 100, CONTEXT_VARIABLE_EVALUATE_NAME_PRESENT, undefined, 'z_commands');
180180
registerDebugViewMenuItem(MenuId.DebugVariablesContext, BREAK_WHEN_VALUE_IS_READ_ID, nls.localize('breakWhenValueIsRead', "Break on Value Read"), 200, CONTEXT_BREAK_WHEN_VALUE_IS_READ_SUPPORTED, undefined, 'z_commands');
181181
registerDebugViewMenuItem(MenuId.DebugVariablesContext, BREAK_WHEN_VALUE_CHANGES_ID, nls.localize('breakWhenValueChanges', "Break on Value Change"), 210, CONTEXT_BREAK_WHEN_VALUE_CHANGES_SUPPORTED, undefined, 'z_commands');
182182
registerDebugViewMenuItem(MenuId.DebugVariablesContext, BREAK_WHEN_VALUE_IS_ACCESSED_ID, nls.localize('breakWhenValueIsAccessed', "Break on Value Access"), 220, CONTEXT_BREAK_WHEN_VALUE_IS_ACCESSED_SUPPORTED, undefined, 'z_commands');
183183

184184
registerDebugViewMenuItem(MenuId.DebugHoverContext, VIEW_MEMORY_ID, nls.localize('viewMemory', "View Binary Data"), 15, CONTEXT_CAN_VIEW_MEMORY, CONTEXT_IN_DEBUG_MODE, 'inline', icons.debugInspectMemory);
185-
registerDebugViewMenuItem(MenuId.DebugHoverContext, COPY_VALUE_ID, nls.localize('copyValue', "Copy Value"), 10, undefined, undefined, '5_cutcopypaste');
186-
registerDebugViewMenuItem(MenuId.DebugHoverContext, COPY_EVALUATE_PATH_ID, nls.localize('copyAsExpression', "Copy as Expression"), 20, CONTEXT_VARIABLE_EVALUATE_NAME_PRESENT, undefined, '5_cutcopypaste');
187-
registerDebugViewMenuItem(MenuId.DebugHoverContext, ADD_TO_WATCH_ID, nls.localize('addToWatchExpressions', "Add to Watch"), 100, CONTEXT_VARIABLE_EVALUATE_NAME_PRESENT, undefined, 'z_commands');
185+
registerDebugViewMenuItem(MenuId.DebugHoverContext, COPY_VALUE_ID, COPY_VALUE_LABEL, 10, undefined, undefined, '5_cutcopypaste');
186+
registerDebugViewMenuItem(MenuId.DebugHoverContext, COPY_EVALUATE_PATH_ID, COPY_EVALUATE_PATH_LABEL, 20, CONTEXT_VARIABLE_EVALUATE_NAME_PRESENT, undefined, '5_cutcopypaste');
187+
registerDebugViewMenuItem(MenuId.DebugHoverContext, ADD_TO_WATCH_ID, ADD_TO_WATCH_LABEL, 100, CONTEXT_VARIABLE_EVALUATE_NAME_PRESENT, undefined, 'z_commands');
188188
registerDebugViewMenuItem(MenuId.DebugHoverContext, BREAK_WHEN_VALUE_IS_READ_ID, nls.localize('breakWhenValueIsRead', "Break on Value Read"), 200, CONTEXT_BREAK_WHEN_VALUE_IS_READ_SUPPORTED, undefined, 'z_commands');
189189
registerDebugViewMenuItem(MenuId.DebugHoverContext, BREAK_WHEN_VALUE_CHANGES_ID, nls.localize('breakWhenValueChanges', "Break on Value Change"), 210, CONTEXT_BREAK_WHEN_VALUE_CHANGES_SUPPORTED, undefined, 'z_commands');
190190
registerDebugViewMenuItem(MenuId.DebugHoverContext, BREAK_WHEN_VALUE_IS_ACCESSED_ID, nls.localize('breakWhenValueIsAccessed', "Break on Value Access"), 220, CONTEXT_BREAK_WHEN_VALUE_IS_ACCESSED_SUPPORTED, undefined, 'z_commands');

src/vs/workbench/contrib/debug/browser/debugCommands.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ export const CALLSTACK_TOP_ID = 'workbench.action.debug.callStackTop';
7373
export const CALLSTACK_BOTTOM_ID = 'workbench.action.debug.callStackBottom';
7474
export const CALLSTACK_UP_ID = 'workbench.action.debug.callStackUp';
7575
export const CALLSTACK_DOWN_ID = 'workbench.action.debug.callStackDown';
76+
export const ADD_TO_WATCH_ID = 'debug.addToWatchExpressions';
77+
export const COPY_EVALUATE_PATH_ID = 'debug.copyEvaluatePath';
78+
export const COPY_VALUE_ID = 'workbench.debug.viewlet.action.copyValue';
7679

7780
export const DEBUG_COMMAND_CATEGORY: ILocalizedString = nls.localize2('debug', 'Debug');
7881
export const RESTART_LABEL = nls.localize2('restartDebug', "Restart");
@@ -97,6 +100,9 @@ export const CALLSTACK_TOP_LABEL = nls.localize2('callStackTop', "Navigate to To
97100
export const CALLSTACK_BOTTOM_LABEL = nls.localize2('callStackBottom', "Navigate to Bottom of Call Stack");
98101
export const CALLSTACK_UP_LABEL = nls.localize2('callStackUp', "Navigate Up Call Stack");
99102
export const CALLSTACK_DOWN_LABEL = nls.localize2('callStackDown', "Navigate Down Call Stack");
103+
export const COPY_EVALUATE_PATH_LABEL = nls.localize2('copyAsExpression', "Copy as Expression");
104+
export const COPY_VALUE_LABEL = nls.localize2('copyValue', "Copy Value");
105+
export const ADD_TO_WATCH_LABEL = nls.localize2('addToWatchExpressions', "Add to Watch");
100106

101107
export const SELECT_DEBUG_CONSOLE_LABEL = nls.localize2('selectDebugConsole', "Select Debug Console");
102108
export const SELECT_DEBUG_SESSION_LABEL = nls.localize2('selectDebugSession', "Select Debug Session");

src/vs/workbench/contrib/debug/browser/media/debug.contribution.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@
5454
vertical-align: middle;
5555
}
5656

57+
.debug-var-hover-pre {
58+
margin: 0;
59+
}
60+
5761
/* Do not push text with inline decoration when decoration on start of line */
5862
.monaco-editor .debug-top-stack-frame-column.start-of-line {
5963
position: absolute;

src/vs/workbench/contrib/debug/browser/media/debugViewlet.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@
230230
}
231231

232232
.debug-pane .monaco-list-row .expression .value {
233+
height: 22px;
233234
overflow: hidden;
234235
white-space: pre;
235236
text-overflow: ellipsis;

src/vs/workbench/contrib/debug/browser/replViewer.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import { RawObjectReplElement, ReplEvaluationInput, ReplEvaluationResult, ReplGr
3030
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
3131
import { setupCustomHover } from 'vs/base/browser/ui/hover/updatableHoverWidget';
3232
import { getDefaultHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegateFactory';
33+
import { ICommandService } from 'vs/platform/commands/common/commands';
3334

3435
const $ = dom.$;
3536

@@ -136,7 +137,6 @@ export class ReplEvaluationResultsRenderer implements ITreeRenderer<ReplEvaluati
136137
renderElement(element: ITreeNode<ReplEvaluationResult | Variable, FuzzyScore>, index: number, templateData: IReplEvaluationResultTemplateData): void {
137138
const expression = element.element;
138139
renderExpressionValue(expression, templateData.value, {
139-
showHover: false,
140140
colorize: true,
141141
linkDetector: this.linkDetector
142142
});
@@ -235,6 +235,7 @@ export class ReplVariablesRenderer extends AbstractExpressionsRenderer<IExpressi
235235
private readonly linkDetector: LinkDetector,
236236
@IDebugService debugService: IDebugService,
237237
@IContextViewService contextViewService: IContextViewService,
238+
@ICommandService private readonly commandService: ICommandService,
238239
) {
239240
super(debugService, contextViewService);
240241
}
@@ -248,10 +249,10 @@ export class ReplVariablesRenderer extends AbstractExpressionsRenderer<IExpressi
248249
const isReplVariable = expression instanceof ReplVariableElement;
249250
if (isReplVariable || !expression.name) {
250251
data.label.set('');
251-
renderExpressionValue(isReplVariable ? expression.expression : expression, data.value, { showHover: false, colorize: true, linkDetector: this.linkDetector });
252+
renderExpressionValue(isReplVariable ? expression.expression : expression, data.value, { colorize: true, linkDetector: this.linkDetector });
252253
data.expression.classList.remove('nested-variable');
253254
} else {
254-
renderVariable(expression as Variable, data, true, highlights, this.linkDetector);
255+
renderVariable(data.elementDisposable, this.commandService, expression as Variable, data, true, highlights, this.linkDetector);
255256
data.expression.classList.toggle('nested-variable', isNestedVariable(expression));
256257
}
257258
}
@@ -293,7 +294,6 @@ export class ReplRawObjectsRenderer implements ITreeRenderer<RawObjectReplElemen
293294

294295
// value
295296
renderExpressionValue(element.value, templateData.value, {
296-
showHover: false,
297297
linkDetector: this.linkDetector
298298
});
299299
}

0 commit comments

Comments
 (0)