ide на основе vs code · VibeGit
ide на основе vs code Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
krutaya-ide-na-osnove-vs-code / src / vs / workbench / contrib / debug / browser / debugToolBar.ts 493 строк · изменён 14 нояб., 04:52
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
import * as dom from '../../../../base/browser/dom.js' ;
import { StandardMouseEvent } from '../../../../base/browser/mouseEvent.js' ;
import { PixelRatio } from '../../../../base/browser/pixelRatio.js' ;
import { ActionBar, ActionsOrientation, IActionViewItem } from '../../../../base/browser/ui/actionbar/actionbar.js' ;
import { IBaseActionViewItemOptions } from '../../../../base/browser/ui/actionbar/actionViewItems.js' ;
import { CodeWindow, mainWindow } from '../../../../base/browser/window.js' ;
import { Action, IAction, IRunEvent, WorkbenchActionExecutedClassification WorkbenchActionExecutedEvent
arrays
RunOnceScheduler
Codicon
errors
DisposableStore markAsSingleton MutableDisposable
Platform platform
ThemeIcon
ServicesAccessor
localize
ICommandAction ICommandActionTitle
DropdownWithPrimaryActionViewItem IDropdownWithPrimaryActionViewItemOptions
createActionViewItem getFlatActionBarActions
IMenu IMenuService MenuId MenuItemAction MenuRegistry
IConfigurationService
ContextKeyExpr ContextKeyExpression IContextKeyService
IInstantiationService
INotificationService
IStorageService StorageScope StorageTarget
ITelemetryService
widgetBorder
IThemeService Themable
getTitleBarStyle TitlebarStyle
IWorkbenchContribution
EditorTabsMode IWorkbenchLayoutService LayoutSettings Parts
IDebugConfiguration IDebugService State
FocusSessionActionViewItem
debugToolBarBackground debugToolBarBorder
icons
$el HTMLElement
dragArea HTMLElement
actionBar ActionBar
activeActions IAction
updateScheduler RunOnceScheduler
debugToolBarMenu IMenu
isVisible
isBuilt
stopActionViewItemDisposables
auxWindowCoordinates
trackPixelRatioListener
notificationService INotificationService
telemetryService ITelemetryService
debugService IDebugService
layoutService IWorkbenchLayoutService
storageService IStorageService
configurationService IConfigurationService
themeService IThemeService
instantiationService IInstantiationService
menuService IMenuService
contextKeyService IContextKeyService
themeService
$el dom
controlsOnTitlebar configurationService TitlebarStyle
controlsOnLeft controlsOnTitlebar platform Platform Mac
controlsOnRight controlsOnTitlebar platform Platform Windows platform Platform Linux
$el style transform
dragArea dom $el dom ThemeIcon icons debugGripper
actionBarContainer dom $el dom
debugToolBarMenu menuService MenuId DebugToolBar contextKeyService
debugToolBarMenu
activeActions
actionBar actionBarContainer
orientation ActionsOrientation
action IAction options IBaseActionViewItemOptions
action id
instantiationService FocusSessionActionViewItem action
action id action id
stopActionViewItemDisposables
item instantiationService accessor action MenuItemAction stopActionViewItemDisposables accessor hoverDelegate options hoverDelegate
item
item
instantiationService action options
updateScheduler
state debugService state
toolBarLocation configurationService toolBarLocation
state State Inactive
toolBarLocation
debugService s s suppressDebugToolbar
state State Initializing debugService initializingOptions suppressDebugToolbar
actions debugToolBarMenu shouldForwardArgs
arrays actions activeActions first second first id second id first enabled second enabled
actionBar
actionBar actions icon label
activeActions actions
debugService updateScheduler
configurationService e
e
updateScheduler
e LayoutSettings e LayoutSettings
_yRange
debugToolBarMenu updateScheduler
actionBar actionRunner e IRunEvent
e error errors e error
notificationService e error
telemetryService id e action id from
dom dragArea event MouseEvent
mouseClickEvent dom dragArea event
mouseClickEvent detail
yDefault
dom dragArea e MouseEvent
dragArea classList
activeWindow dom layoutService activeContainer
originEvent activeWindow e
originX
originY
mouseMoveListener dom activeWindow e MouseEvent
mouseMoveEvent activeWindow e
mouseMoveEvent
originX mouseMoveEvent posx originEvent posx activeWindow innerWidth
originY mouseMoveEvent posy originEvent posy
mouseUpListener dom activeWindow e MouseEvent
dragArea classList
mouseMoveListener
mouseUpListener
layoutService
layoutService
_yRange
layoutService dom layoutService activeContainer
isBuilt
left width $el
left width dom $el innerWidth
$el style
$el style
activeWindow dom layoutService activeContainer
isMainWindow layoutService activeContainer layoutService mainContainer
x
y
isMainWindow
storageService x StorageScope StorageTarget
storageService y StorageScope StorageTarget
auxWindowCoordinates activeWindow x y
override
$el
$el style backgroundColor debugToolBarBackground
contrastBorderColor widgetBorder
borderColor debugToolBarBorder
contrastBorderColor
$el style border
$el style border borderColor
$el style border
currentWindow dom layoutService activeContainer
isMainWindow currentWindow mainWindow
storedPercentage isMainWindow
storageService StorageScope
auxWindowCoordinates currentWindow x
storedPercentage storedPercentage storedPercentage
currentWindow dom layoutService activeContainer
isMainWindow currentWindow mainWindow
storedY isMainWindow
storageService StorageScope
auxWindowCoordinates currentWindow y
storedY yDefault
x y
isVisible
x
y
yMin yMax yRange
y Math yMin Math y yMax
$el style
$el style
layoutService mainContainerOffset top
_yRange
_yRange
isTitleBarVisible layoutService Parts dom layoutService activeContainer
yMin isTitleBarVisible layoutService mainContainerOffset top
yMax
isTitleBarVisible
configurationService LayoutSettings
yMax
yMax
configurationService LayoutSettings EditorTabsMode
yMax
_yRange yMin yMax
_yRange
isVisible
isBuilt
isBuilt
isVisible
dom $el
layoutService activeContainer $el
trackPixelRatioListener value PixelRatio dom $el
isVisible
dom $el
override
$el
action MenuItemAction disposables DisposableStore accessor ServicesAccessor options IDropdownWithPrimaryActionViewItemOptions IActionViewItem
menuService accessor IMenuService
contextKeyService accessor IContextKeyService
instantiationService accessor IInstantiationService
menu menuService MenuId DebugToolBarStop contextKeyService shouldForwardArgs
secondary menu
secondary length
dropdownAction disposables
item instantiationService DropdownWithPrimaryActionViewItem
action MenuItemAction
dropdownAction
secondary
options
item
debugViewTitleItems
id title ICommandActionTitle order icon light dark ThemeIcon when ContextKeyExpression precondition ContextKeyExpression alt ICommandAction
MenuRegistry MenuId DebugToolBar
group
when
order
command
id
title
icon
precondition
alt
debugViewTitleItems MenuRegistry MenuId ViewContainerTitle
group
when ContextKeyExpr when ContextKeyExpr ContextKeyExpr
order
command
id
title
icon
precondition
MenuRegistry e
e MenuId DebugToolBar
debugViewTitleItems
items MenuRegistry MenuId DebugToolBar
i items
debugViewTitleItems MenuRegistry MenuId ViewContainerTitle
i
when ContextKeyExpr i when ContextKeyExpr ContextKeyExpr
ContextKeyExpr
MenuRegistry MenuId CommandCenterCenter
submenu MenuId DebugToolBar
title
icon Codicon debug
order
when ContextKeyExpr
icons debugContinue
icons debugPause ContextKeyExpr
icons debugStop id title icon icons debugDisconnect precondition ContextKeyExpr
icons debugDisconnect id title icon icons debugStop precondition ContextKeyExpr
icons debugStepOver
icons debugStepInto
icons debugStepOut
icons debugRestart
icons debugStepBack
icons debugReverseContinue
Codicon listTree ContextKeyExpr
MenuRegistry MenuId DebugToolBarStop
group
when ContextKeyExpr
order
command
id
title
icon icons debugDisconnect
MenuRegistry MenuId DebugToolBarStop
group
when ContextKeyExpr
order
command
id
title
icon icons debugStop
MenuRegistry MenuId DebugToolBarStop
group
when ContextKeyExpr
ContextKeyExpr
ContextKeyExpr
order
command
id
title
icon icons debugDisconnect
,
}
from
'../../../../base/common/actions.js'
;
import
*
as
from
'../../../../base/common/arrays.js'
;
import
{
}
from
'../../../../base/common/async.js'
;
import
{
}
from
'../../../../base/common/codicons.js'
;
import
*
as
from
'../../../../base/common/errors.js'
;
import
{
,
,
}
from
'../../../../base/common/lifecycle.js'
;
import
{
,
}
from
'../../../../base/common/platform.js'
;
import
{
}
from
'../../../../base/common/themables.js'
;
import
{
URI
}
from
'../../../../base/common/uri.js'
;
import
{
}
from
'../../../../editor/browser/editorExtensions.js'
;
import
{
}
from
'../../../../nls.js'
;
import
{
,
}
from
'../../../../platform/action/common/action.js'
;
import
{
,
}
from
'../../../../platform/actions/browser/dropdownWithPrimaryActionViewItem.js'
;
import
{
,
}
from
'../../../../platform/actions/browser/menuEntryActionViewItem.js'
;
import
{
,
,
,
,
}
from
'../../../../platform/actions/common/actions.js'
;
import
{
}
from
'../../../../platform/configuration/common/configuration.js'
;
import
{
,
,
}
from
'../../../../platform/contextkey/common/contextkey.js'
;
import
{
}
from
'../../../../platform/instantiation/common/instantiation.js'
;
import
{
}
from
'../../../../platform/notification/common/notification.js'
;
import
{
,
,
}
from
'../../../../platform/storage/common/storage.js'
;
import
{
}
from
'../../../../platform/telemetry/common/telemetry.js'
;
import
{
}
from
'../../../../platform/theme/common/colorRegistry.js'
;
import
{
,
}
from
'../../../../platform/theme/common/themeService.js'
;
import
{
,
}
from
'../../../../platform/window/common/window.js'
;
import
{
}
from
'../../../common/contributions.js'
;
import
{
,
,
,
}
from
'../../../services/layout/browser/layoutService.js'
;
import
{
CONTEXT_DEBUG_STATE
,
CONTEXT_FOCUSED_SESSION_IS_ATTACH
,
CONTEXT_FOCUSED_SESSION_IS_NO_DEBUG
,
CONTEXT_IN_DEBUG_MODE
,
CONTEXT_MULTI_SESSION_DEBUG
,
CONTEXT_STEP_BACK_SUPPORTED
,
CONTEXT_SUSPEND_DEBUGGEE_SUPPORTED
,
CONTEXT_TERMINATE_DEBUGGEE_SUPPORTED
,
,
,
,
VIEWLET_ID
}
from
'../common/debug.js'
;
import
{
}
from
'./debugActionViewItems.js'
;
import
{
,
}
from
'./debugColors.js'
;
import
{
CONTINUE_ID
,
CONTINUE_LABEL
,
DISCONNECT_AND_SUSPEND_ID
,
DISCONNECT_AND_SUSPEND_LABEL
,
DISCONNECT_ID
,
DISCONNECT_LABEL
,
FOCUS_SESSION_ID
,
FOCUS_SESSION_LABEL
,
PAUSE_ID
,
PAUSE_LABEL
,
RESTART_LABEL
,
RESTART_SESSION_ID
,
REVERSE_CONTINUE_ID
,
STEP_BACK_ID
,
STEP_INTO_ID
,
STEP_INTO_LABEL
,
STEP_OUT_ID
,
STEP_OUT_LABEL
,
STEP_OVER_ID
,
STEP_OVER_LABEL
,
STOP_ID
,
STOP_LABEL
}
from
'./debugCommands.js'
;
import
*
as
from
'./debugIcons.js'
;
import
'./media/debugToolBar.css'
;
const
DEBUG_TOOLBAR_POSITION_KEY
=
'debug.actionswidgetposition'
;
const
DEBUG_TOOLBAR_Y_KEY
=
'debug.actionswidgety'
;
export
class
DebugToolBar
extends
Themable
implements
IWorkbenchContribution
{
private
:
;
private
:
;
private
:
;
private
:
[
]
;
private
:
;
private
:
;
private
=
false
;
private
=
false
;
private
readonly
=
this
.
_register
(
new
DisposableStore
(
)
)
;
private
readonly
=
new
WeakMap< CodeWindow, { x: number ; y: number | undefined } >
(
)
;
private
readonly
=
this
.
_register
(
new
MutableDisposable
(
)
)
;
constructor
(
@ INotificationService
private
readonly
:
,
@ ITelemetryService
private
readonly
:
,
@ IDebugService
private
readonly
:
,
@ IWorkbenchLayoutService
private
readonly
:
,
@ IStorageService
private
readonly
:
,
@ IConfigurationService
private
readonly
:
,
@ IThemeService
:
,
@ IInstantiationService
private
readonly
:
,
@ IMenuService
:
,
@ IContextKeyService
:
,
)
{
super
(
)
;
this
.
=
.
$
(
'div.debug-toolbar'
)
;
const
=
getTitleBarStyle
(
this
.
)
===
.
CUSTOM
;
const
=
&&
===
.
;
const
=
&&
(
===
.
||
===
.
)
;
this
.
.
.
=
` translate(
min(
max( ${ controlsOnLeft ? '60px' : '0px' } , calc(-50% + (100vw * var(--x-position)))),
calc(100vw - 100% - ${ controlsOnRight ? '100px' : '0px' } )
),
var(--y-position)
) `
;
this
.
=
.
append
(
this
.
,
.
$
(
'div.drag-area'
+
.
asCSSSelector
(
.
)
)
)
;
const
=
.
append
(
this
.
,
.
$
(
'div.action-bar-container'
)
)
;
this
.
=
.
createMenu
(
.
,
)
;
this
.
_register
(
this
.
)
;
this
.
=
[
]
;
this
.
=
this
.
_register
(
new
ActionBar
(
,
{
:
.
HORIZONTAL
,
actionViewItemProvider
:
(
:
,
:
)
=>
{
if
(
.
===
FOCUS_SESSION_ID
)
{
return
this
.
.
createInstance
(
,
,
undefined
)
;
}
else
if
(
.
===
STOP_ID
||
.
===
DISCONNECT_ID
)
{
this
.
.
clear
(
)
;
const
=
this
.
.
invokeFunction
(
=>
createDisconnectMenuItemAction
(
as
,
this
.
,
,
{
:
.
}
)
)
;
if
(
)
{
return
;
}
}
return
createActionViewItem
(
this
.
,
,
)
;
}
}
)
)
;
this
.
=
this
.
_register
(
new
RunOnceScheduler
(
(
)
=>
{
const
=
this
.
.
;
const
=
this
.
.
getValue < IDebugConfiguration>
(
'debug'
)
.
;
if
(
===
.
||
!==
'floating'
||
this
.
.
getModel
(
)
.
getSessions
(
)
.
every
(
=>
.
)
||
(
===
.
&&
this
.
.
?.
)
)
{
return
this
.
hide
(
)
;
}
const
=
getFlatActionBarActions
(
this
.
.
getActions
(
{
:
true
}
)
)
;
if
(
!
.
equals
(
,
this
.
,
(
,
)
=>
.
===
.
&&
.
===
.
)
)
{
this
.
.
clear
(
)
;
this
.
.
push
(
,
{
:
true
,
:
false
}
)
;
this
.
=
;
}
this
.
show
(
)
;
}
,
20
)
)
;
this
.
updateStyles
(
)
;
this
.
registerListeners
(
)
;
this
.
hide
(
)
;
}
private
registerListeners
(
)
:
void
{
this
.
_register
(
this
.
.
onDidChangeState
(
(
)
=>
this
.
.
schedule
(
)
)
)
;
this
.
_register
(
this
.
.
onDidChangeConfiguration
(
=>
{
if
(
.
affectsConfiguration
(
'debug.toolBarLocation'
)
)
{
this
.
.
schedule
(
)
;
}
if
(
.
affectsConfiguration
(
.
EDITOR_TABS_MODE
)
||
.
affectsConfiguration
(
.
COMMAND_CENTER
)
)
{
this
.
=
undefined
;
this
.
setCoordinates
(
)
;
}
}
)
)
;
this
.
_register
(
this
.
.
onDidChange
(
(
)
=>
this
.
.
schedule
(
)
)
)
;
this
.
_register
(
this
.
.
.
onDidRun
(
(
:
)
=>
{
if
(
.
&&
!
.
isCancellationError
(
.
)
)
{
this
.
.
warn
(
.
)
;
}
this
.
.
publicLog2 < WorkbenchActionExecutedEvent, WorkbenchActionExecutedClassification>
(
'workbenchActionExecuted'
,
{
:
.
.
,
:
'debugActionsWidget'
}
)
;
}
)
)
;
this
.
_register
(
.
addDisposableGenericMouseUpListener
(
this
.
,
(
:
)
=>
{
const
=
new
StandardMouseEvent
(
.
getWindow
(
this
.
)
,
)
;
if
(
.
===
2
)
{
this
.
setCoordinates
(
0.5
,
this
.
)
;
this
.
storePosition
(
)
;
}
}
)
)
;
this
.
_register
(
.
addDisposableGenericMouseDownListener
(
this
.
,
(
:
)
=>
{
this
.
.
.
add
(
'dragged'
)
;
const
=
.
getWindow
(
this
.
.
)
;
const
=
new
StandardMouseEvent
(
,
)
;
const
=
this
.
computeCurrentXPercent
(
)
;
const
=
this
.
getCurrentYPosition
(
)
;
const
=
.
addDisposableGenericMouseMoveListener
(
,
(
:
)
=>
{
const
=
new
StandardMouseEvent
(
,
)
;
.
preventDefault
(
)
;
this
.
setCoordinates
(
+
(
.
-
.
)
/
.
,
+
.
-
.
,
)
;
}
)
;
const
=
.
addDisposableGenericMouseUpListener
(
,
(
:
)
=>
{
this
.
storePosition
(
)
;
this
.
.
.
remove
(
'dragged'
)
;
.
dispose
(
)
;
.
dispose
(
)
;
}
)
;
}
)
)
;
this
.
_register
(
this
.
.
onDidChangePartVisibility
(
(
)
=>
this
.
setCoordinates
(
)
)
)
;
this
.
_register
(
this
.
.
onDidChangeActiveContainer
(
async
(
)
=>
{
this
.
=
undefined
;
await
this
.
.
whenContainerStylesLoaded
(
.
getWindow
(
this
.
.
)
)
;
if
(
this
.
)
{
this
.
doShowInActiveContainer
(
)
;
this
.
setCoordinates
(
)
;
}
}
)
)
;
}
private
computeCurrentXPercent
(
)
:
number
{
const
{
,
}
=
this
.
.
getBoundingClientRect
(
)
;
return
(
+
/
2
)
/
.
getWindow
(
this
.
)
.
;
}
private
getCurrentXPercent
(
)
:
number
{
return
Number
(
this
.
.
.
getPropertyValue
(
'--x-position'
)
)
;
}
private
getCurrentYPosition
(
)
:
number
{
return
parseInt
(
this
.
.
.
getPropertyValue
(
'--y-position'
)
)
;
}
private
storePosition
(
)
:
void
{
const
=
.
getWindow
(
this
.
.
)
;
const
=
this
.
.
===
this
.
.
;
const
=
this
.
getCurrentXPercent
(
)
;
const
=
this
.
getCurrentYPosition
(
)
;
if
(
)
{
this
.
.
store
(
DEBUG_TOOLBAR_POSITION_KEY
,
,
.
PROFILE
,
.
MACHINE
)
;
this
.
.
store
(
DEBUG_TOOLBAR_Y_KEY
,
,
.
PROFILE
,
.
MACHINE
)
;
}
else
{
this
.
.
set
(
,
{
,
}
)
;
}
}
updateStyles
(
)
:
void
{
super
.
updateStyles
(
)
;
if
(
this
.
)
{
this
.
.
.
=
this
.
getColor
(
)
||
''
;
const
=
this
.
getColor
(
)
;
const
=
this
.
getColor
(
)
;
if
(
)
{
this
.
.
.
=
` 1px solid ${ contrastBorderColor} `
;
}
else
{
this
.
.
.
=
?
` solid ${ borderColor} `
:
'none'
;
this
.
.
.
=
'1px 0'
;
}
}
}
private
getStoredXPosition
(
)
{
const
=
.
getWindow
(
this
.
.
)
;
const
=
===
;
const
=
?
Number
(
this
.
.
get
(
DEBUG_TOOLBAR_POSITION_KEY
,
.
PROFILE
)
)
:
this
.
.
get
(
)
?.
;
return
!==
undefined
&&
!
isNaN
(
)
?
:
0.5
;
}
private
getStoredYPosition
(
)
{
const
=
.
getWindow
(
this
.
.
)
;
const
=
===
;
const
=
?
this
.
.
getNumber
(
DEBUG_TOOLBAR_Y_KEY
,
.
PROFILE
)
:
this
.
.
get
(
)
?.
;
return
??
this
.
;
}
private
setCoordinates
(
?
:
number
,
?
:
number
)
:
void
{
if
(
!
this
.
)
{
return
;
}
??=
this
.
getStoredXPosition
(
)
;
??=
this
.
getStoredYPosition
(
)
;
const
[
,
]
=
this
.
;
=
.
max
(
,
.
min
(
,
)
)
;
this
.
.
.
setProperty
(
'--x-position'
,
` ${ x} `
)
;
this
.
.
.
setProperty
(
'--y-position'
,
` ${ y} px `
)
;
}
private
get
yDefault
(
)
{
return
this
.
.
.
;
}
private
:
[
number
,
number
]
|
undefined
;
private
get
yRange
(
)
:
[
number
,
number
]
{
if
(
!
this
.
)
{
const
=
this
.
.
isVisible
(
.
TITLEBAR_PART
,
.
getWindow
(
this
.
.
)
)
;
const
=
?
0
:
this
.
.
.
;
let
=
0
;
if
(
)
{
if
(
this
.
.
getValue
(
.
COMMAND_CENTER
)
===
true
)
{
+=
35
;
}
else
{
+=
28
;
}
}
if
(
this
.
.
getValue
(
.
EDITOR_TABS_MODE
)
!==
.
NONE
)
{
+=
35
;
}
this
.
=
[
,
]
;
}
return
this
.
;
}
private
show
(
)
:
void
{
if
(
this
.
)
{
this
.
setCoordinates
(
)
;
return
;
}
if
(
!
this
.
)
{
this
.
=
true
;
this
.
doShowInActiveContainer
(
)
;
}
this
.
=
true
;
.
show
(
this
.
)
;
this
.
setCoordinates
(
)
;
}
private
doShowInActiveContainer
(
)
:
void
{
this
.
.
.
appendChild
(
this
.
)
;
this
.
.
=
.
getInstance
(
.
getWindow
(
this
.
)
)
.
onDidChange
(
(
)
=>
this
.
setCoordinates
(
)
)
;
}
private
hide
(
)
:
void
{
this
.
=
false
;
.
hide
(
this
.
)
;
}
dispose
(
)
:
void
{
super
.
dispose
(
)
;
this
.
?.
remove
(
)
;
}
}
export
function
createDisconnectMenuItemAction
(
:
,
:
,
:
,
:
)
:
|
undefined
{
const
=
.
get
(
)
;
const
=
.
get
(
)
;
const
=
.
get
(
)
;
const
=
.
getMenuActions
(
.
,
,
{
:
true
}
)
;
const
=
getFlatActionBarActions
(
)
;
if
(
!
.
)
{
return
undefined
;
}
const
=
.
add
(
new
Action
(
'notebook.moreRunActions'
,
localize
(
'notebook.moreRunActionsLabel'
,
"More..."
)
,
'codicon-chevron-down'
,
true
)
)
;
const
=
.
createInstance
(
,
as
,
,
,
'debug-stop-actions'
,
)
;
return
;
}
const
=
new
DisposableStore
(
)
;
const
registerDebugToolBarItem
=
(
:
string
,
:
string
|
,
:
number
,
?
:
{
?
:
URI
;
?
:
URI
}
|
,
?
:
,
?
:
,
?
:
)
=>
{
.
appendMenuItem
(
.
,
{
:
'navigation'
,
,
,
:
{
,
,
,
}
,
}
)
;
.
add
(
.
appendMenuItem
(
.
,
{
:
'navigation'
,
:
.
and
(
,
.
equals
(
'viewContainer'
,
VIEWLET_ID
)
,
CONTEXT_DEBUG_STATE
.
notEqualsTo
(
'inactive'
)
,
.
equals
(
'config.debug.toolBarLocation'
,
'docked'
)
)
,
,
:
{
,
,
,
}
}
)
)
;
}
;
markAsSingleton
(
.
onDidChangeMenu
(
=>
{
if
(
.
has
(
.
)
)
{
.
clear
(
)
;
const
=
.
getMenuItems
(
.
)
;
for
(
const
of
)
{
.
add
(
.
appendMenuItem
(
.
,
{
...
,
:
.
and
(
.
,
.
equals
(
'viewContainer'
,
VIEWLET_ID
)
,
CONTEXT_DEBUG_STATE
.
notEqualsTo
(
'inactive'
)
,
.
equals
(
'config.debug.toolBarLocation'
,
'docked'
)
)
}
)
)
;
}
}
}
)
)
;
const
CONTEXT_TOOLBAR_COMMAND_CENTER
=
.
equals
(
'config.debug.toolBarLocation'
,
'commandCenter'
)
;
.
appendMenuItem
(
.
,
{
:
.
,
:
'Debug'
,
:
.
,
:
1
,
:
.
and
(
CONTEXT_IN_DEBUG_MODE
,
CONTEXT_TOOLBAR_COMMAND_CENTER
)
}
)
;
registerDebugToolBarItem
(
CONTINUE_ID
,
CONTINUE_LABEL
,
10
,
.
,
CONTEXT_DEBUG_STATE
.
isEqualTo
(
'stopped'
)
)
;
registerDebugToolBarItem
(
PAUSE_ID
,
PAUSE_LABEL
,
10
,
.
,
CONTEXT_DEBUG_STATE
.
notEqualsTo
(
'stopped'
)
,
.
and
(
CONTEXT_DEBUG_STATE
.
isEqualTo
(
'running'
)
,
CONTEXT_FOCUSED_SESSION_IS_NO_DEBUG
.
toNegated
(
)
)
)
;
registerDebugToolBarItem
(
STOP_ID
,
STOP_LABEL
,
70
,
.
,
CONTEXT_FOCUSED_SESSION_IS_ATTACH
.
toNegated
(
)
,
undefined
,
{
:
DISCONNECT_ID
,
:
DISCONNECT_LABEL
,
:
.
,
:
.
and
(
CONTEXT_FOCUSED_SESSION_IS_ATTACH
.
toNegated
(
)
,
CONTEXT_TERMINATE_DEBUGGEE_SUPPORTED
)
,
}
)
;
registerDebugToolBarItem
(
DISCONNECT_ID
,
DISCONNECT_LABEL
,
70
,
.
,
CONTEXT_FOCUSED_SESSION_IS_ATTACH
,
undefined
,
{
:
STOP_ID
,
:
STOP_LABEL
,
:
.
,
:
.
and
(
CONTEXT_FOCUSED_SESSION_IS_ATTACH
,
CONTEXT_TERMINATE_DEBUGGEE_SUPPORTED
)
,
}
)
;
registerDebugToolBarItem
(
STEP_OVER_ID
,
STEP_OVER_LABEL
,
20
,
.
,
undefined
,
CONTEXT_DEBUG_STATE
.
isEqualTo
(
'stopped'
)
)
;
registerDebugToolBarItem
(
STEP_INTO_ID
,
STEP_INTO_LABEL
,
30
,
.
,
undefined
,
CONTEXT_DEBUG_STATE
.
isEqualTo
(
'stopped'
)
)
;
registerDebugToolBarItem
(
STEP_OUT_ID
,
STEP_OUT_LABEL
,
40
,
.
,
undefined
,
CONTEXT_DEBUG_STATE
.
isEqualTo
(
'stopped'
)
)
;
registerDebugToolBarItem
(
RESTART_SESSION_ID
,
RESTART_LABEL
,
60
,
.
)
;
registerDebugToolBarItem
(
STEP_BACK_ID
,
localize
(
'stepBackDebug'
,
"Step Back"
)
,
50
,
.
,
CONTEXT_STEP_BACK_SUPPORTED
,
CONTEXT_DEBUG_STATE
.
isEqualTo
(
'stopped'
)
)
;
registerDebugToolBarItem
(
REVERSE_CONTINUE_ID
,
localize
(
'reverseContinue'
,
"Reverse"
)
,
55
,
.
,
CONTEXT_STEP_BACK_SUPPORTED
,
CONTEXT_DEBUG_STATE
.
isEqualTo
(
'stopped'
)
)
;
registerDebugToolBarItem
(
FOCUS_SESSION_ID
,
FOCUS_SESSION_LABEL
,
100
,
.
,
.
and
(
CONTEXT_MULTI_SESSION_DEBUG
,
CONTEXT_TOOLBAR_COMMAND_CENTER
.
negate
(
)
)
)
;
.
appendMenuItem
(
.
,
{
:
'navigation'
,
:
.
and
(
CONTEXT_FOCUSED_SESSION_IS_ATTACH
.
toNegated
(
)
,
CONTEXT_TERMINATE_DEBUGGEE_SUPPORTED
)
,
:
0
,
:
{
:
DISCONNECT_ID
,
:
DISCONNECT_LABEL
,
:
.
}
}
)
;
.
appendMenuItem
(
.
,
{
:
'navigation'
,
:
.
and
(
CONTEXT_FOCUSED_SESSION_IS_ATTACH
,
CONTEXT_TERMINATE_DEBUGGEE_SUPPORTED
)
,
:
0
,
:
{
:
STOP_ID
,
:
STOP_LABEL
,
:
.
}
}
)
;
.
appendMenuItem
(
.
,
{
:
'navigation'
,
:
.
or
(
.
and
(
CONTEXT_FOCUSED_SESSION_IS_ATTACH
.
toNegated
(
)
,
CONTEXT_SUSPEND_DEBUGGEE_SUPPORTED
,
CONTEXT_TERMINATE_DEBUGGEE_SUPPORTED
)
,
.
and
(
CONTEXT_FOCUSED_SESSION_IS_ATTACH
,
CONTEXT_SUSPEND_DEBUGGEE_SUPPORTED
)
,
)
,
:
0
,
:
{
:
DISCONNECT_AND_SUSPEND_ID
,
:
DISCONNECT_AND_SUSPEND_LABEL
,
:
.
}
}
)
;