@theia/debug 1.53.0-next.5 → 1.53.0-next.55

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 (88) hide show
  1. package/README.md +62 -62
  2. package/lib/browser/debug-configuration-manager.js +6 -6
  3. package/lib/browser/debug-frontend-application-contribution.d.ts.map +1 -1
  4. package/lib/browser/debug-frontend-application-contribution.js.map +1 -1
  5. package/lib/common/inline-debug-adapter.d.ts +1 -0
  6. package/lib/common/inline-debug-adapter.d.ts.map +1 -1
  7. package/package.json +16 -16
  8. package/src/browser/breakpoint/breakpoint-manager.ts +369 -369
  9. package/src/browser/breakpoint/breakpoint-marker.ts +104 -104
  10. package/src/browser/console/debug-console-contribution.tsx +240 -240
  11. package/src/browser/console/debug-console-items.tsx +384 -384
  12. package/src/browser/console/debug-console-session.ts +205 -205
  13. package/src/browser/debug-call-stack-item-type-key.ts +20 -20
  14. package/src/browser/debug-configuration-manager.ts +591 -591
  15. package/src/browser/debug-configuration-model.ts +100 -100
  16. package/src/browser/debug-contribution.ts +43 -43
  17. package/src/browser/debug-frontend-application-contribution.ts +1551 -1551
  18. package/src/browser/debug-frontend-module.ts +133 -133
  19. package/src/browser/debug-package.spec.ts +20 -20
  20. package/src/browser/debug-preferences.ts +98 -98
  21. package/src/browser/debug-prefix-configuration.ts +195 -195
  22. package/src/browser/debug-resource.ts +59 -59
  23. package/src/browser/debug-schema-updater.ts +149 -149
  24. package/src/browser/debug-session-connection.ts +357 -357
  25. package/src/browser/debug-session-contribution.ts +157 -157
  26. package/src/browser/debug-session-manager.ts +683 -683
  27. package/src/browser/debug-session-options.ts +120 -120
  28. package/src/browser/debug-session.tsx +974 -974
  29. package/src/browser/debug-tab-bar-decorator.ts +57 -57
  30. package/src/browser/debug-watch-manager.ts +93 -93
  31. package/src/browser/disassembly-view/disassembly-view-accessibility-provider.ts +43 -43
  32. package/src/browser/disassembly-view/disassembly-view-breakpoint-renderer.ts +119 -119
  33. package/src/browser/disassembly-view/disassembly-view-contribution.ts +109 -109
  34. package/src/browser/disassembly-view/disassembly-view-instruction-renderer.ts +245 -245
  35. package/src/browser/disassembly-view/disassembly-view-table-delegate.ts +39 -39
  36. package/src/browser/disassembly-view/disassembly-view-utilities.ts +55 -55
  37. package/src/browser/disassembly-view/disassembly-view-widget.ts +463 -463
  38. package/src/browser/editor/debug-breakpoint-widget.tsx +293 -293
  39. package/src/browser/editor/debug-editor-model.ts +529 -529
  40. package/src/browser/editor/debug-editor-service.ts +192 -192
  41. package/src/browser/editor/debug-editor.ts +20 -20
  42. package/src/browser/editor/debug-exception-widget.tsx +122 -122
  43. package/src/browser/editor/debug-expression-provider.ts +78 -78
  44. package/src/browser/editor/debug-hover-source.tsx +105 -105
  45. package/src/browser/editor/debug-hover-widget.ts +298 -298
  46. package/src/browser/editor/debug-inline-value-decorator.ts +373 -373
  47. package/src/browser/model/debug-breakpoint.tsx +151 -151
  48. package/src/browser/model/debug-function-breakpoint.tsx +101 -101
  49. package/src/browser/model/debug-instruction-breakpoint.tsx +68 -68
  50. package/src/browser/model/debug-source-breakpoint.tsx +237 -237
  51. package/src/browser/model/debug-source.ts +93 -93
  52. package/src/browser/model/debug-stack-frame.tsx +177 -177
  53. package/src/browser/model/debug-thread.tsx +292 -292
  54. package/src/browser/preferences/launch-preferences.ts +38 -38
  55. package/src/browser/style/index.css +453 -453
  56. package/src/browser/view/debug-action.tsx +57 -57
  57. package/src/browser/view/debug-breakpoints-source.tsx +53 -53
  58. package/src/browser/view/debug-breakpoints-widget.ts +71 -71
  59. package/src/browser/view/debug-configuration-select.tsx +269 -269
  60. package/src/browser/view/debug-configuration-widget.tsx +121 -121
  61. package/src/browser/view/debug-exception-breakpoint.tsx +68 -68
  62. package/src/browser/view/debug-session-widget.ts +124 -124
  63. package/src/browser/view/debug-stack-frames-source.tsx +75 -75
  64. package/src/browser/view/debug-stack-frames-widget.ts +135 -135
  65. package/src/browser/view/debug-threads-source.tsx +48 -48
  66. package/src/browser/view/debug-threads-widget.ts +126 -126
  67. package/src/browser/view/debug-toolbar-widget.tsx +145 -145
  68. package/src/browser/view/debug-variables-source.ts +43 -43
  69. package/src/browser/view/debug-variables-widget.ts +61 -61
  70. package/src/browser/view/debug-view-model.ts +230 -230
  71. package/src/browser/view/debug-watch-expression.tsx +88 -88
  72. package/src/browser/view/debug-watch-source.ts +41 -41
  73. package/src/browser/view/debug-watch-widget.ts +61 -61
  74. package/src/browser/view/debug-widget.ts +97 -97
  75. package/src/common/debug-adapter-contribution-registry.ts +206 -206
  76. package/src/common/debug-adapter-session.ts +102 -102
  77. package/src/common/debug-common.ts +19 -19
  78. package/src/common/debug-compound.ts +33 -33
  79. package/src/common/debug-configuration.ts +112 -112
  80. package/src/common/debug-model.ts +200 -200
  81. package/src/common/debug-service.ts +184 -184
  82. package/src/common/debug-uri-utils.ts +24 -24
  83. package/src/common/inline-debug-adapter.ts +47 -47
  84. package/src/node/debug-adapter-factory.ts +107 -107
  85. package/src/node/debug-adapter-session-manager.ts +106 -106
  86. package/src/node/debug-backend-module.ts +57 -57
  87. package/src/node/debug-service-impl.ts +119 -119
  88. package/src/node/stream-debug-adapter.ts +126 -126
