@codingame/monaco-vscode-debug-service-override 1.85.0 → 1.85.2

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 (38) hide show
  1. package/debug.js +4 -1
  2. package/package.json +3 -3
  3. package/vscode/src/vs/platform/debug/common/extensionHostDebugIpc.js +73 -0
  4. package/vscode/src/vs/workbench/contrib/debug/browser/baseDebugView.js +1 -1
  5. package/vscode/src/vs/workbench/contrib/debug/browser/callStackView.js +1 -1
  6. package/vscode/src/vs/workbench/contrib/debug/browser/debug.contribution.js +4 -4
  7. package/vscode/src/vs/workbench/contrib/debug/browser/debugCommands.js +2 -2
  8. package/vscode/src/vs/workbench/contrib/debug/browser/debugConfigurationManager.js +3 -3
  9. package/vscode/src/vs/workbench/contrib/debug/browser/debugEditorActions.js +2 -2
  10. package/vscode/src/vs/workbench/contrib/debug/browser/debugEditorContribution.js +1 -1
  11. package/vscode/src/vs/workbench/contrib/debug/browser/debugHover.js +1 -1
  12. package/vscode/src/vs/workbench/contrib/debug/browser/debugService.js +2 -2
  13. package/vscode/src/vs/workbench/contrib/debug/browser/debugSession.js +2 -2
  14. package/vscode/src/vs/workbench/contrib/debug/browser/disassemblyView.js +3 -3
  15. package/vscode/src/vs/workbench/contrib/debug/browser/extensionHostDebugService.js +141 -0
  16. package/vscode/src/vs/workbench/contrib/debug/browser/rawDebugSession.js +2 -2
  17. package/vscode/src/vs/workbench/contrib/debug/browser/repl.js +1 -1
  18. package/vscode/src/vs/workbench/contrib/debug/browser/replFilter.js +1 -1
  19. package/vscode/src/vs/workbench/contrib/debug/browser/replViewer.js +1 -1
  20. package/vscode/src/vs/workbench/contrib/debug/browser/variablesView.js +1 -1
  21. package/vscode/src/vs/workbench/contrib/debug/browser/watchExpressionsView.js +1 -1
  22. package/vscode/src/vs/workbench/contrib/debug/common/debugContentProvider.js +1 -1
  23. package/vscode/src/vs/workbench/contrib/debug/common/debugSchemas.js +1 -1
  24. package/vscode/src/vs/workbench/contrib/debug/common/debugStorage.js +1 -1
  25. package/vscode/src/vs/workbench/contrib/debug/common/debugger.js +1 -1
  26. package/vscode/src/vs/workbench/contrib/debug/common/replModel.js +1 -1
  27. package/vscode/src/vs/workbench/services/configurationResolver/browser/baseConfigurationResolverService.js +9 -9
  28. package/vscode/src/vs/workbench/contrib/debug/browser/breakpointEditorContribution.js +0 -857
  29. package/vscode/src/vs/workbench/contrib/debug/browser/breakpointWidget.js +0 -412
  30. package/vscode/src/vs/workbench/contrib/debug/browser/breakpointsView.js +0 -1593
  31. package/vscode/src/vs/workbench/contrib/debug/browser/callStackEditorContribution.js +0 -180
  32. package/vscode/src/vs/workbench/contrib/debug/browser/media/breakpointWidget.css.js +0 -6
  33. package/vscode/src/vs/workbench/contrib/debug/browser/media/callStackEditorContribution.css.js +0 -6
  34. package/vscode/src/vs/workbench/contrib/debug/common/debugModel.js +0 -1487
  35. package/vscode/src/vs/workbench/contrib/debug/common/debugSource.js +0 -127
  36. package/vscode/src/vs/workbench/contrib/debug/common/disassemblyViewInput.js +0 -31
  37. package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolverSchema.js +0 -207
  38. package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolverUtils.js +0 -13
