@codingame/monaco-vscode-debug-service-override 1.83.16 → 1.85.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/package.json +4 -4
  2. package/vscode/src/vs/editor/common/services/languageFeaturesService.js +1 -0
  3. package/vscode/src/vs/workbench/contrib/debug/browser/breakpointEditorContribution.js +2 -2
  4. package/vscode/src/vs/workbench/contrib/debug/browser/breakpointsView.js +154 -11
  5. package/vscode/src/vs/workbench/contrib/debug/browser/callStackView.js +1 -0
  6. package/vscode/src/vs/workbench/contrib/debug/browser/debug.contribution.js +39 -28
  7. package/vscode/src/vs/workbench/contrib/debug/browser/debugAdapterManager.js +1 -1
  8. package/vscode/src/vs/workbench/contrib/debug/browser/debugCommands.js +41 -4
  9. package/vscode/src/vs/workbench/contrib/debug/browser/debugConfigurationManager.js +1 -0
  10. package/vscode/src/vs/workbench/contrib/debug/browser/debugEditorActions.js +13 -15
  11. package/vscode/src/vs/workbench/contrib/debug/browser/debugEditorContribution.js +8 -6
  12. package/vscode/src/vs/workbench/contrib/debug/browser/debugHover.js +1 -1
  13. package/vscode/src/vs/workbench/contrib/debug/browser/debugService.js +5 -0
  14. package/vscode/src/vs/workbench/contrib/debug/browser/debugSession.js +121 -49
  15. package/vscode/src/vs/workbench/contrib/debug/browser/debugTitle.js +1 -1
  16. package/vscode/src/vs/workbench/contrib/debug/browser/debugToolBar.js +51 -24
  17. package/vscode/src/vs/workbench/contrib/debug/browser/debugViewlet.js +87 -5
  18. package/vscode/src/vs/workbench/contrib/debug/browser/disassemblyView.js +4 -1
  19. package/vscode/src/vs/workbench/contrib/debug/browser/exceptionWidget.js +4 -1
  20. package/vscode/src/vs/workbench/contrib/debug/browser/linkDetector.js +2 -1
  21. package/vscode/src/vs/workbench/contrib/debug/browser/media/debugToolBar.css.js +1 -1
  22. package/vscode/src/vs/workbench/contrib/debug/browser/media/debugViewlet.css.js +1 -1
  23. package/vscode/src/vs/workbench/contrib/debug/browser/repl.js +10 -9
  24. package/vscode/src/vs/workbench/contrib/debug/browser/statusbarColorProvider.js +1 -1
  25. package/vscode/src/vs/workbench/contrib/debug/browser/variablesView.js +1 -0
  26. package/vscode/src/vs/workbench/contrib/debug/browser/watchExpressionsView.js +1 -0
  27. package/vscode/src/vs/workbench/contrib/debug/browser/welcomeView.js +2 -2
  28. package/vscode/src/vs/workbench/contrib/debug/common/debugModel.js +17 -4
  29. package/vscode/src/vs/workbench/contrib/debug/common/debugViewModel.js +3 -1
  30. package/vscode/src/vs/workbench/contrib/debug/common/debugger.js +4 -1
@@ -1,14 +1,14 @@
1
1
  import { getDomNodePagePosition } from 'monaco-editor/esm/vs/base/browser/dom.js';
2
2
  import { Action } from 'monaco-editor/esm/vs/base/common/actions.js';
3
3
  import { KeyChord } from 'monaco-editor/esm/vs/base/common/keyCodes.js';
4
- import { EditorAction2, EditorAction, registerEditorAction } from 'monaco-editor/esm/vs/editor/browser/editorExtensions.js';
4
+ import { EditorAction, registerEditorAction } from 'monaco-editor/esm/vs/editor/browser/editorExtensions.js';
5
5
  import { ICodeEditorService } from 'monaco-editor/esm/vs/editor/browser/services/codeEditorService.js';
6
6
  import { Position } from 'monaco-editor/esm/vs/editor/common/core/position.js';
7
7
  import { EditorContextKeys } from 'monaco-editor/esm/vs/editor/common/editorContextKeys.js';
8
8
  import { ILanguageFeaturesService } from 'monaco-editor/esm/vs/editor/common/services/languageFeatures.js';
9
9
  import { MessageController } from 'monaco-editor/esm/vs/editor/contrib/message/browser/messageController.js';
10
10
  import * as nls from 'monaco-editor/esm/vs/nls.js';
11
- import { MenuId, Action2, registerAction2 } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
11
+ import { Action2, MenuId, registerAction2 } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
12
12
  import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
13
13
  import { ContextKeyExpr } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
14
14
  import { IContextMenuService } from 'monaco-editor/esm/vs/platform/contextview/browser/contextView.js';
@@ -201,8 +201,8 @@ class EditBreakpointAction extends EditorAction {
201
201
  editor.getContribution(BREAKPOINT_EDITOR_CONTRIBUTION_ID)?.showBreakpointWidget(closestBreakpoint.lineNumber, closestBreakpoint.column);
202
202
  }
203
203
  }
