@@ -15,8 +15,8 @@ import { Codicon } from '../../../../base/common/codicons.js';
15
15
import { FuzzyScore } from '../../../../base/common/filters.js' ;
16
16
import { KeyCode , KeyMod } from '../../../../base/common/keyCodes.js' ;
17
17
import { localize } from '../../../../nls.js' ;
18
- import { getContextMenuActions , /*getFlatContextMenuActions*/ } from '../../../../platform/actions/browser/menuEntryActionViewItem.js' ;
19
- import { Action2 , /*IMenu, */ IMenuService , MenuId , registerAction2 } from '../../../../platform/actions/common/actions.js' ;
18
+ import { getContextMenuActions , } from '../../../../platform/actions/browser/menuEntryActionViewItem.js' ;
19
+ import { Action2 , IMenuService , MenuId , registerAction2 } from '../../../../platform/actions/common/actions.js' ;
20
20
import { IClipboardService } from '../../../../platform/clipboard/common/clipboardService.js' ;
21
21
import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js' ;
22
22
import { ContextKeyExpr , IContextKey , IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js' ;
@@ -32,7 +32,7 @@ import { ViewAction, ViewPane } from '../../../browser/parts/views/viewPane.js';
32
32
import { IViewletViewOptions } from '../../../browser/parts/views/viewsViewlet.js' ;
33
33
import { FocusedViewContext } from '../../../common/contextkeys.js' ;
34
34
import { IViewDescriptorService } from '../../../common/views.js' ;
35
- import { CONTEXT_CAN_VIEW_MEMORY , CONTEXT_EXPRESSION_SELECTED , CONTEXT_VARIABLE_IS_READONLY , CONTEXT_WATCH_EXPRESSIONS_EXIST , CONTEXT_WATCH_EXPRESSIONS_FOCUSED , CONTEXT_WATCH_ITEM_TYPE , IDebugConfiguration , IDebugService , IDebugViewWithVariables , IExpression , CONTEXT_BREAK_WHEN_VALUE_CHANGES_SUPPORTED , CONTEXT_BREAK_WHEN_VALUE_IS_ACCESSED_SUPPORTED , CONTEXT_BREAK_WHEN_VALUE_IS_READ_SUPPORTED , WATCH_VIEW_ID , CONTEXT_DEBUG_TYPE } from '../common/debug.js' ;
35
+ import { CONTEXT_CAN_VIEW_MEMORY , CONTEXT_EXPRESSION_SELECTED , CONTEXT_VARIABLE_IS_READONLY , CONTEXT_WATCH_EXPRESSIONS_EXIST , CONTEXT_WATCH_EXPRESSIONS_FOCUSED , CONTEXT_WATCH_ITEM_TYPE , IDebugConfiguration , IDebugService , IDebugViewWithVariables , IExpression , CONTEXT_BREAK_WHEN_VALUE_CHANGES_SUPPORTED , CONTEXT_BREAK_WHEN_VALUE_IS_ACCESSED_SUPPORTED , CONTEXT_BREAK_WHEN_VALUE_IS_READ_SUPPORTED , CONTEXT_VARIABLE_EVALUATE_NAME_PRESENT , WATCH_VIEW_ID , CONTEXT_DEBUG_TYPE } from '../common/debug.js' ;
36
36
import { Expression , Variable , VisualizedExpression } from '../common/debugModel.js' ;
37
37
import { AbstractExpressionDataSource , AbstractExpressionsRenderer , expressionAndScopeLabelProvider , IExpressionTemplateData , IInputBoxOptions , renderViewTree } from './baseDebugView.js' ;
38
38
import { COPY_WATCH_EXPRESSION_COMMAND_ID , setDataBreakpointInfoResponse } from './debugCommands.js' ;
@@ -50,8 +50,6 @@ export class WatchExpressionsView extends ViewPane implements IDebugViewWithVari
50
50
private needsRefresh = false ;
51
51
private tree ! : WorkbenchAsyncDataTree < IDebugService | IExpression , IExpression , FuzzyScore > ;
52
52
private watchExpressionsExist : IContextKey < boolean > ;
53
- private watchItemType : IContextKey < string | undefined > ;
54
- private variableReadonly : IContextKey < boolean > ;
55
53
private expressionRenderer : DebugExpressionRenderer ;
56
54
57
55
public get treeSelection ( ) {
@@ -79,9 +77,7 @@ export class WatchExpressionsView extends ViewPane implements IDebugViewWithVari
79
77
this . tree . updateChildren ( ) ;
80
78
} , 50 ) ;
81
79
this . watchExpressionsExist = CONTEXT_WATCH_EXPRESSIONS_EXIST . bindTo ( contextKeyService ) ;
82
- this . variableReadonly = CONTEXT_VARIABLE_IS_READONLY . bindTo ( contextKeyService ) ;
83
80
this . watchExpressionsExist . set ( this . debugService . getModel ( ) . getWatchExpressions ( ) . length > 0 ) ;
84
- this . watchItemType = CONTEXT_WATCH_ITEM_TYPE . bindTo ( contextKeyService ) ;
85
81
this . expressionRenderer = instantiationService . createInstance ( DebugExpressionRenderer ) ;
86
82
}
87
83
@@ -225,10 +221,6 @@ export class WatchExpressionsView extends ViewPane implements IDebugViewWithVari
225
221
226
222
const selection = this . tree . getSelection ( ) ;
227
223
228
- this . watchItemType . set ( element instanceof Expression ? 'expression' : element instanceof Variable ? 'variable' : undefined ) ;
229
- const attributes = element instanceof Variable ? element . presentationHint ?. attributes : undefined ;
230
- this . variableReadonly . set ( ! ! attributes && attributes . indexOf ( 'readOnly' ) >= 0 || ! ! element ?. presentationHint ?. lazy ) ;
231
-
232
224
const contextKeyService = element && await getContextForWatchExpressionMenuWithDataAccess ( this . contextKeyService , element ) ;
233
225
const menu = this . menuService . getMenuActions ( MenuId . DebugWatchContext , contextKeyService , { arg : element , shouldForwardArgs : false } ) ;
234
226
const { secondary } = getContextMenuActions ( menu , 'inline' ) ;
@@ -404,8 +396,8 @@ export class WatchExpressionsRenderer extends AbstractExpressionsRenderer {
404
396
function getContextForWatchExpressionMenu ( parentContext : IContextKeyService , expression : IExpression , additionalContext : [ string , unknown ] [ ] = [ ] ) {
405
397
const session = expression . getSession ( ) ;
406
398
return parentContext . createOverlay ( [
407
- //[CONTEXT_DEBUG_PROTOCOL_VARIABLE_MENU_CONTEXT .key, expression.variableMenuContext || '' ],
408
- //[CONTEXT_VARIABLE_EVALUATE_NAME_PRESENT .key, !! expression.evaluateName ],
399
+ [ CONTEXT_VARIABLE_EVALUATE_NAME_PRESENT . key , 'evaluateName' in expression ] ,
400
+ [ CONTEXT_WATCH_ITEM_TYPE . key , expression instanceof Expression ? 'expression' : expression instanceof Variable ? 'variable' : undefined ] ,
409
401
[ CONTEXT_CAN_VIEW_MEMORY . key , ! ! session ?. capabilities . supportsReadMemoryRequest && expression . memoryReference !== undefined ] ,
410
402
[ CONTEXT_VARIABLE_IS_READONLY . key , ! ! expression . presentationHint ?. attributes ?. includes ( 'readOnly' ) || expression . presentationHint ?. lazy ] ,
411
403
[ CONTEXT_DEBUG_TYPE . key , session ?. configuration . type ] ,
@@ -423,7 +415,7 @@ async function getContextForWatchExpressionMenuWithDataAccess(parentContext: ICo
423
415
}
424
416
425
417
const contextKeys : [ string , unknown ] [ ] = [ ] ;
426
- const dataBreakpointInfoResponse = await session . dataBreakpointInfo ( expression . name ) ;
418
+ const dataBreakpointInfoResponse = await session . dataBreakpointInfo ( 'evaluateName' in expression ? expression . evaluateName as string : expression . name ) ;
427
419
const dataBreakpointId = dataBreakpointInfoResponse ?. dataId ;
428
420
const dataBreakpointAccessTypes = dataBreakpointInfoResponse ?. accessTypes ;
429
421
setDataBreakpointInfoResponse ( dataBreakpointInfoResponse ) ;
@@ -469,6 +461,11 @@ class WatchExpressionsAccessibilityProvider implements IListAccessibilityProvide
469
461
class WatchExpressionsDragAndDrop implements ITreeDragAndDrop < IExpression > {
470
462
471
463
constructor ( private debugService : IDebugService ) { }
464
+ onDragStart ?( data : IDragAndDropData , originalEvent : DragEvent ) : void {
465
+ if ( data instanceof ElementsDragAndDropData ) {
466
+ originalEvent . dataTransfer ! . setData ( 'text/plain' , data . elements [ 0 ] . name ) ;
467
+ }
468
+ }
472
469
473
470
onDragOver ( data : IDragAndDropData , targetElement : IExpression | undefined , targetIndex : number | undefined , targetSector : ListViewTargetSector | undefined , originalEvent : DragEvent ) : boolean | ITreeDragOverReaction {
474
471
if ( ! ( data instanceof ElementsDragAndDropData ) ) {
0 commit comments