@@ -1,412 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
- import './media/breakpointWidget.css.js';
3
- import * as nls from 'monaco-editor/esm/vs/nls.js';
4
- import { SelectBox } from 'monaco-editor/esm/vs/base/browser/ui/selectBox/selectBox.js';
5
- import * as lifecycle from 'monaco-editor/esm/vs/base/common/lifecycle.js';
6
- import * as dom from 'monaco-editor/esm/vs/base/browser/dom.js';
7
- import { Position } from 'monaco-editor/esm/vs/editor/common/core/position.js';
8
- import { ZoneWidget } from 'monaco-editor/esm/vs/editor/contrib/zoneWidget/browser/zoneWidget.js';
9
- import { IContextViewService } from 'monaco-editor/esm/vs/platform/contextview/browser/contextView.js';
10
- import { CONTEXT_BREAKPOINT_WIDGET_VISIBLE, CONTEXT_IN_BREAKPOINT_WIDGET, BREAKPOINT_EDITOR_CONTRIBUTION_ID, DEBUG_SCHEME, IDebugService } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
11
- import { IThemeService } from 'monaco-editor/esm/vs/platform/theme/common/themeService.js';
12
- import { createDecorator, IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
13
- import { IContextKeyService } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
14
- import { EditorCommand, registerEditorCommand } from 'monaco-editor/esm/vs/editor/browser/editorExtensions.js';
15
- import { EditorContextKeys } from 'monaco-editor/esm/vs/editor/common/editorContextKeys.js';
16
- import { IModelService } from 'monaco-editor/esm/vs/editor/common/services/model.js';
17
- import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
18
- import { provideSuggestionItems, CompletionOptions } from 'monaco-editor/esm/vs/editor/contrib/suggest/browser/suggest.js';
19
- import { ICodeEditorService } from 'monaco-editor/esm/vs/editor/browser/services/codeEditorService.js';
20
- import { editorForeground } from 'monaco-editor/esm/vs/platform/theme/common/colorRegistry.js';
21
- import { ServiceCollection } from 'monaco-editor/esm/vs/platform/instantiation/common/serviceCollection.js';
22
- import { CodeEditorWidget } from 'monaco-editor/esm/vs/editor/browser/widget/codeEditorWidget.js';
23
- import { getSimpleCodeEditorWidgetOptions, getSimpleEditorOptions } from 'vscode/vscode/vs/workbench/contrib/codeEditor/browser/simpleEditorOptions';
24
- import { Range } from 'monaco-editor/esm/vs/editor/common/core/range.js';
25
- import { onUnexpectedError } from 'monaco-editor/esm/vs/base/common/errors.js';
26
- import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
27
- import { PLAINTEXT_LANGUAGE_ID } from 'monaco-editor/esm/vs/editor/common/languages/modesRegistry.js';
28
- import { ILanguageFeaturesService } from 'monaco-editor/esm/vs/editor/common/services/languageFeatures.js';
29
- import { defaultSelectBoxStyles } from 'monaco-editor/esm/vs/platform/theme/browser/defaultStyles.js';
30
- import { IKeybindingService } from 'monaco-editor/esm/vs/platform/keybinding/common/keybinding.js';
31
-
32
- const $ = dom.$;
33
- const IPrivateBreakpointWidgetService = ( (createDecorator('privateBreakpointWidgetService')));
34
- const DECORATION_KEY = 'breakpointwidgetdecoration';
35
- function isPositionInCurlyBracketBlock(input) {
36
- const model = input.getModel();
37
- const bracketPairs = model.bracketPairs.getBracketPairsInRange(Range.fromPositions(input.getPosition()));
38
- return (
39
- (bracketPairs.some(p => p.openingBracketInfo.bracketText === '{'))
40
- );
41
- }
42
- function createDecorations(theme, placeHolder) {
43
- const transparentForeground = theme.getColor(editorForeground)?.transparent(0.4);
44
- return [{
45
- range: {
46
- startLineNumber: 0,
47
- endLineNumber: 0,
48
- startColumn: 0,
49
- endColumn: 1
50
- },
51
- renderOptions: {
52
- after: {
53
- contentText: placeHolder,
54
- color: transparentForeground ? ( (transparentForeground.toString())) : undefined
55
- }
56
- }
57
- }];
58
- }
59
- let BreakpointWidget = class BreakpointWidget extends ZoneWidget {
60
- constructor(editor, lineNumber, column, context, contextViewService, debugService, themeService, contextKeyService, instantiationService, modelService, codeEditorService, _configurationService, languageFeaturesService, keybindingService) {
61
- super(editor, { showFrame: true, showArrow: false, frameWidth: 1, isAccessible: true });
62
- this.lineNumber = lineNumber;
63
- this.column = column;
64
- this.contextViewService = contextViewService;
65
- this.debugService = debugService;
66
- this.themeService = themeService;
67
- this.contextKeyService = contextKeyService;
68
- this.instantiationService = instantiationService;
69
- this.modelService = modelService;
70
- this.codeEditorService = codeEditorService;
71
- this._configurationService = _configurationService;
72
- this.languageFeaturesService = languageFeaturesService;
73
- this.keybindingService = keybindingService;
74
- this.conditionInput = '';
75
- this.hitCountInput = '';
76
- this.logMessageInput = '';
77
- this.toDispose = [];
78
- const model = this.editor.getModel();
79
- if (model) {
80
- const uri = model.uri;
81
- const breakpoints = this.debugService.getModel().getBreakpoints({ lineNumber: this.lineNumber, column: this.column, uri });
82
- this.breakpoint = breakpoints.length ? breakpoints[0] : undefined;
83
- }
84
- if (context === undefined) {
85
- if (this.breakpoint && !this.breakpoint.condition && !this.breakpoint.hitCondition && this.breakpoint.logMessage) {
86
- this.context = 2 ;
87
- }
88
- else if (this.breakpoint && !this.breakpoint.condition && this.breakpoint.hitCondition) {
89
- this.context = 1 ;
90
- }
91
- else {
92
- this.context = 0 ;
93
- }
94
- }
95
- else {
96
- this.context = context;
97
- }
98
- this.toDispose.push(this.debugService.getModel().onDidChangeBreakpoints(e => {
99
- if (this.breakpoint && e && e.removed && e.removed.indexOf(this.breakpoint) >= 0) {
100
- this.dispose();
101
- }
102
- }));
103
- this.codeEditorService.registerDecorationType('breakpoint-widget', DECORATION_KEY, {});
104
- this.create();
105
- }
106
- get placeholder() {
107
- const acceptString = this.keybindingService.lookupKeybinding(AcceptBreakpointWidgetInputAction.ID)?.getLabel() || 'Enter';
108
- const closeString = this.keybindingService.lookupKeybinding(CloseBreakpointWidgetCommand.ID)?.getLabel() || 'Escape';
109
- switch (this.context) {
110
- case 2 :
111
- return (
112
- (nls.localizeWithPath(
113
- 'vs/workbench/contrib/debug/browser/breakpointWidget',
114
- 'breakpointWidgetLogMessagePlaceholder',
115
- "Message to log when breakpoint is hit. Expressions within {} are interpolated. '{0}' to accept, '{1}' to cancel.",
116
- acceptString,
117
- closeString
118
- ))
119
- );
120
- case 1 :
121
- return (
122
- (nls.localizeWithPath(
123
- 'vs/workbench/contrib/debug/browser/breakpointWidget',
124
- 'breakpointWidgetHitCountPlaceholder',
125
- "Break when hit count condition is met. '{0}' to accept, '{1}' to cancel.",
126
- acceptString,
127
- closeString
128
- ))
129
- );
130
- default:
131
- return (
132
- (nls.localizeWithPath(
133
- 'vs/workbench/contrib/debug/browser/breakpointWidget',
134
- 'breakpointWidgetExpressionPlaceholder',
135
- "Break when expression evaluates to true. '{0}' to accept, '{1}' to cancel.",
136
- acceptString,
137
- closeString
138
- ))
139
- );
140
- }
141
- }
142
- getInputValue(breakpoint) {
143
- switch (this.context) {
144
- case 2 :
145
- return breakpoint && breakpoint.logMessage ? breakpoint.logMessage : this.logMessageInput;
146
- case 1 :
147
- return breakpoint && breakpoint.hitCondition ? breakpoint.hitCondition : this.hitCountInput;
148
- default:
149
- return breakpoint && breakpoint.condition ? breakpoint.condition : this.conditionInput;
150
- }
151
- }
152
- rememberInput() {
153
- const value = this.input.getModel().getValue();
154
- switch (this.context) {
155
- case 2 :
156
- this.logMessageInput = value;
157
- break;
158
- case 1 :
159
- this.hitCountInput = value;
160
- break;
161
- default:
162
- this.conditionInput = value;
163
- }
164
- }
165
- setInputMode() {
166
- if (this.editor.hasModel()) {
167
- const languageId = this.context === 2 ? PLAINTEXT_LANGUAGE_ID : this.editor.getModel().getLanguageId();
168
- this.input.getModel().setLanguage(languageId);
169
- }
170
- }
171
- show(rangeOrPos) {
172
- const lineNum = this.input.getModel().getLineCount();
173
- super.show(rangeOrPos, lineNum + 1);
174
- }
175
- fitHeightToContent() {
176
- const lineNum = this.input.getModel().getLineCount();
177
- this._relayout(lineNum + 1);
178
- }
179
- _fillContainer(container) {
180
- this.setCssClass('breakpoint-widget');
181
- const selectBox = ( (new SelectBox([{ text: ( (nls.localizeWithPath(
182
- 'vs/workbench/contrib/debug/browser/breakpointWidget',
183
- 'expression',
184
- "Expression"
185
- ))) }, { text: ( (nls.localizeWithPath(
186
- 'vs/workbench/contrib/debug/browser/breakpointWidget',
187
- 'hitCount',
188
- "Hit Count"
189
- ))) }, { text: ( (nls.localizeWithPath(
190
- 'vs/workbench/contrib/debug/browser/breakpointWidget',
191
- 'logMessage',
192
- "Log Message"
193
- ))) }], this.context, this.contextViewService, defaultSelectBoxStyles, { ariaLabel: ( (nls.localizeWithPath(
194
- 'vs/workbench/contrib/debug/browser/breakpointWidget',
195
- 'breakpointType',
196
- 'Breakpoint Type'
197
- ))) })));
198
- this.selectContainer = $('.breakpoint-select-container');
199
- selectBox.render(dom.append(container, this.selectContainer));
200
- selectBox.onDidSelect(e => {
201
- this.rememberInput();
202
- this.context = e.index;
203
- this.setInputMode();
204
- const value = this.getInputValue(this.breakpoint);
205
- this.input.getModel().setValue(value);
206
- this.input.focus();
207
- });
208
- this.inputContainer = $('.inputContainer');
209
- this.createBreakpointInput(dom.append(container, this.inputContainer));
210
- this.input.getModel().setValue(this.getInputValue(this.breakpoint));
211
- this.toDispose.push(this.input.getModel().onDidChangeContent(() => {
212
- this.fitHeightToContent();
213
- }));
214
- this.input.setPosition({ lineNumber: 1, column: this.input.getModel().getLineMaxColumn(1) });
215
- setTimeout(() => this.input.focus(), 150);
216
- }
217
- _doLayout(heightInPixel, widthInPixel) {
218
- this.heightInPx = heightInPixel;
219
- this.input.layout({ height: heightInPixel, width: widthInPixel - 113 });
220
- this.centerInputVertically();
221
- }
222
- _onWidth(widthInPixel) {
223
- if (typeof this.heightInPx === 'number') {
224
- this._doLayout(this.heightInPx, widthInPixel);
225
- }
226
- }
227
- createBreakpointInput(container) {
228
- const scopedContextKeyService = this.contextKeyService.createScoped(container);
229
- this.toDispose.push(scopedContextKeyService);
230
- const scopedInstatiationService = this.instantiationService.createChild(( (new ServiceCollection(
231
- [IContextKeyService, scopedContextKeyService],
232
- [IPrivateBreakpointWidgetService, this]
233
- ))));
234
- const options = this.createEditorOptions();
235
- const codeEditorWidgetOptions = getSimpleCodeEditorWidgetOptions();
236
- this.input = scopedInstatiationService.createInstance(CodeEditorWidget, container, options, codeEditorWidgetOptions);
237
- CONTEXT_IN_BREAKPOINT_WIDGET.bindTo(scopedContextKeyService).set(true);
238
- const model = this.modelService.createModel('', null, ( URI.parse(`${DEBUG_SCHEME}:${this.editor.getId()}:breakpointinput`)), true);
239
- if (this.editor.hasModel()) {
240
- model.setLanguage(this.editor.getModel().getLanguageId());
241
- }
242
- this.input.setModel(model);
243
- this.setInputMode();
244
- this.toDispose.push(model);
245
- const setDecorations = () => {
246
- const value = this.input.getModel().getValue();
247
- const decorations = !!value ? [] : createDecorations(this.themeService.getColorTheme(), this.placeholder);
248
- this.input.setDecorationsByType('breakpoint-widget', DECORATION_KEY, decorations);
249
- };
250
- this.input.getModel().onDidChangeContent(() => setDecorations());
251
- this.themeService.onDidColorThemeChange(() => setDecorations());
252
- this.toDispose.push(this.languageFeaturesService.completionProvider.register({ scheme: DEBUG_SCHEME, hasAccessToAllModels: true }, {
253
- _debugDisplayName: 'breakpointWidget',
254
- provideCompletionItems: (model, position, _context, token) => {
255
- let suggestionsPromise;
256
- const underlyingModel = this.editor.getModel();
257
- if (underlyingModel && (this.context === 0 || (this.context === 2 && isPositionInCurlyBracketBlock(this.input)))) {
258
- suggestionsPromise = provideSuggestionItems(this.languageFeaturesService.completionProvider, underlyingModel, ( (new Position(this.lineNumber, 1))), ( (new CompletionOptions(
259
- undefined,
260
- ( (new Set())).add(27 )
261
- ))), _context, token).then(suggestions => {
262
- let overwriteBefore = 0;
263
- if (this.context === 0 ) {
264
- overwriteBefore = position.column - 1;
265
- }
266
- else {
267
- const value = this.input.getModel().getValue();
268
- while ((position.column - 2 - overwriteBefore >= 0) && value[position.column - 2 - overwriteBefore] !== '{' && value[position.column - 2 - overwriteBefore] !== ' ') {
269
- overwriteBefore++;
270
- }
271
- }
272
- return {
273
- suggestions: ( (suggestions.items.map(s => {
274
- s.completion.range = Range.fromPositions(position.delta(0, -overwriteBefore), position);
275
- return s.completion;
276
- })))
277
- };
278
- });
279
- }
280
- else {
281
- suggestionsPromise = Promise.resolve({ suggestions: [] });
282
- }
283
- return suggestionsPromise;
284
- }
285
- }));
286
- this.toDispose.push(this._configurationService.onDidChangeConfiguration((e) => {
287
- if (e.affectsConfiguration('editor.fontSize') || e.affectsConfiguration('editor.lineHeight')) {
288
- this.input.updateOptions(this.createEditorOptions());
289
- this.centerInputVertically();
290
- }
291
- }));
292
- }
293
- createEditorOptions() {
294
- const editorConfig = this._configurationService.getValue('editor');
295
- const options = getSimpleEditorOptions(this._configurationService);
296
- options.fontSize = editorConfig.fontSize;
297
- options.fontFamily = editorConfig.fontFamily;
298
- options.lineHeight = editorConfig.lineHeight;
299
- options.fontLigatures = editorConfig.fontLigatures;
300
- options.ariaLabel = this.placeholder;
301
- return options;
302
- }
303
- centerInputVertically() {
304
- if (this.container && typeof this.heightInPx === 'number') {
305
- const lineHeight = this.input.getOption(66 );
306
- const lineNum = this.input.getModel().getLineCount();
307
- const newTopMargin = (this.heightInPx - lineNum * lineHeight) / 2;
308
- this.inputContainer.style.marginTop = newTopMargin + 'px';
309
- }
310
- }
311
- close(success) {
312
- if (success) {
313
- let condition = this.breakpoint && this.breakpoint.condition;
314
- let hitCondition = this.breakpoint && this.breakpoint.hitCondition;
315
- let logMessage = this.breakpoint && this.breakpoint.logMessage;
316
- this.rememberInput();
317
- if (this.conditionInput || this.context === 0 ) {
318
- condition = this.conditionInput;
319
- }
320
- if (this.hitCountInput || this.context === 1 ) {
321
- hitCondition = this.hitCountInput;
322
- }
323
- if (this.logMessageInput || this.context === 2 ) {
324
- logMessage = this.logMessageInput;
325
- }
326
- if (this.breakpoint) {
327
- const data = ( (new Map()));
328
- data.set(this.breakpoint.getId(), {
329
- condition,
330
- hitCondition,
331
- logMessage
332
- });
333
- this.debugService.updateBreakpoints(this.breakpoint.originalUri, data, false).then(undefined, onUnexpectedError);
334
- }
335
- else {
336
- const model = this.editor.getModel();
337
- if (model) {
338
- this.debugService.addBreakpoints(model.uri, [{
339
- lineNumber: this.lineNumber,
340
- column: this.column,
341
- enabled: true,
342
- condition,
343
- hitCondition,
344
- logMessage
345
- }]);
346
- }
347
- }
348
- }
349
- this.dispose();
350
- }
351
- dispose() {
352
- super.dispose();
353
- this.input.dispose();
354
- lifecycle.dispose(this.toDispose);
355
- setTimeout(() => this.editor.focus(), 0);
356
- }
357
- };
358
- BreakpointWidget = ( (__decorate([
359
- ( (__param(4, IContextViewService))),
360
- ( (__param(5, IDebugService))),
361
- ( (__param(6, IThemeService))),
362
- ( (__param(7, IContextKeyService))),
363
- ( (__param(8, IInstantiationService))),
364
- ( (__param(9, IModelService))),
365
- ( (__param(10, ICodeEditorService))),
366
- ( (__param(11, IConfigurationService))),
367
- ( (__param(12, ILanguageFeaturesService))),
368
- ( (__param(13, IKeybindingService)))
369
- ], BreakpointWidget)));
370
- class AcceptBreakpointWidgetInputAction extends EditorCommand {
371
- static { this.ID = 'breakpointWidget.action.acceptInput'; }
372
- constructor() {
373
- super({
374
- id: AcceptBreakpointWidgetInputAction.ID,
375
- precondition: CONTEXT_BREAKPOINT_WIDGET_VISIBLE,
376
- kbOpts: {
377
- kbExpr: CONTEXT_IN_BREAKPOINT_WIDGET,
378
- primary: 3 ,
379
- weight: 100
380
- }
381
- });
382
- }
383
- runEditorCommand(accessor, editor) {
384
- accessor.get(IPrivateBreakpointWidgetService).close(true);
385
- }
386
- }
387
- class CloseBreakpointWidgetCommand extends EditorCommand {
388
- static { this.ID = 'closeBreakpointWidget'; }
389
- constructor() {
390
- super({
391
- id: CloseBreakpointWidgetCommand.ID,
392
- precondition: CONTEXT_BREAKPOINT_WIDGET_VISIBLE,
393
- kbOpts: {
394
- kbExpr: EditorContextKeys.textInputFocus,
395
- primary: 9 ,
396
- secondary: [1024 | 9 ],
397
- weight: 100
398
- }
399
- });
400
- }
401
- runEditorCommand(accessor, editor, args) {
402
- const debugContribution = editor.getContribution(BREAKPOINT_EDITOR_CONTRIBUTION_ID);
403
- if (debugContribution) {
404
- return debugContribution.closeBreakpointWidget();
405
- }
406
- accessor.get(IPrivateBreakpointWidgetService).close(false);
407
- }
408
- }
409
- registerEditorCommand(( (new AcceptBreakpointWidgetInputAction())));
410
- registerEditorCommand(( (new CloseBreakpointWidgetCommand())));
411
-
412
- export { BreakpointWidget };