204
- class OpenDisassemblyViewAction extends EditorAction2 {
205
- static { this.ID = 'editor.debug.action.openDisassemblyView'; }
204
+ class OpenDisassemblyViewAction extends Action2 {
205
+ static { this.ID = 'debug.action.openDisassemblyView'; }
206
206
  constructor() {
207
207
  super({
208
208
  id: OpenDisassemblyViewAction.ID,
@@ -240,11 +240,9 @@ class OpenDisassemblyViewAction extends EditorAction2 {
240
240
  ]
241
241
  });
242
242
  }
243
- runEditorCommand(accessor, editor, ...args) {
244
- if (editor.hasModel()) {
245
- const editorService = accessor.get(IEditorService);
246
- editorService.openEditor(DisassemblyViewInput.instance, { pinned: true, revealIfOpened: true });
247
- }
243
+ run(accessor) {
244
+ const editorService = accessor.get(IEditorService);
245
+ editorService.openEditor(DisassemblyViewInput.instance, { pinned: true, revealIfOpened: true });
248
246
  }
249
247
  }
250
248
  class ToggleDisassemblyViewSourceCodeAction extends Action2 {
@@ -279,7 +277,7 @@ class ToggleDisassemblyViewSourceCodeAction extends Action2 {
279
277
  }
280
278
  class RunToCursorAction extends EditorAction {
281
279
  static { this.ID = 'editor.debug.action.runToCursor'; }
282
- static { this.LABEL = ( nls.localizeWithPath(
280
+ static { this.LABEL = ( nls.localize2WithPath(
283
281
  'vs/workbench/contrib/debug/browser/debugEditorActions',
284
282
  'runToCursor',
285
283
  "Run to Cursor"
@@ -287,7 +285,7 @@ class RunToCursorAction extends EditorAction {
287
285
  constructor() {
288
286
  super({
289
287
  id: RunToCursorAction.ID,
290
- label: RunToCursorAction.LABEL,
288
+ label: RunToCursorAction.LABEL.value,
291
289
  alias: 'Debug: Run to Cursor',
292
290
  precondition: ( ContextKeyExpr.and(CONTEXT_DEBUGGERS_AVAILABLE, ( PanelFocusContext.toNegated()), ( ContextKeyExpr.or(EditorContextKeys.editorTextFocus, CONTEXT_DISASSEMBLY_VIEW_FOCUS)))),
293
291
  contextMenuOpts: {
@@ -316,7 +314,7 @@ class RunToCursorAction extends EditorAction {
316
314
  }
317
315
  class SelectionToReplAction extends EditorAction {
318
316
  static { this.ID = 'editor.debug.action.selectionToRepl'; }
319
- static { this.LABEL = ( nls.localizeWithPath(
317
+ static { this.LABEL = ( nls.localize2WithPath(
320
318
  'vs/workbench/contrib/debug/browser/debugEditorActions',
321
319
  'evaluateInDebugConsole',
322
320
  "Evaluate in Debug Console"
@@ -324,7 +322,7 @@ class SelectionToReplAction extends EditorAction {
324
322
  constructor() {
325
323
  super({
326
324
  id: SelectionToReplAction.ID,
327
- label: SelectionToReplAction.LABEL,
325
+ label: SelectionToReplAction.LABEL.value,
328
326
  alias: 'Debug: Evaluate in Console',
329
327
  precondition: ( ContextKeyExpr.and(CONTEXT_IN_DEBUG_MODE, EditorContextKeys.editorTextFocus)),
330
328
  contextMenuOpts: {
@@ -355,7 +353,7 @@ class SelectionToReplAction extends EditorAction {
355
353
  }
356
354
  class SelectionToWatchExpressionsAction extends EditorAction {
357
355
  static { this.ID = 'editor.debug.action.selectionToWatch'; }
358
- static { this.LABEL = ( nls.localizeWithPath(
356
+ static { this.LABEL = ( nls.localize2WithPath(
359
357
  'vs/workbench/contrib/debug/browser/debugEditorActions',
360
358
  'addToWatch',
361
359
  "Add to Watch"
@@ -363,7 +361,7 @@ class SelectionToWatchExpressionsAction extends EditorAction {
363
361
  constructor() {
364
362
  super({
365
363
  id: SelectionToWatchExpressionsAction.ID,
366
- label: SelectionToWatchExpressionsAction.LABEL,
364
+ label: SelectionToWatchExpressionsAction.LABEL.value,
367
365
  alias: 'Debug: Add to Watch',
368
366
  precondition: ( ContextKeyExpr.and(CONTEXT_IN_DEBUG_MODE, EditorContextKeys.editorTextFocus)),
369
367
  contextMenuOpts: {
@@ -1,5 +1,5 @@
1
1
  import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
- import { addDisposableListener } from 'monaco-editor/esm/vs/base/browser/dom.js';
2
+ import { addDisposableListener, isKeyboardEvent } from 'monaco-editor/esm/vs/base/browser/dom.js';
3
3
  import { DomEmitter } from 'monaco-editor/esm/vs/base/browser/event.js';
4
4
  import { StandardKeyboardEvent } from 'monaco-editor/esm/vs/base/browser/keyboardEvent.js';
5
5
  import { flatten, distinct } from 'monaco-editor/esm/vs/base/common/arrays.js';
@@ -153,10 +153,11 @@ function getWordToLineNumbersMap(model) {
153
153
  return result;
154
154
  }
155
155
  for (let lineNumber = 1, len = model.getLineCount(); lineNumber <= len; ++lineNumber) {
156
- const lineContent = model.getLineContent(lineNumber);
157
- if (lineContent.length > MAX_TOKENIZATION_LINE_LEN) {
156
+ const lineLength = model.getLineLength(lineNumber);
157
+ if (lineLength > MAX_TOKENIZATION_LINE_LEN) {
158
158
  continue;
159
159
  }
160
+ const lineContent = model.getLineContent(lineNumber);
160
161
  model.tokenization.forceTokenization(lineNumber);
161
162
  const lineTokens = model.tokenization.getLineTokens(lineNumber);
162
163
  for (let tokenIndex = 0, tokenCount = lineTokens.getCount(); tokenIndex < tokenCount; tokenIndex++) {
@@ -260,10 +261,11 @@ let DebugEditorContribution = class DebugEditorContribution {
260
261
  }
261
262
  applyHoverConfiguration(model, stackFrame) {
262
263
  if (stackFrame && this.uriIdentityService.extUri.isEqual(model.uri, stackFrame.source.uri)) {
264
+ const ownerDocument = this.editor.getContainerDomNode().ownerDocument;
263
265
  if (this.altListener) {
264
266
  this.altListener.dispose();
265
267
  }
266
- this.altListener = addDisposableListener(document, 'keydown', keydownEvent => {
268
+ this.altListener = addDisposableListener(ownerDocument, 'keydown', keydownEvent => {
267
269
  const standardKeyboardEvent = ( new StandardKeyboardEvent(keydownEvent));
268
270
  if (standardKeyboardEvent.keyCode === 6 ) {
269
271
  this.altPressed = true;
@@ -273,10 +275,10 @@ let DebugEditorContribution = class DebugEditorContribution {
273
275
  if (debugHoverWasVisible && this.hoverPosition) {
274
276
  this.showEditorHover(this.hoverPosition, false);
275
277
  }
276
- const onKeyUp = ( new DomEmitter(document, 'keyup'));
278
+ const onKeyUp = ( new DomEmitter(ownerDocument, 'keyup'));
277
279
  const listener = Event.any(this.hostService.onDidChangeFocus, onKeyUp.event)(keyupEvent => {
278
280
  let standardKeyboardEvent = undefined;
279
- if (keyupEvent instanceof KeyboardEvent) {
281
+ if (isKeyboardEvent(keyupEvent)) {
280
282
  standardKeyboardEvent = ( new StandardKeyboardEvent(keyupEvent));
281
283
  }
282
284
  if (!standardKeyboardEvent || standardKeyboardEvent.keyCode === 6 ) {
@@ -253,7 +253,7 @@ let DebugHoverWidget = class DebugHoverWidget {
253
253
  if (!this._isVisible) {
254
254
  return;
255
255
  }
256
- if (dom.isAncestor(document.activeElement, this.domNode)) {
256
+ if (dom.isAncestorOfActiveElement(this.domNode)) {
257
257
  this.editor.focus();
258
258
  }
259
259
  this._isVisible = false;
@@ -929,6 +929,11 @@ let DebugService = class DebugService {
929
929
  await this.sendDataBreakpoints();
930
930
  this.debugStorage.storeBreakpoints(this.model);
931
931
  }
932
+ async updateDataBreakpoint(id, update) {
933
+ this.model.updateDataBreakpoint(id, update);
934
+ this.debugStorage.storeBreakpoints(this.model);
935
+ await this.sendDataBreakpoints();
936
+ }
932
937
  async removeDataBreakpoints(id) {
933
938
  this.model.removeDataBreakpoints(id);
934
939
  this.debugStorage.storeBreakpoints(this.model);
@@ -6,7 +6,7 @@ import { CancellationTokenSource } from 'monaco-editor/esm/vs/base/common/cancel
6
6
  import { canceled } from 'monaco-editor/esm/vs/base/common/errors.js';
7
7
  import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
8
8
  import { normalizeDriveLetter } from 'monaco-editor/esm/vs/base/common/labels.js';
9
- import { DisposableStore, MutableDisposable, dispose } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
9
+ import { DisposableStore, MutableDisposable, dispose, Disposable, DisposableMap } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
10
10
  import { mixin } from 'monaco-editor/esm/vs/base/common/objects.js';
11
11
  import * as platform from 'monaco-editor/esm/vs/base/common/platform.js';
12
12
  import * as resources from 'monaco-editor/esm/vs/base/common/resources.js';
@@ -31,6 +31,8 @@ import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/service
31
31
  import { IHostService } from 'vscode/vscode/vs/workbench/services/host/browser/host';
32
32
  import { ILifecycleService } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
33
33
  import { IPaneCompositePartService } from 'vscode/vscode/vs/workbench/services/panecomposite/browser/panecomposite';
34
+ import { getActiveWindow } from 'monaco-editor/esm/vs/base/browser/dom.js';
35
+ import { mainWindow } from 'monaco-editor/esm/vs/base/browser/window.js';
34
36
 
35
37
  let DebugSession = class DebugSession {
36
38
  constructor(id, _configuration, root, model, options, debugService, telemetryService, hostService, configurationService, paneCompositeService, workspaceContextService, productService, notificationService, lifecycleService, uriIdentityService, instantiationService, customEndpointTelemetryService, workbenchEnvironmentService, logService) {
@@ -795,7 +797,13 @@ let DebugSession = class DebugSession {
795
797
  return;
796
798
  }
797
799
  this.rawListeners.add(this.raw.onDidInitialize(async () => {
798
- aria.status(( localizeWithPath(
800
+ aria.status(this.configuration.noDebug
801
+ ? ( localizeWithPath(
802
+ 'vs/workbench/contrib/debug/browser/debugSession',
803
+ 'debuggingStartedNoDebug',
804
+ "Started running without debugging."
805
+ ))
806
+ : ( localizeWithPath(
799
807
  'vs/workbench/contrib/debug/browser/debugSession',
800
808
  'debuggingStarted',
801
809
  "Debugging started."
@@ -820,20 +828,20 @@ let DebugSession = class DebugSession {
820
828
  await this.fetchThreads();
821
829
  }
822
830
  }));
823
- const statusQueue = ( new Queue());
831
+ const statusQueue = this.rawListeners.add(( new ThreadStatusScheduler()));
824
832
  this.rawListeners.add(this.raw.onDidStop(async (event) => {
825
- statusQueue.queue(async () => {
826
- this.passFocusScheduler.cancel();
827
- this.stoppedDetails.push(event.body);
828
- await this.fetchThreads(event.body);
833
+ this.passFocusScheduler.cancel();
834
+ this.stoppedDetails.push(event.body);
835
+ statusQueue.run(this.fetchThreads(event.body).then(() => event.body.threadId === undefined ? this.threadIds : [event.body.threadId]), async (threadId, token) => {
836
+ const hasLotsOfThreads = event.body.threadId === undefined && this.threadIds.length > 10;
829
837
  const focusedThread = this.debugService.getViewModel().focusedThread;
830
838
  const focusedThreadDoesNotExist = focusedThread !== undefined && focusedThread.session === this && !( this.threads.has(focusedThread.threadId));
831
839
  if (focusedThreadDoesNotExist) {
832
840
  this.debugService.focusStackFrame(undefined, undefined);
833
841
  }
834
- const thread = typeof event.body.threadId === 'number' ? this.getThread(event.body.threadId) : undefined;
842
+ const thread = typeof threadId === 'number' ? this.getThread(threadId) : undefined;
835
843
  if (thread) {
836
- const promises = this.model.refreshTopOfCallstack(thread);
844
+ const promises = this.model.refreshTopOfCallstack(thread, !hasLotsOfThreads);
837
845
  const focus = async () => {
838
846
  if (focusedThreadDoesNotExist || (!event.body.preserveFocusHint && thread.getCallStack().length)) {
839
847
  const focusedStackFrame = this.debugService.getViewModel().focusedStackFrame;
@@ -841,19 +849,28 @@ let DebugSession = class DebugSession {
841
849
  const preserveFocus = !this.configurationService.getValue('debug').focusEditorOnBreak;
842
850
  await this.debugService.focusStackFrame(undefined, thread, undefined, { preserveFocus });
843
851
  }
844
- if (thread.stoppedDetails) {
852
+ if (thread.stoppedDetails && !token.isCancellationRequested) {
845
853
  if (thread.stoppedDetails.reason === 'breakpoint' && this.configurationService.getValue('debug').openDebug === 'openOnDebugBreak' && !this.suppressDebugView) {
846
854
  await this.paneCompositeService.openPaneComposite(VIEWLET_ID, 0 );
847
855
  }
848
856
  if (this.configurationService.getValue('debug').focusWindowOnBreak && !this.workbenchEnvironmentService.extensionTestsLocationURI) {
849
- await this.hostService.focus({ force: true });
857
+ const activeWindow = getActiveWindow();
858
+ if (!activeWindow.document.hasFocus()) {
859
+ await this.hostService.focus(mainWindow, { force: true });
860
+ }
850
861
  }
851
862
  }
852
863
  }
853
864
  };
854
865
  await promises.topCallStack;
866
+ if (token.isCancellationRequested) {
867
+ return;
868
+ }
855
869
  focus();
856
870
  await promises.wholeCallStack;
871
+ if (token.isCancellationRequested) {
872
+ return;
873
+ }
857
874
  const focusedStackFrame = this.debugService.getViewModel().focusedStackFrame;
858
875
  if (!focusedStackFrame || !focusedStackFrame.source || focusedStackFrame.source.presentationHint === 'deemphasize' || focusedStackFrame.presentationHint === 'deemphasize') {
859
876
  focus();
@@ -863,28 +880,27 @@ let DebugSession = class DebugSession {
863
880
  });
864
881
  }));
865
882
  this.rawListeners.add(this.raw.onDidThread(event => {
866
- statusQueue.queue(async () => {
867
- if (event.body.reason === 'started') {
868
- if (!this.fetchThreadsScheduler) {
869
- this.fetchThreadsScheduler = ( new RunOnceScheduler(() => {
870
- this.fetchThreads();
871
- }, 100));
872
- this.rawListeners.add(this.fetchThreadsScheduler);
873
- }
874
- if (!this.fetchThreadsScheduler.isScheduled()) {
875
- this.fetchThreadsScheduler.schedule();
876
- }
883
+ statusQueue.cancel([event.body.threadId]);
884
+ if (event.body.reason === 'started') {
885
+ if (!this.fetchThreadsScheduler) {
886
+ this.fetchThreadsScheduler = ( new RunOnceScheduler(() => {
887
+ this.fetchThreads();
888
+ }, 100));
889
+ this.rawListeners.add(this.fetchThreadsScheduler);
877
890
  }
878
- else if (event.body.reason === 'exited') {
879
- this.model.clearThreads(this.getId(), true, event.body.threadId);
880
- const viewModel = this.debugService.getViewModel();
881
- const focusedThread = viewModel.focusedThread;
882
- this.passFocusScheduler.cancel();
883
- if (focusedThread && event.body.threadId === focusedThread.threadId) {
884
- this.debugService.focusStackFrame(undefined, undefined, viewModel.focusedSession, { explicit: false });
885
- }
891
+ if (!this.fetchThreadsScheduler.isScheduled()) {
892
+ this.fetchThreadsScheduler.schedule();
886
893
  }
887
- });
894
+ }
895
+ else if (event.body.reason === 'exited') {
896
+ this.model.clearThreads(this.getId(), true, event.body.threadId);
897
+ const viewModel = this.debugService.getViewModel();
898
+ const focusedThread = viewModel.focusedThread;
899
+ this.passFocusScheduler.cancel();
900
+ if (focusedThread && event.body.threadId === focusedThread.threadId) {
901
+ this.debugService.focusStackFrame(undefined, undefined, viewModel.focusedSession, { explicit: false });
902
+ }
903
+ }
888
904
  }));
889
905
  this.rawListeners.add(this.raw.onDidTerminateDebugee(async (event) => {
890
906
  aria.status(( localizeWithPath(
@@ -900,23 +916,23 @@ let DebugSession = class DebugSession {
900
916
  }
901
917
  }));
902
918
  this.rawListeners.add(this.raw.onDidContinued(event => {
903
- statusQueue.queue(async () => {
904
- const threadId = event.body.allThreadsContinued !== false ? undefined : event.body.threadId;
905
- if (typeof threadId === 'number') {
906
- this.stoppedDetails = this.stoppedDetails.filter(sd => sd.threadId !== threadId);
907
- const tokens = this.cancellationMap.get(threadId);
908
- this.cancellationMap.delete(threadId);
909
- tokens?.forEach(t => t.dispose(true));
910
- }
911
- else {
912
- this.stoppedDetails = [];
913
- this.cancelAllRequests();
914
- }
915
- this.lastContinuedThreadId = threadId;
916
- this.passFocusScheduler.schedule();
917
- this.model.clearThreads(this.getId(), false, threadId);
918
- this._onDidChangeState.fire();
919
- });
919
+ const allThreads = event.body.allThreadsContinued !== false;
920
+ statusQueue.cancel(allThreads ? undefined : [event.body.threadId]);
921
+ const threadId = allThreads ? undefined : event.body.threadId;
922
+ if (typeof threadId === 'number') {
923
+ this.stoppedDetails = this.stoppedDetails.filter(sd => sd.threadId !== threadId);
924
+ const tokens = this.cancellationMap.get(threadId);
925
+ this.cancellationMap.delete(threadId);
926
+ tokens?.forEach(t => t.dispose(true));
927
+ }
928
+ else {
929
+ this.stoppedDetails = [];
930
+ this.cancelAllRequests();
931
+ }
932
+ this.lastContinuedThreadId = threadId;
933
+ this.passFocusScheduler.schedule();
934
+ this.model.clearThreads(this.getId(), false, threadId);
935
+ this._onDidChangeState.fire();
920
936
  }));
921
937
  const outputQueue = ( new Queue());
922
938
  this.rawListeners.add(this.raw.onDidOutput(async (event) => {
@@ -1163,5 +1179,61 @@ DebugSession = ( __decorate([
1163
1179
  ( __param(17, IWorkbenchEnvironmentService)),
1164
1180
  ( __param(18, ILogService))
1165
1181
  ], DebugSession));
1182
+ class ThreadStatusScheduler extends Disposable {
1183
+ constructor() {
1184
+ super(...arguments);
1185
+ this.pendingCancellations = [];
1186
+ this.threadOps = this._register(( new DisposableMap()));
1187
+ }
1188
+ async run(threadIdsP, operation) {
1189
+ const cancelledWhileLookingUpThreads = ( new Set());
1190
+ this.pendingCancellations.push(cancelledWhileLookingUpThreads);
1191
+ const threadIds = await threadIdsP;
1192
+ for (let i = 0; i < this.pendingCancellations.length; i++) {
1193
+ const s = this.pendingCancellations[i];
1194
+ if (s === cancelledWhileLookingUpThreads) {
1195
+ this.pendingCancellations.splice(i, 1);
1196
+ break;
1197
+ }
1198
+ else {
1199
+ for (const threadId of threadIds) {
1200
+ s.add(threadId);
1201
+ }
1202
+ }
1203
+ }
1204
+ if (( cancelledWhileLookingUpThreads.has(undefined))) {
1205
+ return;
1206
+ }
1207
+ await Promise.all(( threadIds.map(threadId => {
1208
+ if (( cancelledWhileLookingUpThreads.has(threadId))) {
1209
+ return;
1210
+ }
1211
+ this.threadOps.get(threadId)?.cancel();
1212
+ const cts = ( new CancellationTokenSource());
1213
+ this.threadOps.set(threadId, cts);
1214
+ return operation(threadId, cts.token);
1215
+ })));
1216
+ }
1217
+ cancel(threadIds) {
1218
+ if (!threadIds) {
1219
+ for (const [_, op] of this.threadOps) {
1220
+ op.cancel();
1221
+ }
1222
+ this.threadOps.clearAndDisposeAll();
1223
+ for (const s of this.pendingCancellations) {
1224
+ s.add(undefined);
1225
+ }
1226
+ }
1227
+ else {
1228
+ for (const threadId of threadIds) {
1229
+ this.threadOps.get(threadId)?.cancel();
1230
+ this.threadOps.deleteAndDispose(threadId);
1231
+ for (const s of this.pendingCancellations) {
1232
+ s.add(threadId);
1233
+ }
1234
+ }
1235
+ }
1236
+ }
1237
+ }
1166
1238
 
1167
- export { DebugSession };
1239
+ export { DebugSession, ThreadStatusScheduler };
@@ -2,7 +2,7 @@ import { __decorate, __param } from '../../../../../../../external/tslib/tslib.e
2
2
  import { IDebugService } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
3
3
  import { dispose } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
4
4
  import { IHostService } from 'vscode/vscode/vs/workbench/services/host/browser/host';
5
- import { ITitleService } from 'vscode/vscode/vs/workbench/services/title/common/titleService';
5
+ import { ITitleService } from 'vscode/vscode/vs/workbench/services/title/browser/titleService';
6
6
 
7
7
  let DebugTitleContribution = class DebugTitleContribution {
8
8
  constructor(debugService, hostService, titleService) {
@@ -27,9 +27,10 @@ import { FocusSessionActionViewItem } from './debugActionViewItems.js';
27
27
  import { debugToolBarBackground, debugToolBarBorder } from 'vscode/vscode/vs/workbench/contrib/debug/browser/debugColors';
28
28
  import { CONTINUE_LABEL, CONTINUE_ID, PAUSE_LABEL, PAUSE_ID, DISCONNECT_ID, DISCONNECT_LABEL, STOP_LABEL, STOP_ID, STEP_OVER_LABEL, STEP_OVER_ID, STEP_INTO_LABEL, STEP_INTO_ID, STEP_OUT_LABEL, STEP_OUT_ID, STEP_BACK_ID, REVERSE_CONTINUE_ID, FOCUS_SESSION_LABEL, FOCUS_SESSION_ID, DISCONNECT_AND_SUSPEND_ID, DISCONNECT_AND_SUSPEND_LABEL, RESTART_LABEL, RESTART_SESSION_ID } from './debugCommands.js';
29
29
  import { debugContinue, debugPause, debugDisconnect, debugStop, debugStepOver, debugStepInto, debugStepOut, debugStepBack, debugReverseContinue, debugGripper, debugRestart } from 'vscode/vscode/vs/workbench/contrib/debug/browser/debugIcons';
30
- import { VIEWLET_ID, CONTEXT_DEBUG_STATE, CONTEXT_IN_DEBUG_MODE, CONTEXT_FOCUSED_SESSION_IS_ATTACH, CONTEXT_TERMINATE_DEBUGGEE_SUPPORTED, CONTEXT_STEP_BACK_SUPPORTED, CONTEXT_MULTI_SESSION_DEBUG, CONTEXT_SUSPEND_DEBUGGEE_SUPPORTED, IDebugService } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
30
+ import { VIEWLET_ID, CONTEXT_DEBUG_STATE, CONTEXT_IN_DEBUG_MODE, CONTEXT_FOCUSED_SESSION_IS_NO_DEBUG, CONTEXT_FOCUSED_SESSION_IS_ATTACH, CONTEXT_TERMINATE_DEBUGGEE_SUPPORTED, CONTEXT_STEP_BACK_SUPPORTED, CONTEXT_MULTI_SESSION_DEBUG, CONTEXT_SUSPEND_DEBUGGEE_SUPPORTED, IDebugService } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
31
31
  import { IWorkbenchLayoutService } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService';
32
32
  import { Codicon } from 'monaco-editor/esm/vs/base/common/codicons.js';
33
+ import { mainWindow } from 'monaco-editor/esm/vs/base/browser/window.js';
33
34
 
34
35
  const DEBUG_TOOLBAR_POSITION_KEY = 'debug.actionswidgetposition';
35
36
  const DEBUG_TOOLBAR_Y_KEY = 'debug.actionswidgety';
@@ -48,7 +49,7 @@ let DebugToolBar = class DebugToolBar extends Themable {
48
49
  this.isBuilt = false;
49
50
  this.stopActionViewItemDisposables = this._register(( new DisposableStore()));
50
51
  this.$el = dom.$('div.debug-toolbar');
51
- this.$el.style.top = `${layoutService.offset.top}px`;
52
+ this.$el.style.top = `${layoutService.mainContainerOffset.top}px`;
52
53
  this.dragArea = dom.append(this.$el, dom.$('div.drag-area' + ThemeIcon.asCSSSelector(debugGripper)));
53
54
  const actionBarContainer = dom.append(this.$el, dom.$('div.action-bar-container'));
54
55
  this.debugToolBarMenu = menuService.createMenu(MenuId.DebugToolBar, contextKeyService);
@@ -98,6 +99,10 @@ let DebugToolBar = class DebugToolBar extends Themable {
98
99
  if (e.affectsConfiguration('debug.toolBarLocation')) {
99
100
  this.updateScheduler.schedule();
100
101
  }
102
+ if (e.affectsConfiguration("workbench.editor.showTabs" ) || e.affectsConfiguration("window.commandCenter" )) {
103
+ this._yRange = undefined;
104
+ this.setYCoordinate();
105
+ }
101
106
  }));
102
107
  this._register(this.debugToolBarMenu.onDidChange(() => this.updateScheduler.schedule()));
103
108
  this._register(this.actionBar.actionRunner.onDidRun((e) => {
@@ -106,23 +111,23 @@ let DebugToolBar = class DebugToolBar extends Themable {
106
111
  }
107
112
  this.telemetryService.publicLog2('workbenchActionExecuted', { id: e.action.id, from: 'debugActionsWidget' });
108
113
  }));
109
- this._register(dom.addDisposableListener(window, dom.EventType.RESIZE, () => this.setCoordinates()));
114
+ this._register(dom.addDisposableListener(mainWindow, dom.EventType.RESIZE, () => this.setCoordinates()));
110
115
  this._register(dom.addDisposableGenericMouseUpListener(this.dragArea, (event) => {
111
- const mouseClickEvent = ( new StandardMouseEvent(event));
116
+ const mouseClickEvent = ( new StandardMouseEvent(dom.getWindow(this.dragArea), event));
112
117
  if (mouseClickEvent.detail === 2) {
113
118
  const widgetWidth = this.$el.clientWidth;
114
- this.setCoordinates(0.5 * window.innerWidth - 0.5 * widgetWidth, 0);
119
+ this.setCoordinates(0.5 * mainWindow.innerWidth - 0.5 * widgetWidth, 0);
115
120
  this.storePosition();
116
121
  }
117
122
  }));
118
123
  this._register(dom.addDisposableGenericMouseDownListener(this.dragArea, (event) => {
119
124
  this.dragArea.classList.add('dragged');
120
- const mouseMoveListener = dom.addDisposableGenericMouseMoveListener(window, (e) => {
121
- const mouseMoveEvent = ( new StandardMouseEvent(e));
125
+ const mouseMoveListener = dom.addDisposableGenericMouseMoveListener(mainWindow, (e) => {
126
+ const mouseMoveEvent = ( new StandardMouseEvent(mainWindow, e));
122
127
  mouseMoveEvent.preventDefault();
123
- this.setCoordinates(mouseMoveEvent.posx - 14, mouseMoveEvent.posy - (this.layoutService.offset.top));
128
+ this.setCoordinates(mouseMoveEvent.posx - 14, mouseMoveEvent.posy - 14);
124
129
  });
125
- const mouseUpListener = dom.addDisposableGenericMouseUpListener(window, (e) => {
130
+ const mouseUpListener = dom.addDisposableGenericMouseUpListener(mainWindow, (e) => {
126
131
  this.storePosition();
127
132
  this.dragArea.classList.remove('dragged');
128
133
  mouseMoveListener.dispose();
@@ -135,9 +140,15 @@ let DebugToolBar = class DebugToolBar extends Themable {
135
140
  storePosition() {
136
141
  const left = dom.getComputedStyle(this.$el).left;
137
142
  if (left) {
138
- const position = parseFloat(left) / window.innerWidth;
143
+ const position = parseFloat(left) / mainWindow.innerWidth;
139
144
  this.storageService.store(DEBUG_TOOLBAR_POSITION_KEY, position, 0 , 1 );
140
145
  }
146
+ if (this.yCoordinate) {
147
+ this.storageService.store(DEBUG_TOOLBAR_Y_KEY, this.yCoordinate, 0 , 1 );
148
+ }
149
+ else {
150
+ this.storageService.remove(DEBUG_TOOLBAR_Y_KEY, 0 );
151
+ }
141
152
  }
142
153
  updateStyles() {
143
154
  super.updateStyles();
@@ -156,11 +167,6 @@ let DebugToolBar = class DebugToolBar extends Themable {
156
167
  }
157
168
  }
158
169
  }
159
- setYCoordinate(y = this.yCoordinate) {
160
- const titlebarOffset = this.layoutService.offset.top;
161
- this.$el.style.top = `${titlebarOffset + y}px`;
162
- this.yCoordinate = y;
163
- }
164
170
  setCoordinates(x, y) {
165
171
  if (!this.isVisible) {
166
172
  return;
@@ -168,19 +174,40 @@ let DebugToolBar = class DebugToolBar extends Themable {
168
174
  const widgetWidth = this.$el.clientWidth;
169
175
  if (x === undefined) {
170
176
  const positionPercentage = this.storageService.get(DEBUG_TOOLBAR_POSITION_KEY, 0 );
171
- x = positionPercentage !== undefined ? parseFloat(positionPercentage) * window.innerWidth : (0.5 * window.innerWidth - 0.5 * widgetWidth);
177
+ x = positionPercentage !== undefined ? parseFloat(positionPercentage) * mainWindow.innerWidth : (0.5 * mainWindow.innerWidth - 0.5 * widgetWidth);
172
178
  }
173
- x = Math.max(0, Math.min(x, window.innerWidth - widgetWidth));
179
+ x = Math.max(0, Math.min(x, mainWindow.innerWidth - widgetWidth));
174
180
  this.$el.style.left = `${x}px`;
175
181
  if (y === undefined) {
176
182
  y = this.storageService.getNumber(DEBUG_TOOLBAR_Y_KEY, 0 , 0);
177
183
  }
178
- const titleAreaHeight = 35;
179
- if ((y < titleAreaHeight / 2) || (y > titleAreaHeight + titleAreaHeight / 2)) {
180
- const moveToTop = y < titleAreaHeight;
181
- this.setYCoordinate(moveToTop ? 0 : titleAreaHeight);
182
- this.storageService.store(DEBUG_TOOLBAR_Y_KEY, moveToTop ? 0 : 2 * titleAreaHeight, 0 , 1 );
184
+ this.setYCoordinate(y);
185
+ }
186
+ setYCoordinate(y = this.yCoordinate) {
187
+ const [yMin, yMax] = this.yRange;
188
+ y = Math.max(yMin, Math.min(y, yMax));
189
+ this.$el.style.top = `${y}px`;
190
+ this.yCoordinate = y;
191
+ }
192
+ get yRange() {
193
+ if (!this._yRange) {
194
+ const isTitleBarVisible = this.layoutService.isVisible("workbench.parts.titlebar" , mainWindow);
195
+ const yMin = isTitleBarVisible ? 0 : this.layoutService.mainContainerOffset.top;
196
+ let yMax = 0;
197
+ if (isTitleBarVisible) {
198
+ if (this.configurationService.getValue("window.commandCenter" ) === true) {
199
+ yMax += 35;
200
+ }
201
+ else {
202
+ yMax += 28;
203
+ }
204
+ }
205
+ if (this.configurationService.getValue("workbench.editor.showTabs" ) !== "none" ) {
206
+ yMax += 35;
207
+ }
208
+ this._yRange = [yMin, yMax];
183
209
  }
210
+ return this._yRange;
184
211
  }
185
212
  show() {
186
213
  if (this.isVisible) {
@@ -189,7 +216,7 @@ let DebugToolBar = class DebugToolBar extends Themable {
189
216
  }
190
217
  if (!this.isBuilt) {
191
218
  this.isBuilt = true;
192
- this.layoutService.container.appendChild(this.$el);
219
+ this.layoutService.mainContainer.appendChild(this.$el);
193
220
  }
194
221
  this.isVisible = true;
195
222
  dom.show(this.$el);
@@ -282,7 +309,7 @@ MenuRegistry.appendMenuItem(MenuId.CommandCenterCenter, {
282
309
  when: ( ContextKeyExpr.and(CONTEXT_IN_DEBUG_MODE, CONTEXT_TOOLBAR_COMMAND_CENTER))
283
310
  });
284
311
  registerDebugToolBarItem(CONTINUE_ID, CONTINUE_LABEL, 10, debugContinue, ( CONTEXT_DEBUG_STATE.isEqualTo('stopped')));
285
- registerDebugToolBarItem(PAUSE_ID, PAUSE_LABEL, 10, debugPause, ( CONTEXT_DEBUG_STATE.notEqualsTo('stopped')), ( CONTEXT_DEBUG_STATE.isEqualTo('running')));
312
+ registerDebugToolBarItem(PAUSE_ID, PAUSE_LABEL, 10, debugPause, ( CONTEXT_DEBUG_STATE.notEqualsTo('stopped')), ( ContextKeyExpr.and(( CONTEXT_DEBUG_STATE.isEqualTo('running')), ( CONTEXT_FOCUSED_SESSION_IS_NO_DEBUG.toNegated()))));
286
313
  registerDebugToolBarItem(STOP_ID, STOP_LABEL, 70, debugStop, ( CONTEXT_FOCUSED_SESSION_IS_ATTACH.toNegated()), undefined, { id: DISCONNECT_ID, title: DISCONNECT_LABEL, icon: debugDisconnect, precondition: ( ContextKeyExpr.and(( CONTEXT_FOCUSED_SESSION_IS_ATTACH.toNegated()), CONTEXT_TERMINATE_DEBUGGEE_SUPPORTED)), });
287
314
  registerDebugToolBarItem(DISCONNECT_ID, DISCONNECT_LABEL, 70, debugDisconnect, CONTEXT_FOCUSED_SESSION_IS_ATTACH, undefined, { id: STOP_ID, title: STOP_LABEL, icon: debugStop, precondition: ( ContextKeyExpr.and(CONTEXT_FOCUSED_SESSION_IS_ATTACH, CONTEXT_TERMINATE_DEBUGGEE_SUPPORTED)), });
288
315
  registerDebugToolBarItem(STEP_OVER_ID, STEP_OVER_LABEL, 20, debugStepOver, undefined, ( CONTEXT_DEBUG_STATE.isEqualTo('stopped')));