@@ -1,151 +1,151 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2019 TypeFox and others.
3
- //
4
- // This program and the accompanying materials are made available under the
5
- // terms of the Eclipse Public License v. 2.0 which is available at
6
- // http://www.eclipse.org/legal/epl-2.0.
7
- //
8
- // This Source Code may also be made available under the following Secondary
9
- // Licenses when the conditions for such availability set forth in the Eclipse
10
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- // with the GNU Classpath Exception which is available at
12
- // https://www.gnu.org/software/classpath/license.html.
13
- //
14
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import * as React from '@theia/core/shared/react';
18
- import { DebugProtocol } from '@vscode/debugprotocol/lib/debugProtocol';
19
- import URI from '@theia/core/lib/common/uri';
20
- import { EditorManager } from '@theia/editor/lib/browser';
21
- import { LabelProvider, DISABLED_CLASS } from '@theia/core/lib/browser';
22
- import { TreeElement } from '@theia/core/lib/browser/source-tree';
23
- import { DebugSession } from '../debug-session';
24
- import { BaseBreakpoint } from '../breakpoint/breakpoint-marker';
25
- import { BreakpointManager } from '../breakpoint/breakpoint-manager';
26
-
27
- export class DebugBreakpointData {
28
- readonly raw?: DebugProtocol.Breakpoint;
29
- }
30
-
31
- export class DebugBreakpointOptions {
32
- readonly labelProvider: LabelProvider;
33
- readonly breakpoints: BreakpointManager;
34
- readonly editorManager: EditorManager;
35
- readonly session?: DebugSession;
36
- }
37
-
38
- export class DebugBreakpointDecoration {
39
- readonly className: string;
40
- readonly message: string[];
41
- }
42
-
43
- export abstract class DebugBreakpoint<T extends BaseBreakpoint = BaseBreakpoint> extends DebugBreakpointOptions implements TreeElement {
44
-
45
- readonly raw?: DebugProtocol.Breakpoint;
46
-
47
- constructor(
48
- readonly uri: URI,
49
- options: DebugBreakpointOptions
50
- ) {
51
- super();
52
- Object.assign(this, options);
53
- }
54
-
55
- abstract get origin(): T;
56
-
57
- update(data: DebugBreakpointData): void {
58
- Object.assign(this, data);
59
- }
60
-
61
- get idFromAdapter(): number | undefined {
62
- return this.raw && this.raw.id;
63
- }
64
-
65
- get id(): string {
66
- return this.origin.id;
67
- }
68
-
69
- get enabled(): boolean {
70
- return this.breakpoints.breakpointsEnabled && this.origin.enabled;
71
- }
72
-
73
- get installed(): boolean {
74
- return !!this.raw;
75
- }
76
-
77
- get verified(): boolean {
78
- return !!this.raw ? this.raw.verified : true;
79
- }
80
-
81
- get message(): string {
82
- return this.raw && this.raw.message || '';
83
- }
84
-
85
- abstract setEnabled(enabled: boolean): void;
86
-
87
- abstract remove(): void;
88
-
89
- protected readonly setBreakpointEnabled = (event: React.ChangeEvent<HTMLInputElement>) => {
90
- this.setEnabled(event.target.checked);
91
- };
92
-
93
- render(): React.ReactNode {
94
- const classNames = ['theia-source-breakpoint'];
95
- if (!this.isEnabled()) {
96
- classNames.push(DISABLED_CLASS);
97
- }
98
- const decoration = this.getDecoration();
99
- return <div title={decoration.message.join('\n')} className={classNames.join(' ')}>
100
- <span className={'theia-debug-breakpoint-icon codicon ' + decoration.className} />
101
- <input className='theia-input' type='checkbox' checked={this.origin.enabled} onChange={this.setBreakpointEnabled} />
102
- {this.doRender()}
103
- </div>;
104
- }
105
-
106
- protected isEnabled(): boolean {
107
- return this.breakpoints.breakpointsEnabled && this.verified;
108
- }
109
-
110
- protected abstract doRender(): React.ReactNode;
111
-
112
- getDecoration(): DebugBreakpointDecoration {
113
- if (!this.enabled) {
114
- return this.getDisabledBreakpointDecoration();
115
- }
116
- if (this.installed && !this.verified) {
117
- return this.getUnverifiedBreakpointDecoration();
118
- }
119
- return this.doGetDecoration();
120
- }
121
-
122
- protected getUnverifiedBreakpointDecoration(): DebugBreakpointDecoration {
123
- const decoration = this.getBreakpointDecoration();
124
- return {
125
- className: decoration.className + '-unverified',
126
- message: [this.message || 'Unverified ' + decoration.message[0]]
127
- };
128
- }
129
-
130
- protected getDisabledBreakpointDecoration(message?: string): DebugBreakpointDecoration {
131
- const decoration = this.getBreakpointDecoration();
132
- return {
133
- className: decoration.className + '-disabled',
134
- message: [message || ('Disabled ' + decoration.message[0])]
135
- };
136
- }
137
-
138
- protected doGetDecoration(messages: string[] = []): DebugBreakpointDecoration {
139
- if (this.message) {
140
- if (messages.length) {
141
- messages[messages.length - 1].concat(', ' + this.message);
142
- } else {
143
- messages.push(this.message);
144
- }
145
- }
146
- return this.getBreakpointDecoration(messages);
147
- }
148
-
149
- protected abstract getBreakpointDecoration(message?: string[]): DebugBreakpointDecoration;
150
-
151
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2019 TypeFox and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import * as React from '@theia/core/shared/react';
18
+ import { DebugProtocol } from '@vscode/debugprotocol/lib/debugProtocol';
19
+ import URI from '@theia/core/lib/common/uri';
20
+ import { EditorManager } from '@theia/editor/lib/browser';
21
+ import { LabelProvider, DISABLED_CLASS } from '@theia/core/lib/browser';
22
+ import { TreeElement } from '@theia/core/lib/browser/source-tree';
23
+ import { DebugSession } from '../debug-session';
24
+ import { BaseBreakpoint } from '../breakpoint/breakpoint-marker';
25
+ import { BreakpointManager } from '../breakpoint/breakpoint-manager';
26
+
27
+ export class DebugBreakpointData {
28
+ readonly raw?: DebugProtocol.Breakpoint;
29
+ }
30
+
31
+ export class DebugBreakpointOptions {
32
+ readonly labelProvider: LabelProvider;
33
+ readonly breakpoints: BreakpointManager;
34
+ readonly editorManager: EditorManager;
35
+ readonly session?: DebugSession;
36
+ }
37
+
38
+ export class DebugBreakpointDecoration {
39
+ readonly className: string;
40
+ readonly message: string[];
41
+ }
42
+
43
+ export abstract class DebugBreakpoint<T extends BaseBreakpoint = BaseBreakpoint> extends DebugBreakpointOptions implements TreeElement {
44
+
45
+ readonly raw?: DebugProtocol.Breakpoint;
46
+
47
+ constructor(
48
+ readonly uri: URI,
49
+ options: DebugBreakpointOptions
50
+ ) {
51
+ super();
52
+ Object.assign(this, options);
53
+ }
54
+
55
+ abstract get origin(): T;
56
+
57
+ update(data: DebugBreakpointData): void {
58
+ Object.assign(this, data);
59
+ }
60
+
61
+ get idFromAdapter(): number | undefined {
62
+ return this.raw && this.raw.id;
63
+ }
64
+
65
+ get id(): string {
66
+ return this.origin.id;
67
+ }
68
+
69
+ get enabled(): boolean {
70
+ return this.breakpoints.breakpointsEnabled && this.origin.enabled;
71
+ }
72
+
73
+ get installed(): boolean {
74
+ return !!this.raw;
75
+ }
76
+
77
+ get verified(): boolean {
78
+ return !!this.raw ? this.raw.verified : true;
79
+ }
80
+
81
+ get message(): string {
82
+ return this.raw && this.raw.message || '';
83
+ }
84
+
85
+ abstract setEnabled(enabled: boolean): void;
86
+
87
+ abstract remove(): void;
88
+
89
+ protected readonly setBreakpointEnabled = (event: React.ChangeEvent<HTMLInputElement>) => {
90
+ this.setEnabled(event.target.checked);
91
+ };
92
+
93
+ render(): React.ReactNode {
94
+ const classNames = ['theia-source-breakpoint'];
95
+ if (!this.isEnabled()) {
96
+ classNames.push(DISABLED_CLASS);
97
+ }
98
+ const decoration = this.getDecoration();
99
+ return <div title={decoration.message.join('\n')} className={classNames.join(' ')}>
100
+ <span className={'theia-debug-breakpoint-icon codicon ' + decoration.className} />
101
+ <input className='theia-input' type='checkbox' checked={this.origin.enabled} onChange={this.setBreakpointEnabled} />
102
+ {this.doRender()}
103
+ </div>;
104
+ }
105
+
106
+ protected isEnabled(): boolean {
107
+ return this.breakpoints.breakpointsEnabled && this.verified;
108
+ }
109
+
110
+ protected abstract doRender(): React.ReactNode;
111
+
112
+ getDecoration(): DebugBreakpointDecoration {
113
+ if (!this.enabled) {
114
+ return this.getDisabledBreakpointDecoration();
115
+ }
116
+ if (this.installed && !this.verified) {
117
+ return this.getUnverifiedBreakpointDecoration();
118
+ }
119
+ return this.doGetDecoration();
120
+ }
121
+
122
+ protected getUnverifiedBreakpointDecoration(): DebugBreakpointDecoration {
123
+ const decoration = this.getBreakpointDecoration();
124
+ return {
125
+ className: decoration.className + '-unverified',
126
+ message: [this.message || 'Unverified ' + decoration.message[0]]
127
+ };
128
+ }
129
+
130
+ protected getDisabledBreakpointDecoration(message?: string): DebugBreakpointDecoration {
131
+ const decoration = this.getBreakpointDecoration();
132
+ return {
133
+ className: decoration.className + '-disabled',
134
+ message: [message || ('Disabled ' + decoration.message[0])]
135
+ };
136
+ }
137
+
138
+ protected doGetDecoration(messages: string[] = []): DebugBreakpointDecoration {
139
+ if (this.message) {
140
+ if (messages.length) {
141
+ messages[messages.length - 1].concat(', ' + this.message);
142
+ } else {
143
+ messages.push(this.message);
144
+ }
145
+ }
146
+ return this.getBreakpointDecoration(messages);
147
+ }
148
+
149
+ protected abstract getBreakpointDecoration(message?: string[]): DebugBreakpointDecoration;
150
+
151
+ }
@@ -1,101 +1,101 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2019 TypeFox and others.
3
- //
4
- // This program and the accompanying materials are made available under the
5
- // terms of the Eclipse Public License v. 2.0 which is available at
6
- // http://www.eclipse.org/legal/epl-2.0.
7
- //
8
- // This Source Code may also be made available under the following Secondary
9
- // Licenses when the conditions for such availability set forth in the Eclipse
10
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- // with the GNU Classpath Exception which is available at
12
- // https://www.gnu.org/software/classpath/license.html.
13
- //
14
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import * as React from '@theia/core/shared/react';
18
- import { TreeElement } from '@theia/core/lib/browser/source-tree';
19
- import { FunctionBreakpoint } from '../breakpoint/breakpoint-marker';
20
- import { BreakpointManager } from '../breakpoint/breakpoint-manager';
21
- import { DebugBreakpoint, DebugBreakpointOptions, DebugBreakpointDecoration } from './debug-breakpoint';
22
- import { SingleTextInputDialog } from '@theia/core/lib/browser/dialogs';
23
- import { nls } from '@theia/core';
24
-
25
- export class DebugFunctionBreakpoint extends DebugBreakpoint<FunctionBreakpoint> implements TreeElement {
26
-
27
- constructor(readonly origin: FunctionBreakpoint, options: DebugBreakpointOptions) {
28
- super(BreakpointManager.FUNCTION_URI, options);
29
- }
30
-
31
- setEnabled(enabled: boolean): void {
32
- const breakpoints = this.breakpoints.getFunctionBreakpoints();
33
- const breakpoint = breakpoints.find(b => b.id === this.id);
34
- if (breakpoint && breakpoint.enabled !== enabled) {
35
- breakpoint.enabled = enabled;
36
- this.breakpoints.setFunctionBreakpoints(breakpoints);
37
- }
38
- }
39
-
40
- protected override isEnabled(): boolean {
41
- return super.isEnabled() && this.isSupported();
42
- }
43
-
44
- protected isSupported(): boolean {
45
- const { session } = this;
46
- return !session || !!session.capabilities.supportsFunctionBreakpoints;
47
- }
48
-
49
- remove(): void {
50
- const breakpoints = this.breakpoints.getFunctionBreakpoints();
51
- const newBreakpoints = breakpoints.filter(b => b.id !== this.id);
52
- if (breakpoints.length !== newBreakpoints.length) {
53
- this.breakpoints.setFunctionBreakpoints(newBreakpoints);
54
- }
55
- }
56
-
57
- get name(): string {
58
- return this.origin.raw.name;
59
- }
60
-
61
- protected doRender(): React.ReactNode {
62
- return <span className='line-info'>{this.name}</span>;
63
- }
64
-
65
- protected override doGetDecoration(): DebugBreakpointDecoration {
66
- if (!this.isSupported()) {
67
- return this.getDisabledBreakpointDecoration(nls.localizeByDefault('Function breakpoints are not supported by this debug type'));
68
- }
69
- return super.doGetDecoration();
70
- }
71
-
72
- protected getBreakpointDecoration(message?: string[]): DebugBreakpointDecoration {
73
- return {
74
- className: 'codicon-debug-breakpoint-function',
75
- message: message || [nls.localizeByDefault('Function Breakpoint')]
76
- };
77
- }
78
-
79
- async open(): Promise<void> {
80
- const input = new SingleTextInputDialog({
81
- title: nls.localizeByDefault('Add Function Breakpoint'),
82
- initialValue: this.name
83
- });
84
- const newValue = await input.open();
85
- if (newValue !== undefined && newValue !== this.name) {
86
- const breakpoints = this.breakpoints.getFunctionBreakpoints();
87
- const breakpoint = breakpoints.find(b => b.id === this.id);
88
- if (breakpoint) {
89
- if (breakpoint.raw.name !== newValue) {
90
- breakpoint.raw.name = newValue;
91
- this.breakpoints.setFunctionBreakpoints(breakpoints);
92
- }
93
- } else {
94
- this.origin.raw.name = newValue;
95
- breakpoints.push(this.origin);
96
- this.breakpoints.setFunctionBreakpoints(breakpoints);
97
- }
98
- }
99
- }
100
-
101
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2019 TypeFox and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import * as React from '@theia/core/shared/react';
18
+ import { TreeElement } from '@theia/core/lib/browser/source-tree';
19
+ import { FunctionBreakpoint } from '../breakpoint/breakpoint-marker';
20
+ import { BreakpointManager } from '../breakpoint/breakpoint-manager';
21
+ import { DebugBreakpoint, DebugBreakpointOptions, DebugBreakpointDecoration } from './debug-breakpoint';
22
+ import { SingleTextInputDialog } from '@theia/core/lib/browser/dialogs';
23
+ import { nls } from '@theia/core';
24
+
25
+ export class DebugFunctionBreakpoint extends DebugBreakpoint<FunctionBreakpoint> implements TreeElement {
26
+
27
+ constructor(readonly origin: FunctionBreakpoint, options: DebugBreakpointOptions) {
28
+ super(BreakpointManager.FUNCTION_URI, options);
29
+ }
30
+
31
+ setEnabled(enabled: boolean): void {
32
+ const breakpoints = this.breakpoints.getFunctionBreakpoints();
33
+ const breakpoint = breakpoints.find(b => b.id === this.id);
34
+ if (breakpoint && breakpoint.enabled !== enabled) {
35
+ breakpoint.enabled = enabled;
36
+ this.breakpoints.setFunctionBreakpoints(breakpoints);
37
+ }
38
+ }
39
+
40
+ protected override isEnabled(): boolean {
41
+ return super.isEnabled() && this.isSupported();
42
+ }
43
+
44
+ protected isSupported(): boolean {
45
+ const { session } = this;
46
+ return !session || !!session.capabilities.supportsFunctionBreakpoints;
47
+ }
48
+
49
+ remove(): void {
50
+ const breakpoints = this.breakpoints.getFunctionBreakpoints();
51
+ const newBreakpoints = breakpoints.filter(b => b.id !== this.id);
52
+ if (breakpoints.length !== newBreakpoints.length) {
53
+ this.breakpoints.setFunctionBreakpoints(newBreakpoints);
54
+ }
55
+ }
56
+
57
+ get name(): string {
58
+ return this.origin.raw.name;
59
+ }
60
+
61
+ protected doRender(): React.ReactNode {
62
+ return <span className='line-info'>{this.name}</span>;
63
+ }
64
+
65
+ protected override doGetDecoration(): DebugBreakpointDecoration {
66
+ if (!this.isSupported()) {
67
+ return this.getDisabledBreakpointDecoration(nls.localizeByDefault('Function breakpoints are not supported by this debug type'));
68
+ }
69
+ return super.doGetDecoration();
70
+ }
71
+
72
+ protected getBreakpointDecoration(message?: string[]): DebugBreakpointDecoration {
73
+ return {
74
+ className: 'codicon-debug-breakpoint-function',
75
+ message: message || [nls.localizeByDefault('Function Breakpoint')]
76
+ };
77
+ }
78
+
79
+ async open(): Promise<void> {
80
+ const input = new SingleTextInputDialog({
81
+ title: nls.localizeByDefault('Add Function Breakpoint'),
82
+ initialValue: this.name
83
+ });
84
+ const newValue = await input.open();
85
+ if (newValue !== undefined && newValue !== this.name) {
86
+ const breakpoints = this.breakpoints.getFunctionBreakpoints();
87
+ const breakpoint = breakpoints.find(b => b.id === this.id);
88
+ if (breakpoint) {
89
+ if (breakpoint.raw.name !== newValue) {
90
+ breakpoint.raw.name = newValue;
91
+ this.breakpoints.setFunctionBreakpoints(breakpoints);
92
+ }
93
+ } else {
94
+ this.origin.raw.name = newValue;
95
+ breakpoints.push(this.origin);
96
+ this.breakpoints.setFunctionBreakpoints(breakpoints);
97
+ }
98
+ }
99
+ }
100
+
101
+ }
@@ -1,68 +1,68 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2022 Ericsson and others.
3
- //
4
- // This program and the accompanying materials are made available under the
5
- // terms of the Eclipse Public License v. 2.0 which is available at
6
- // http://www.eclipse.org/legal/epl-2.0.
7
- //
8
- // This Source Code may also be made available under the following Secondary
9
- // Licenses when the conditions for such availability set forth in the Eclipse
10
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- // with the GNU Classpath Exception which is available at
12
- // https://www.gnu.org/software/classpath/license.html.
13
- //
14
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import { nls } from '@theia/core';
18
- import * as React from '@theia/core/shared/react';
19
- import { BreakpointManager } from '../breakpoint/breakpoint-manager';
20
- import { InstructionBreakpoint } from '../breakpoint/breakpoint-marker';
21
- import { DebugBreakpoint, DebugBreakpointDecoration, DebugBreakpointOptions } from './debug-breakpoint';
22
-
23
- export class DebugInstructionBreakpoint extends DebugBreakpoint<InstructionBreakpoint> {
24
- constructor(readonly origin: InstructionBreakpoint, options: DebugBreakpointOptions) {
25
- super(BreakpointManager.INSTRUCTION_URI, options);
26
- }
27
-
28
- setEnabled(enabled: boolean): void {
29
- if (enabled !== this.origin.enabled) {
30
- this.breakpoints.updateInstructionBreakpoint(this.origin.id, { enabled });
31
- }
32
- }
33
-
34
- protected override isEnabled(): boolean {
35
- return super.isEnabled() && this.isSupported();
36
- }
37
-
38
- protected isSupported(): boolean {
39
- return Boolean(this.session?.capabilities.supportsInstructionBreakpoints);
40
- }
41
-
42
- remove(): void {
43
- this.breakpoints.removeInstructionBreakpoint(this.origin.instructionReference);
44
- }
45
-
46
- protected doRender(): React.ReactNode {
47
- return <span className="line-info">{this.origin.instructionReference}</span>;
48
- }
49
-
50
- protected getBreakpointDecoration(message?: string[]): DebugBreakpointDecoration {
51
- if (!this.isSupported()) {
52
- return {
53
- className: 'codicon-debug-breakpoint-unsupported',
54
- message: message ?? [nls.localize('theia/debug/instruction-breakpoint', 'Instruction Breakpoint')],
55
- };
56
- }
57
- if (this.origin.condition || this.origin.hitCondition) {
58
- return {
59
- className: 'codicon-debug-breakpoint-conditional',
60
- message: message || [nls.localizeByDefault('Conditional Breakpoint...')]
61
- };
62
- }
63
- return {
64
- className: 'codicon-debug-breakpoint',
65
- message: message || [nls.localize('theia/debug/instruction-breakpoint', 'Instruction Breakpoint')]
66
- };
67
- }
68
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2022 Ericsson and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { nls } from '@theia/core';
18
+ import * as React from '@theia/core/shared/react';
19
+ import { BreakpointManager } from '../breakpoint/breakpoint-manager';
20
+ import { InstructionBreakpoint } from '../breakpoint/breakpoint-marker';
21
+ import { DebugBreakpoint, DebugBreakpointDecoration, DebugBreakpointOptions } from './debug-breakpoint';
22
+
23
+ export class DebugInstructionBreakpoint extends DebugBreakpoint<InstructionBreakpoint> {
24
+ constructor(readonly origin: InstructionBreakpoint, options: DebugBreakpointOptions) {
25
+ super(BreakpointManager.INSTRUCTION_URI, options);
26
+ }
27
+
28
+ setEnabled(enabled: boolean): void {
29
+ if (enabled !== this.origin.enabled) {
30
+ this.breakpoints.updateInstructionBreakpoint(this.origin.id, { enabled });
31
+ }
32
+ }
33
+
34
+ protected override isEnabled(): boolean {
35
+ return super.isEnabled() && this.isSupported();
36
+ }
37
+
38
+ protected isSupported(): boolean {
39
+ return Boolean(this.session?.capabilities.supportsInstructionBreakpoints);
40
+ }
41
+
42
+ remove(): void {
43
+ this.breakpoints.removeInstructionBreakpoint(this.origin.instructionReference);
44
+ }
45
+
46
+ protected doRender(): React.ReactNode {
47
+ return <span className="line-info">{this.origin.instructionReference}</span>;
48
+ }
49
+
50
+ protected getBreakpointDecoration(message?: string[]): DebugBreakpointDecoration {
51
+ if (!this.isSupported()) {
52
+ return {
53
+ className: 'codicon-debug-breakpoint-unsupported',
54
+ message: message ?? [nls.localize('theia/debug/instruction-breakpoint', 'Instruction Breakpoint')],
55
+ };
56
+ }
57
+ if (this.origin.condition || this.origin.hitCondition) {
58
+ return {
59
+ className: 'codicon-debug-breakpoint-conditional',
60
+ message: message || [nls.localizeByDefault('Conditional Breakpoint...')]
61
+ };
62
+ }
63
+ return {
64
+ className: 'codicon-debug-breakpoint',
65
+ message: message || [nls.localize('theia/debug/instruction-breakpoint', 'Instruction Breakpoint')]
66
+ };
67
+ }
68
+ }