@@ -8,7 +8,7 @@ import { Action } from 'vs/base/common/actions';
88import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding' ;
99import { IWorkspaceContextService , WorkbenchState } from 'vs/platform/workspace/common/workspace' ;
1010import { IDebugService , State , IEnablement , IBreakpoint , IDebugSession , ILaunch } from 'vs/workbench/contrib/debug/common/debug' ;
11- import { Variable , Breakpoint , FunctionBreakpoint } from 'vs/workbench/contrib/debug/common/debugModel' ;
11+ import { Variable , Breakpoint , FunctionBreakpoint , Expression } from 'vs/workbench/contrib/debug/common/debugModel' ;
1212import { IEditorService } from 'vs/workbench/services/editor/common/editorService' ;
1313import { INotificationService } from 'vs/platform/notification/common/notification' ;
1414import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService' ;
@@ -380,12 +380,12 @@ export class CopyValueAction extends Action {
380380 static readonly LABEL = nls . localize ( 'copyValue' , "Copy Value" ) ;
381381
382382 constructor (
383- id : string , label : string , private value : Variable | string , private context : string ,
383+ id : string , label : string , private value : Variable | Expression , private context : string ,
384384 @IDebugService private readonly debugService : IDebugService ,
385385 @IClipboardService private readonly clipboardService : IClipboardService
386386 ) {
387- super ( id , label , 'debug-action copy-value' ) ;
388- this . _enabled = typeof this . value === 'string' || ( this . value instanceof Variable && ! ! this . value . evaluateName ) ;
387+ super ( id , label ) ;
388+ this . _enabled = ( this . value instanceof Expression ) || ( this . value instanceof Variable && ! ! this . value . evaluateName ) ;
389389 }
390390
391391 async run ( ) : Promise < any > {
@@ -396,7 +396,7 @@ export class CopyValueAction extends Action {
396396 }
397397
398398 const context = session . capabilities . supportsClipboardContext ? 'clipboard' : this . context ;
399- const toEvaluate = typeof this . value === 'string' ? this . value : this . value . evaluateName || this . value . value ;
399+ const toEvaluate = this . value instanceof Variable ? ( this . value . evaluateName || this . value . value ) : this . value . name ;
400400
401401 try {
402402 const evaluation = await session . evaluate ( toEvaluate , stackFrame . frameId , context ) ;
0 commit comments