@opensumi/ide-debug 2.21.13 → 2.22.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.
- package/lib/browser/breakpoint/breakpoint-manager.js.map +1 -1
- package/lib/browser/breakpoint/breakpoint-marker.d.ts +1 -1
- package/lib/browser/breakpoint/breakpoint-marker.d.ts.map +1 -1
- package/lib/browser/breakpoint/breakpoint-marker.js +3 -2
- package/lib/browser/breakpoint/breakpoint-marker.js.map +1 -1
- package/lib/browser/contextkeys/debug-call-stack-item-type-key.d.ts +1 -1
- package/lib/browser/contextkeys/debug-call-stack-item-type-key.d.ts.map +1 -1
- package/lib/browser/contextkeys/debug-contextkey.service.js.map +1 -1
- package/lib/browser/debug-configuration-manager.d.ts +2 -2
- package/lib/browser/debug-configuration-manager.d.ts.map +1 -1
- package/lib/browser/debug-configuration-manager.js +2 -2
- package/lib/browser/debug-configuration-manager.js.map +1 -1
- package/lib/browser/debug-contribution.d.ts +2 -147
- package/lib/browser/debug-contribution.d.ts.map +1 -1
- package/lib/browser/debug-contribution.js +50 -200
- package/lib/browser/debug-contribution.js.map +1 -1
- package/lib/browser/debug-exception-widget.js.map +1 -1
- package/lib/browser/debug-link-detector.js.map +1 -1
- package/lib/browser/debug-memory.js +4 -4
- package/lib/browser/debug-memory.js.map +1 -1
- package/lib/browser/debug-preferences.d.ts +1 -1
- package/lib/browser/debug-preferences.d.ts.map +1 -1
- package/lib/browser/debug-progress.service.js.map +1 -1
- package/lib/browser/debug-schema-updater.js.map +1 -1
- package/lib/browser/debug-service.js.map +1 -1
- package/lib/browser/debug-session-connection.d.ts +2 -3
- package/lib/browser/debug-session-connection.d.ts.map +1 -1
- package/lib/browser/debug-session-connection.js.map +1 -1
- package/lib/browser/debug-session-contribution.js.map +1 -1
- package/lib/browser/debug-session-manager.d.ts +3 -4
- package/lib/browser/debug-session-manager.d.ts.map +1 -1
- package/lib/browser/debug-session-manager.js +7 -8
- package/lib/browser/debug-session-manager.js.map +1 -1
- package/lib/browser/debug-session.d.ts +3 -4
- package/lib/browser/debug-session.d.ts.map +1 -1
- package/lib/browser/debug-session.js +15 -11
- package/lib/browser/debug-session.js.map +1 -1
- package/lib/browser/debugUtils.js +4 -4
- package/lib/browser/debugUtils.js.map +1 -1
- package/lib/browser/editor/debug-breakpoint-widget.js.map +1 -1
- package/lib/browser/editor/debug-breakpoint-zone-widget.js +7 -7
- package/lib/browser/editor/debug-breakpoint-zone-widget.js.map +1 -1
- package/lib/browser/editor/debug-breakpoint.module.less +3 -4
- package/lib/browser/editor/debug-editor-contribution.d.ts +2 -2
- package/lib/browser/editor/debug-editor-contribution.d.ts.map +1 -1
- package/lib/browser/editor/debug-editor-contribution.js +3 -4
- package/lib/browser/editor/debug-editor-contribution.js.map +1 -1
- package/lib/browser/editor/debug-expression-provider.js.map +1 -1
- package/lib/browser/editor/debug-hover-model.js.map +1 -1
- package/lib/browser/editor/debug-hover-source.d.ts +1 -1
- package/lib/browser/editor/debug-hover-source.d.ts.map +1 -1
- package/lib/browser/editor/debug-hover-source.js.map +1 -1
- package/lib/browser/editor/debug-hover-tree.model.service.js.map +1 -1
- package/lib/browser/editor/debug-hover-widget.js.map +1 -1
- package/lib/browser/editor/debug-model-manager.d.ts +2 -9
- package/lib/browser/editor/debug-model-manager.d.ts.map +1 -1
- package/lib/browser/editor/debug-model-manager.js +8 -15
- package/lib/browser/editor/debug-model-manager.js.map +1 -1
- package/lib/browser/editor/debug-model.d.ts +2 -2
- package/lib/browser/editor/debug-model.d.ts.map +1 -1
- package/lib/browser/editor/debug-model.js +27 -27
- package/lib/browser/editor/debug-model.js.map +1 -1
- package/lib/browser/editor/debug-run-to-cursor.service.js +7 -7
- package/lib/browser/editor/debug-run-to-cursor.service.js.map +1 -1
- package/lib/browser/editor/evaluatable-expression.js.map +1 -1
- package/lib/browser/index.d.ts +0 -14
- package/lib/browser/index.d.ts.map +1 -1
- package/lib/browser/index.js +8 -24
- package/lib/browser/index.js.map +1 -1
- package/lib/browser/markers/marker-manager.js.map +1 -1
- package/lib/browser/model/debug-source.d.ts +3 -3
- package/lib/browser/model/debug-source.d.ts.map +1 -1
- package/lib/browser/model/debug-source.js.map +1 -1
- package/lib/browser/model/debug-thread.d.ts +1 -1
- package/lib/browser/model/debug-thread.d.ts.map +1 -1
- package/lib/browser/model/debug-watch.d.ts.map +1 -1
- package/lib/browser/model/debug-watch.js +1 -2
- package/lib/browser/model/debug-watch.js.map +1 -1
- package/lib/browser/preferences/launch-folder-preference-provider.d.ts +2 -2
- package/lib/browser/preferences/launch-folder-preference-provider.d.ts.map +1 -1
- package/lib/browser/preferences/launch-folder-preference-provider.js +2 -2
- package/lib/browser/preferences/launch-folder-preference-provider.js.map +1 -1
- package/lib/browser/preferences/launch-preferences-contribution.js.map +1 -1
- package/lib/browser/tree/debug-console-tree-node.define.js +6 -6
- package/lib/browser/tree/debug-console-tree-node.define.js.map +1 -1
- package/lib/browser/tree/debug-tree-node.define.js +18 -18
- package/lib/browser/tree/debug-tree-node.define.js.map +1 -1
- package/lib/browser/view/breakpoints/debug-breakpoints.service.js +3 -3
- package/lib/browser/view/breakpoints/debug-breakpoints.service.js.map +1 -1
- package/lib/browser/view/configuration/debug-configuration.module.less +5 -5
- package/lib/browser/view/configuration/debug-configuration.service.d.ts +1 -2
- package/lib/browser/view/configuration/debug-configuration.service.d.ts.map +1 -1
- package/lib/browser/view/configuration/debug-configuration.service.js.map +1 -1
- package/lib/browser/view/configuration/debug-configuration.view.d.ts.map +1 -1
- package/lib/browser/view/configuration/debug-configuration.view.js +1 -1
- package/lib/browser/view/configuration/debug-configuration.view.js.map +1 -1
- package/lib/browser/view/configuration/debug-toolbar.service.js.map +1 -1
- package/lib/browser/view/configuration/debug-toolbar.view.js +2 -2
- package/lib/browser/view/configuration/debug-toolbar.view.js.map +1 -1
- package/lib/browser/view/console/debug-console-filter.model.js.map +1 -1
- package/lib/browser/view/console/debug-console-filter.service.js.map +1 -1
- package/lib/browser/view/console/debug-console-model.js.map +1 -1
- package/lib/browser/view/console/debug-console-session.d.ts +3 -2
- package/lib/browser/view/console/debug-console-session.d.ts.map +1 -1
- package/lib/browser/view/console/debug-console-session.js.map +1 -1
- package/lib/browser/view/console/debug-console-tree.model.service.d.ts +1 -1
- package/lib/browser/view/console/debug-console-tree.model.service.d.ts.map +1 -1
- package/lib/browser/view/console/debug-console-tree.model.service.js +5 -3
- package/lib/browser/view/console/debug-console-tree.model.service.js.map +1 -1
- package/lib/browser/view/console/debug-console.contribution.d.ts.map +1 -1
- package/lib/browser/view/console/debug-console.contribution.js +21 -23
- package/lib/browser/view/console/debug-console.contribution.js.map +1 -1
- package/lib/browser/view/console/debug-console.module.less +2 -3
- package/lib/browser/view/console/debug-console.service.js +7 -7
- package/lib/browser/view/console/debug-console.service.js.map +1 -1
- package/lib/browser/view/console/debug-console.view.d.ts +1 -1
- package/lib/browser/view/console/debug-console.view.d.ts.map +1 -1
- package/lib/browser/view/console/debug-console.view.js +15 -3
- package/lib/browser/view/console/debug-console.view.js.map +1 -1
- package/lib/browser/view/debug-view-model.js.map +1 -1
- package/lib/browser/view/frames/debug-call-stack-frame.view.d.ts.map +1 -1
- package/lib/browser/view/frames/debug-call-stack-frame.view.js +25 -24
- package/lib/browser/view/frames/debug-call-stack-frame.view.js.map +1 -1
- package/lib/browser/view/frames/debug-call-stack-session.view.d.ts.map +1 -1
- package/lib/browser/view/frames/debug-call-stack-session.view.js +8 -5
- package/lib/browser/view/frames/debug-call-stack-session.view.js.map +1 -1
- package/lib/browser/view/frames/debug-call-stack-thread.view.d.ts.map +1 -1
- package/lib/browser/view/frames/debug-call-stack-thread.view.js +12 -7
- package/lib/browser/view/frames/debug-call-stack-thread.view.js.map +1 -1
- package/lib/browser/view/frames/debug-call-stack.contribution.js +5 -5
- package/lib/browser/view/frames/debug-call-stack.contribution.js.map +1 -1
- package/lib/browser/view/frames/debug-call-stack.service.js.map +1 -1
- package/lib/browser/view/variables/debug-variables-model.js.map +1 -1
- package/lib/browser/view/variables/debug-variables-tree.model.service.d.ts +1 -1
- package/lib/browser/view/variables/debug-variables-tree.model.service.d.ts.map +1 -1
- package/lib/browser/view/variables/debug-variables-tree.model.service.js +5 -3
- package/lib/browser/view/variables/debug-variables-tree.model.service.js.map +1 -1
- package/lib/browser/view/variables/debug-variables.contribution.d.ts.map +1 -1
- package/lib/browser/view/variables/debug-variables.contribution.js +13 -14
- package/lib/browser/view/variables/debug-variables.contribution.js.map +1 -1
- package/lib/browser/view/variables/debug-variables.module.less +2 -11
- package/lib/browser/view/variables/debug-variables.view.d.ts +1 -1
- package/lib/browser/view/variables/debug-variables.view.d.ts.map +1 -1
- package/lib/browser/view/variables/debug-variables.view.js +1 -1
- package/lib/browser/view/variables/debug-variables.view.js.map +1 -1
- package/lib/browser/view/watch/debug-watch-model.js.map +1 -1
- package/lib/browser/view/watch/debug-watch-tree.model.service.d.ts +2 -2
- package/lib/browser/view/watch/debug-watch-tree.model.service.d.ts.map +1 -1
- package/lib/browser/view/watch/debug-watch-tree.model.service.js +5 -3
- package/lib/browser/view/watch/debug-watch-tree.model.service.js.map +1 -1
- package/lib/browser/view/watch/debug-watch.contribution.d.ts.map +1 -1
- package/lib/browser/view/watch/debug-watch.contribution.js +21 -19
- package/lib/browser/view/watch/debug-watch.contribution.js.map +1 -1
- package/lib/browser/view/watch/debug-watch.module.less +2 -12
- package/lib/browser/view/watch/debug-watch.view.d.ts +1 -1
- package/lib/browser/view/watch/debug-watch.view.d.ts.map +1 -1
- package/lib/browser/view/watch/debug-watch.view.js +1 -1
- package/lib/browser/view/watch/debug-watch.view.js.map +1 -1
- package/lib/common/commands.d.ts +46 -0
- package/lib/common/commands.d.ts.map +1 -0
- package/lib/common/commands.js +149 -0
- package/lib/common/commands.js.map +1 -0
- package/lib/common/debug-breakpoint.d.ts +3 -3
- package/lib/common/debug-breakpoint.d.ts.map +1 -1
- package/lib/common/debug-configuration.d.ts +1 -1
- package/lib/common/debug-configuration.d.ts.map +1 -1
- package/lib/common/debug-console.d.ts +18 -0
- package/lib/common/debug-console.d.ts.map +1 -0
- package/lib/common/debug-console.js +5 -0
- package/lib/common/debug-console.js.map +1 -0
- package/lib/common/debug-editor.d.ts +1 -1
- package/lib/common/debug-editor.d.ts.map +1 -1
- package/lib/common/debug-model.d.ts +19 -4
- package/lib/common/debug-model.d.ts.map +1 -1
- package/lib/common/debug-model.js +14 -6
- package/lib/common/debug-model.js.map +1 -1
- package/lib/common/debug-schema-updater.d.ts +2 -1
- package/lib/common/debug-schema-updater.d.ts.map +1 -1
- package/lib/common/debug-schema-updater.js +1 -1
- package/lib/common/debug-schema-updater.js.map +1 -1
- package/lib/common/debug-service.d.ts +1 -1
- package/lib/common/debug-service.d.ts.map +1 -1
- package/lib/common/debug-session.d.ts +1 -1
- package/lib/common/debug-session.d.ts.map +1 -1
- package/lib/common/index.d.ts +2 -0
- package/lib/common/index.d.ts.map +1 -1
- package/lib/common/index.js +2 -0
- package/lib/common/index.js.map +1 -1
- package/lib/common/inline-values.d.ts +1 -1
- package/lib/common/inline-values.d.ts.map +1 -1
- package/lib/common/terminal.js +10 -10
- package/lib/common/terminal.js.map +1 -1
- package/package.json +27 -26
- package/src/browser/assets/breakpoint-conditional-disabled.svg +4 -0
- package/src/browser/assets/breakpoint-conditional-unverified.svg +4 -0
- package/src/browser/assets/breakpoint-conditional.svg +4 -0
- package/src/browser/assets/breakpoint-disabled.svg +4 -0
- package/src/browser/assets/breakpoint-hint.svg +4 -0
- package/src/browser/assets/breakpoint-log-disabled.svg +4 -0
- package/src/browser/assets/breakpoint-log-unverified.svg +4 -0
- package/src/browser/assets/breakpoint-log.svg +4 -0
- package/src/browser/assets/breakpoint-unsupported.svg +4 -0
- package/src/browser/assets/breakpoint-unverified.svg +4 -0
- package/src/browser/assets/breakpoint.svg +4 -0
- package/src/browser/assets/breakpoints-activate-inverse.svg +4 -0
- package/src/browser/assets/breakpoints-activate.svg +4 -0
- package/src/browser/assets/configure-inverse.svg +4 -0
- package/src/browser/assets/configure.svg +4 -0
- package/src/browser/assets/continue-inverse.svg +4 -0
- package/src/browser/assets/current-and-breakpoint.svg +4 -0
- package/src/browser/assets/current-arrow.svg +4 -0
- package/src/browser/assets/remove-all-inverse.svg +4 -0
- package/src/browser/assets/remove-all.svg +4 -0
- package/src/browser/assets/repl-inverse.svg +4 -0
- package/src/browser/assets/repl.svg +4 -0
- package/src/browser/assets/restart-inverse.svg +4 -0
- package/src/browser/assets/stackframe-and-breakpoint.svg +4 -0
- package/src/browser/assets/stackframe-arrow.svg +4 -0
- package/src/browser/assets/start-inverse.svg +4 -0
- package/src/browser/breakpoint/breakpoint-decoration.ts +57 -0
- package/src/browser/breakpoint/breakpoint-manager.ts +348 -0
- package/src/browser/breakpoint/breakpoint-marker.ts +70 -0
- package/src/browser/breakpoint/index.ts +3 -0
- package/src/browser/components/debug-action/index.module.less +73 -0
- package/src/browser/components/debug-action/index.tsx +40 -0
- package/src/browser/components/debug-exception-widget.less +42 -0
- package/src/browser/components/floating-click-widget/index.module.less +5 -0
- package/src/browser/components/floating-click-widget/index.tsx +21 -0
- package/src/browser/components/index.ts +1 -0
- package/src/browser/contextkeys/debug-call-stack-item-type-key.ts +4 -0
- package/src/browser/contextkeys/debug-contextkey.service.ts +54 -0
- package/src/browser/contextkeys/index.ts +1 -0
- package/src/browser/debug-ansi-handle.ts +521 -0
- package/src/browser/debug-configuration-manager.ts +514 -0
- package/src/browser/debug-configuration-model.ts +66 -0
- package/src/browser/debug-contribution.ts +756 -0
- package/src/browser/debug-exception-widget.tsx +89 -0
- package/src/browser/debug-link-detector.ts +234 -0
- package/src/browser/debug-memory.ts +220 -0
- package/src/browser/debug-preferences.ts +70 -0
- package/src/browser/debug-progress.service.ts +122 -0
- package/src/browser/debug-schema-updater.ts +67 -0
- package/src/browser/debug-service.ts +42 -0
- package/src/browser/debug-session-connection.ts +331 -0
- package/src/browser/debug-session-contribution.ts +57 -0
- package/src/browser/debug-session-manager.ts +622 -0
- package/src/browser/debug-session.ts +1181 -0
- package/src/browser/debug-style.less +128 -0
- package/src/browser/debugUtils.ts +110 -0
- package/src/browser/editor/debug-breakpoint-widget.ts +99 -0
- package/src/browser/editor/debug-breakpoint-zone-widget.tsx +262 -0
- package/src/browser/editor/debug-breakpoint.module.less +30 -0
- package/src/browser/editor/debug-editor-contribution.ts +589 -0
- package/src/browser/editor/debug-expression-provider.ts +101 -0
- package/src/browser/editor/debug-hover-model.ts +38 -0
- package/src/browser/editor/debug-hover-source.ts +107 -0
- package/src/browser/editor/debug-hover-tree.model.service.ts +332 -0
- package/src/browser/editor/debug-hover-widget.tsx +200 -0
- package/src/browser/editor/debug-hover.module.less +29 -0
- package/src/browser/editor/debug-hover.view.tsx +147 -0
- package/src/browser/editor/debug-model-manager.ts +219 -0
- package/src/browser/editor/debug-model.ts +853 -0
- package/src/browser/editor/debug-run-to-cursor.service.ts +180 -0
- package/src/browser/editor/debug-styles.ts +66 -0
- package/src/browser/editor/evaluatable-expression.ts +47 -0
- package/src/browser/editor/index.ts +6 -0
- package/src/browser/index.ts +119 -0
- package/src/browser/markers/index.ts +2 -0
- package/src/browser/markers/marker-manager.ts +201 -0
- package/src/browser/markers/marker.ts +20 -0
- package/src/browser/model/debug-source.ts +144 -0
- package/src/browser/model/debug-stack-frame.ts +111 -0
- package/src/browser/model/debug-thread.ts +186 -0
- package/src/browser/model/debug-watch.ts +129 -0
- package/src/browser/model/index.ts +4 -0
- package/src/browser/preferences/launch-folder-preference-provider.ts +23 -0
- package/src/browser/preferences/launch-preferences-contribution.ts +9 -0
- package/src/browser/preferences/launch-preferences.ts +16 -0
- package/src/browser/tree/debug-console-tree-node.define.tsx +76 -0
- package/src/browser/tree/debug-tree-node.define.ts +768 -0
- package/src/browser/tree/index.ts +2 -0
- package/src/browser/view/breakpoints/debug-breakpoints.module.less +72 -0
- package/src/browser/view/breakpoints/debug-breakpoints.service.ts +217 -0
- package/src/browser/view/breakpoints/debug-breakpoints.view.tsx +174 -0
- package/src/browser/view/configuration/debug-configuration.module.less +110 -0
- package/src/browser/view/configuration/debug-configuration.service.ts +170 -0
- package/src/browser/view/configuration/debug-configuration.view.tsx +252 -0
- package/src/browser/view/configuration/debug-toolbar.service.ts +167 -0
- package/src/browser/view/configuration/debug-toolbar.view.tsx +335 -0
- package/src/browser/view/console/debug-console-filter.model.ts +49 -0
- package/src/browser/view/console/debug-console-filter.service.ts +81 -0
- package/src/browser/view/console/debug-console-filter.view.tsx +78 -0
- package/src/browser/view/console/debug-console-model.ts +48 -0
- package/src/browser/view/console/debug-console-session.ts +165 -0
- package/src/browser/view/console/debug-console-toolbar.view.tsx +28 -0
- package/src/browser/view/console/debug-console-tree.model.service.ts +553 -0
- package/src/browser/view/console/debug-console.contribution.ts +179 -0
- package/src/browser/view/console/debug-console.module.less +371 -0
- package/src/browser/view/console/debug-console.service.ts +433 -0
- package/src/browser/view/console/debug-console.view.tsx +511 -0
- package/src/browser/view/debug-view-model.ts +182 -0
- package/src/browser/view/frames/debug-call-stack-frame.view.tsx +230 -0
- package/src/browser/view/frames/debug-call-stack-session.view.tsx +253 -0
- package/src/browser/view/frames/debug-call-stack-thread.view.tsx +103 -0
- package/src/browser/view/frames/debug-call-stack.contribution.ts +88 -0
- package/src/browser/view/frames/debug-call-stack.module.less +193 -0
- package/src/browser/view/frames/debug-call-stack.operation.tsx +97 -0
- package/src/browser/view/frames/debug-call-stack.service.ts +105 -0
- package/src/browser/view/frames/debug-call-stack.view.tsx +43 -0
- package/src/browser/view/variables/debug-variables-model.ts +38 -0
- package/src/browser/view/variables/debug-variables-tree.model.service.ts +470 -0
- package/src/browser/view/variables/debug-variables.contribution.ts +244 -0
- package/src/browser/view/variables/debug-variables.module.less +139 -0
- package/src/browser/view/variables/debug-variables.view.tsx +303 -0
- package/src/browser/view/watch/debug-watch-model.ts +38 -0
- package/src/browser/view/watch/debug-watch-tree.model.service.ts +570 -0
- package/src/browser/view/watch/debug-watch.contribution.ts +170 -0
- package/src/browser/view/watch/debug-watch.module.less +178 -0
- package/src/browser/view/watch/debug-watch.view.tsx +337 -0
- package/src/common/commands.ts +146 -0
- package/src/common/constants.ts +81 -0
- package/src/common/debug-breakpoint.ts +43 -0
- package/src/common/debug-configuration.ts +68 -0
- package/src/common/debug-console.ts +20 -0
- package/src/common/debug-editor.ts +4 -0
- package/src/common/debug-hover.ts +31 -0
- package/src/common/debug-model.ts +272 -0
- package/src/common/debug-progress.ts +8 -0
- package/src/common/debug-schema-updater.ts +3 -0
- package/src/common/debug-service.ts +176 -0
- package/src/common/debug-session-options.ts +19 -0
- package/src/common/debug-session.ts +200 -0
- package/src/common/evaluatable-expression.ts +43 -0
- package/src/common/index.ts +16 -0
- package/src/common/inline-values.ts +77 -0
- package/src/common/terminal.ts +163 -0
- package/src/common/types.ts +86 -0
- package/src/index.ts +1 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { Command } from '@opensumi/ide-core-common';
|
|
2
|
+
|
|
3
|
+
export namespace DEBUG_COMMANDS {
|
|
4
|
+
export const ADD_WATCHER: Command = {
|
|
5
|
+
id: 'debug.watch.add',
|
|
6
|
+
};
|
|
7
|
+
export const COLLAPSE_ALL_WATCHER: Command = {
|
|
8
|
+
id: 'debug.watch.collapseAll',
|
|
9
|
+
};
|
|
10
|
+
export const REMOVE_ALL_WATCHER: Command = {
|
|
11
|
+
id: 'debug.watch.removeAll',
|
|
12
|
+
};
|
|
13
|
+
export const REMOVE_WATCHER: Command = {
|
|
14
|
+
id: 'debug.watch.remove',
|
|
15
|
+
};
|
|
16
|
+
export const EDIT_WATCHER: Command = {
|
|
17
|
+
id: 'debug.watch.edit',
|
|
18
|
+
};
|
|
19
|
+
export const COPY_WATCHER_VALUE: Command = {
|
|
20
|
+
id: 'debug.watch.copyValue',
|
|
21
|
+
};
|
|
22
|
+
export const REMOVE_ALL_BREAKPOINTS: Command = {
|
|
23
|
+
id: 'debug.breakpoints.remove.all',
|
|
24
|
+
};
|
|
25
|
+
export const TOGGLE_BREAKPOINTS: Command = {
|
|
26
|
+
id: 'debug.breakpoints.toggle',
|
|
27
|
+
};
|
|
28
|
+
export const START: Command = {
|
|
29
|
+
id: 'debug.start',
|
|
30
|
+
};
|
|
31
|
+
export const NEXT: Command = {
|
|
32
|
+
id: 'debug.next',
|
|
33
|
+
};
|
|
34
|
+
export const PREV: Command = {
|
|
35
|
+
id: 'debug.prev',
|
|
36
|
+
};
|
|
37
|
+
export const OVER: Command = {
|
|
38
|
+
id: 'debug.over',
|
|
39
|
+
};
|
|
40
|
+
export const STOP: Command = {
|
|
41
|
+
id: 'debug.stop',
|
|
42
|
+
};
|
|
43
|
+
export const CONTINUE: Command = {
|
|
44
|
+
id: 'debug.continue',
|
|
45
|
+
};
|
|
46
|
+
export const RESTART: Command = {
|
|
47
|
+
id: 'debug.restart',
|
|
48
|
+
};
|
|
49
|
+
export const PAUSE: Command = {
|
|
50
|
+
id: 'debug.pause',
|
|
51
|
+
};
|
|
52
|
+
// menu commands
|
|
53
|
+
export const DELETE_BREAKPOINT: Command = {
|
|
54
|
+
id: 'debug.delete.breakpoint',
|
|
55
|
+
label: '%debug.menu.delete.breakpoint%',
|
|
56
|
+
};
|
|
57
|
+
export const EDIT_BREAKPOINT: Command = {
|
|
58
|
+
id: 'debug.edit.breakpoint',
|
|
59
|
+
label: '%debug.menu.edit.breakpoint%',
|
|
60
|
+
};
|
|
61
|
+
export const DISABLE_BREAKPOINT: Command = {
|
|
62
|
+
id: 'debug.disable.breakpoint',
|
|
63
|
+
label: '%debug.menu.disable.breakpoint%',
|
|
64
|
+
};
|
|
65
|
+
export const ENABLE_BREAKPOINT: Command = {
|
|
66
|
+
id: 'debug.enable.breakpoint',
|
|
67
|
+
label: '%debug.menu.enable.breakpoint%',
|
|
68
|
+
};
|
|
69
|
+
export const ENABLE_LOGPOINT: Command = {
|
|
70
|
+
id: 'debug.enable.logpoint',
|
|
71
|
+
label: '%debug.menu.enable.logpoint',
|
|
72
|
+
};
|
|
73
|
+
export const ADD_BREAKPOINT: Command = {
|
|
74
|
+
id: 'debug.add.breakpoint',
|
|
75
|
+
label: '%debug.menu.add.breakpoint%',
|
|
76
|
+
};
|
|
77
|
+
export const ADD_LOGPOINT: Command = {
|
|
78
|
+
id: 'debug.add.logpoint',
|
|
79
|
+
label: '%debug.menu.add.logpoint%',
|
|
80
|
+
};
|
|
81
|
+
export const ADD_CONDITIONAL_BREAKPOINT: Command = {
|
|
82
|
+
id: 'debug.add.conditional',
|
|
83
|
+
label: '%debug.menu.add.conditional%',
|
|
84
|
+
};
|
|
85
|
+
export const RESTART_FRAME: Command = {
|
|
86
|
+
id: 'debug.callstack.restart.frame',
|
|
87
|
+
};
|
|
88
|
+
export const COPY_STACK_TRACE: Command = {
|
|
89
|
+
id: 'debug.callstack.copy',
|
|
90
|
+
};
|
|
91
|
+
// variables
|
|
92
|
+
export const SET_VARIABLE_VALUE: Command = {
|
|
93
|
+
id: 'debug.variables.setValue',
|
|
94
|
+
};
|
|
95
|
+
export const COPY_VARIABLE_VALUE: Command = {
|
|
96
|
+
id: 'debug.variables.copy',
|
|
97
|
+
};
|
|
98
|
+
export const COPY_EVALUATE_PATH: Command = {
|
|
99
|
+
id: 'debug.evaluate.copy',
|
|
100
|
+
};
|
|
101
|
+
export const ADD_TO_WATCH_ID: Command = {
|
|
102
|
+
id: 'debug.addToWatchExpressions',
|
|
103
|
+
};
|
|
104
|
+
export const VIEW_MEMORY_ID: Command = {
|
|
105
|
+
id: 'debug.variables.view.memory',
|
|
106
|
+
};
|
|
107
|
+
// console commands
|
|
108
|
+
export const CLEAR_CONSOLE: Command = {
|
|
109
|
+
id: 'debug.console.clear',
|
|
110
|
+
label: '%debug.console.clear%',
|
|
111
|
+
};
|
|
112
|
+
export const COPY_CONSOLE_ITEM: Command = {
|
|
113
|
+
id: 'debug.console.copy',
|
|
114
|
+
};
|
|
115
|
+
export const COPY_CONSOLE_ALL: Command = {
|
|
116
|
+
id: 'debug.console.copyALl',
|
|
117
|
+
};
|
|
118
|
+
export const COLLAPSE_ALL_CONSOLE_ITEM: Command = {
|
|
119
|
+
id: 'debug.console.collapseAll',
|
|
120
|
+
label: '%debug.console.collapseAll%',
|
|
121
|
+
};
|
|
122
|
+
export const CONSOLE_ENTER_EVALUATE: Command = {
|
|
123
|
+
id: 'debug.console.keybing.enter.evaluate',
|
|
124
|
+
};
|
|
125
|
+
export const CONSOLE_INPUT_DOWN_ARROW: Command = {
|
|
126
|
+
id: 'debug.console.input.down.arrow',
|
|
127
|
+
};
|
|
128
|
+
export const CONSOLE_INPUT_UP_ARROW: Command = {
|
|
129
|
+
id: 'debug.console.input.up.arrow',
|
|
130
|
+
};
|
|
131
|
+
export const CONSOLE_FILTER_FOCUS: Command = {
|
|
132
|
+
id: 'debug.console.filter.input.focus',
|
|
133
|
+
};
|
|
134
|
+
export const RUN_TO_CURSOR: Command = {
|
|
135
|
+
id: 'debug.action.runToCursor',
|
|
136
|
+
label: '%debug.action.runToCursor%',
|
|
137
|
+
};
|
|
138
|
+
export const FORCE_RUN_TO_CURSOR: Command = {
|
|
139
|
+
id: 'debug.action.forceRunToCursor',
|
|
140
|
+
label: '%debug.action.forceRunToCursor%',
|
|
141
|
+
};
|
|
142
|
+
// exception widget
|
|
143
|
+
export const EXCEPTION_WIDGET_CLOSE: Command = {
|
|
144
|
+
id: 'debug.action.closeExceptionWidget',
|
|
145
|
+
};
|
|
146
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { DEBUG_CONSOLE_CONTAINER_ID, DEBUG_CONTAINER_ID } from '@opensumi/ide-core-browser/lib/common/container-id';
|
|
2
|
+
import { RawContextKey } from '@opensumi/ide-core-browser/lib/raw-context-key';
|
|
3
|
+
|
|
4
|
+
import { DebugState } from './debug-session';
|
|
5
|
+
|
|
6
|
+
export { DEBUG_CONSOLE_CONTAINER_ID, DEBUG_CONTAINER_ID };
|
|
7
|
+
|
|
8
|
+
export const DEBUG_MEMORY_SCHEME = 'vscode-debug-memory';
|
|
9
|
+
|
|
10
|
+
export const DEBUG_WATCH_ID = 'debug-watch';
|
|
11
|
+
export const DEBUG_THREAD_ID = 'debug-thread';
|
|
12
|
+
export const DEBUG_VARIABLES_ID = 'debug-variable';
|
|
13
|
+
export const DEBUG_BREAKPOINTS_ID = 'debug-breakpoints';
|
|
14
|
+
export const DEBUG_WELCOME_ID = 'debug-welcome';
|
|
15
|
+
export const DEBUG_STACK_ID = 'debug-stack';
|
|
16
|
+
export const DEBUG_FLOATING_CLICK_WIDGET = 'debug.overlayWidget.floatingClickWidget';
|
|
17
|
+
export const DEBUG_SCHEME = 'debug';
|
|
18
|
+
|
|
19
|
+
export const CONTEXT_DEBUG_STOPPED_KEY = 'debugStopped';
|
|
20
|
+
export const CONTEXT_IN_DEBUG_MODE_KEY = 'inDebugMode';
|
|
21
|
+
export const CONTEXT_DEBUG_TYPE_KEY = 'debugType';
|
|
22
|
+
|
|
23
|
+
export const CONTEXT_DEBUG_TYPE = new RawContextKey<string>('debugType', undefined);
|
|
24
|
+
export const CONTEXT_DEBUG_CONFIGURATION_TYPE = new RawContextKey<string>('debugConfigurationType', undefined);
|
|
25
|
+
export const CONTEXT_DEBUG_STATE = new RawContextKey<keyof typeof DebugState>('debugState', 'Inactive');
|
|
26
|
+
export const CONTEXT_DEBUG_UX_KEY = 'debugUx';
|
|
27
|
+
export const CONTEXT_DEBUG_UX = new RawContextKey<string>(CONTEXT_DEBUG_UX_KEY, 'default');
|
|
28
|
+
export const CONTEXT_IN_DEBUG_MODE = new RawContextKey<boolean>('inDebugMode', false);
|
|
29
|
+
export const CONTEXT_IN_DEBUG_REPL = new RawContextKey<boolean>('inDebugRepl', false);
|
|
30
|
+
export const CONTEXT_IN_DEBUG_CONSOLE = new RawContextKey<boolean>('inDebugConsole', false);
|
|
31
|
+
export const CONTEXT_BREAKPOINT_WIDGET_VISIBLE = new RawContextKey<boolean>('breakpointWidgetVisible', false);
|
|
32
|
+
export const CONTEXT_IN_BREAKPOINT_WIDGET = new RawContextKey<boolean>('inBreakpointWidget', false);
|
|
33
|
+
export const CONTEXT_BREAKPOINTS_FOCUSED = new RawContextKey<boolean>('breakpointsFocused', true);
|
|
34
|
+
export const CONTEXT_WATCH_EXPRESSIONS_FOCUSED = new RawContextKey<boolean>('watchExpressionsFocused', true);
|
|
35
|
+
export const CONTEXT_WATCH_EXPRESSIONS_EXIST = new RawContextKey<boolean>('watchExpressionsExist', false);
|
|
36
|
+
export const CONTEXT_VARIABLES_FOCUSED = new RawContextKey<boolean>('variablesFocused', true);
|
|
37
|
+
export const CONTEXT_EXPRESSION_SELECTED = new RawContextKey<boolean>('expressionSelected', false);
|
|
38
|
+
export const CONTEXT_BREAKPOINT_INPUT_FOCUSED = new RawContextKey<boolean>('breakpointInputFocused', false);
|
|
39
|
+
export const CONTEXT_CALLSTACK_ITEM_TYPE = new RawContextKey<string>('callStackItemType', undefined);
|
|
40
|
+
export const CONTEXT_CALLSTACK_SESSION_IS_ATTACH = new RawContextKey<boolean>('callStackSessionIsAttach', false);
|
|
41
|
+
export const CONTEXT_CALLSTACK_ITEM_STOPPED = new RawContextKey<boolean>('callStackItemStopped', false);
|
|
42
|
+
export const CONTEXT_CALLSTACK_SESSION_HAS_ONE_THREAD = new RawContextKey<boolean>(
|
|
43
|
+
'callStackSessionHasOneThread',
|
|
44
|
+
false,
|
|
45
|
+
);
|
|
46
|
+
export const CONTEXT_WATCH_ITEM_TYPE = new RawContextKey<string>('watchItemType', undefined);
|
|
47
|
+
export const CONTEXT_BREAKPOINT_ITEM_TYPE = new RawContextKey<string>('breakpointItemType', undefined);
|
|
48
|
+
export const CONTEXT_BREAKPOINT_ACCESS_TYPE = new RawContextKey<string>('breakpointAccessType', undefined);
|
|
49
|
+
export const CONTEXT_BREAKPOINT_SUPPORTS_CONDITION = new RawContextKey<boolean>('breakpointSupportsCondition', false);
|
|
50
|
+
export const CONTEXT_LOADED_SCRIPTS_SUPPORTED = new RawContextKey<boolean>('loadedScriptsSupported', false);
|
|
51
|
+
export const CONTEXT_LOADED_SCRIPTS_ITEM_TYPE = new RawContextKey<string>('loadedScriptsItemType', undefined);
|
|
52
|
+
export const CONTEXT_FOCUSED_SESSION_IS_ATTACH = new RawContextKey<boolean>('focusedSessionIsAttach', false);
|
|
53
|
+
export const CONTEXT_STEP_BACK_SUPPORTED = new RawContextKey<boolean>('stepBackSupported', false);
|
|
54
|
+
export const CONTEXT_RESTART_FRAME_SUPPORTED = new RawContextKey<boolean>('restartFrameSupported', false);
|
|
55
|
+
export const CONTEXT_STACK_FRAME_SUPPORTS_RESTART = new RawContextKey<boolean>('stackFrameSupportsRestart', false);
|
|
56
|
+
export const CONTEXT_JUMP_TO_CURSOR_SUPPORTED = new RawContextKey<boolean>('jumpToCursorSupported', false);
|
|
57
|
+
export const CONTEXT_STEP_INTO_TARGETS_SUPPORTED = new RawContextKey<boolean>('stepIntoTargetsSupported', false);
|
|
58
|
+
export const CONTEXT_BREAKPOINTS_EXIST = new RawContextKey<boolean>('breakpointsExist', false);
|
|
59
|
+
export const CONTEXT_DEBUGGERS_AVAILABLE = new RawContextKey<boolean>('debuggersAvailable', false);
|
|
60
|
+
export const CONTEXT_DEBUG_PROTOCOL_VARIABLE_MENU_CONTEXT = new RawContextKey<string>(
|
|
61
|
+
'debugProtocolVariableMenuContext',
|
|
62
|
+
undefined,
|
|
63
|
+
);
|
|
64
|
+
export const CONTEXT_SET_VARIABLE_SUPPORTED = new RawContextKey<boolean>('debugSetVariableSupported', false);
|
|
65
|
+
export const CONTEXT_BREAK_WHEN_VALUE_CHANGES_SUPPORTED = new RawContextKey<boolean>(
|
|
66
|
+
'breakWhenValueChangesSupported',
|
|
67
|
+
false,
|
|
68
|
+
);
|
|
69
|
+
export const CONTEXT_BREAK_WHEN_VALUE_IS_ACCESSED_SUPPORTED = new RawContextKey<boolean>(
|
|
70
|
+
'breakWhenValueIsAccessedSupported',
|
|
71
|
+
false,
|
|
72
|
+
);
|
|
73
|
+
export const CONTEXT_BREAK_WHEN_VALUE_IS_READ_SUPPORTED = new RawContextKey<boolean>(
|
|
74
|
+
'breakWhenValueIsReadSupported',
|
|
75
|
+
false,
|
|
76
|
+
);
|
|
77
|
+
export const CONTEXT_VARIABLE_EVALUATE_NAME_PRESENT = new RawContextKey<boolean>('variableEvaluateNamePresent', false);
|
|
78
|
+
export const CONTEXT_EXCEPTION_WIDGET_VISIBLE = new RawContextKey<boolean>('exceptionWidgetVisible', false);
|
|
79
|
+
export const CONTEXT_MULTI_SESSION_REPL = new RawContextKey<boolean>('multiSessionRepl', false);
|
|
80
|
+
export const CONTEXT_MULTI_SESSION_DEBUG = new RawContextKey<boolean>('multiSessionDebug', false);
|
|
81
|
+
export const CONTEXT_CAN_VIEW_MEMORY = new RawContextKey<boolean>('canViewMemory', undefined);
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { URI } from '@opensumi/ide-core-common';
|
|
2
|
+
import { DebugProtocol } from '@opensumi/vscode-debugprotocol';
|
|
3
|
+
|
|
4
|
+
export interface ISourceBreakpoint {
|
|
5
|
+
id: string;
|
|
6
|
+
enabled: boolean;
|
|
7
|
+
uri: string;
|
|
8
|
+
raw: DebugProtocol.SourceBreakpoint;
|
|
9
|
+
logMessage?: string;
|
|
10
|
+
message?: string;
|
|
11
|
+
status: Map<string, DebugProtocol.Breakpoint>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface IRuntimeBreakpoint extends ISourceBreakpoint {
|
|
15
|
+
status: Map<string, DebugProtocol.Breakpoint>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type TSourceBrekpointProperties = keyof Pick<
|
|
19
|
+
DebugProtocol.SourceBreakpoint,
|
|
20
|
+
'condition' | 'hitCondition' | 'logMessage'
|
|
21
|
+
>;
|
|
22
|
+
|
|
23
|
+
export interface BreakpointChangeData {
|
|
24
|
+
context: TSourceBrekpointProperties;
|
|
25
|
+
value: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export type DebugBreakpointWidgetContext = {
|
|
29
|
+
[context in TSourceBrekpointProperties]?: string;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export interface BreakpointsChangeEvent {
|
|
33
|
+
affected: URI[];
|
|
34
|
+
added: IDebugBreakpoint[];
|
|
35
|
+
removed: IDebugBreakpoint[];
|
|
36
|
+
changed: IDebugBreakpoint[];
|
|
37
|
+
/**
|
|
38
|
+
* 标识后端调试状态已更新,这是纯视图更新。
|
|
39
|
+
*/
|
|
40
|
+
statusUpdated?: boolean;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type IDebugBreakpoint = ISourceBreakpoint | IRuntimeBreakpoint;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export type DebugViewLocation = 'default' | 'left' | 'right' | 'bottom';
|
|
2
|
+
/**
|
|
3
|
+
* 调试适配器进程配置.
|
|
4
|
+
*/
|
|
5
|
+
export interface DebugConfiguration {
|
|
6
|
+
/**
|
|
7
|
+
* 调试适配器进程类型.
|
|
8
|
+
*/
|
|
9
|
+
type: string;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* 调试适配器进程名称
|
|
13
|
+
*/
|
|
14
|
+
name: string;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* 拓展属性
|
|
18
|
+
*/
|
|
19
|
+
[key: string]: any;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* 调试适配器进程请求类型
|
|
23
|
+
*/
|
|
24
|
+
request: string;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* 如果noDebug为true,则启动请求应启动程序而不启用调试
|
|
28
|
+
*/
|
|
29
|
+
noDebug?: boolean;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* 来自先前的重启进程的可选参数
|
|
33
|
+
* 该数据作为'terminated'事件的'restart'属性传递
|
|
34
|
+
* 客户端需保证数据完整性
|
|
35
|
+
*/
|
|
36
|
+
__restart?: any;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* 默认的调试工具栏视图位置
|
|
40
|
+
* 默认值:default
|
|
41
|
+
*/
|
|
42
|
+
debugViewLocation?: DebugViewLocation;
|
|
43
|
+
|
|
44
|
+
preLaunchTask?: string;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* 打开调试(左侧面板)视图时机
|
|
48
|
+
* 默认值:neverOpen
|
|
49
|
+
*/
|
|
50
|
+
openDebug?: 'neverOpen' | 'openOnSessionStart' | 'openOnFirstSessionStart' | 'openOnDebugBreak';
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* 打开内置DebugConsole(底部面板)视图时机
|
|
54
|
+
* 默认值:neverOpen
|
|
55
|
+
*/
|
|
56
|
+
internalConsoleOptions?: 'neverOpen' | 'openOnSessionStart' | 'openOnFirstSessionStart';
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export namespace DebugConfiguration {
|
|
60
|
+
export function is(arg: DebugConfiguration | any): arg is DebugConfiguration {
|
|
61
|
+
return !!arg && typeof arg === 'object' && 'type' in arg && 'name' in arg && 'request' in arg;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export const DEFAULT_ADD_CONFIGURATION_KEY = '__ADD_CONF__';
|
|
66
|
+
export const DEFAULT_NO_CONFIGURATION_KEY = '__NO_CONF__';
|
|
67
|
+
export const DEFAULT_CONFIGURATION_NAME_SEPARATOR = '__CONF__';
|
|
68
|
+
export const DEFAULT_CONFIGURATION_INDEX_SEPARATOR = '__INDEX__';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ITree, ITreeNode } from '@opensumi/ide-components/lib/recycle-tree/types';
|
|
2
|
+
import { Event } from '@opensumi/ide-core-common';
|
|
3
|
+
|
|
4
|
+
export const IDebugConsoleModelService = Symbol('IDebugConsoleModelService');
|
|
5
|
+
|
|
6
|
+
export interface IDebugConsoleSession extends ITree {
|
|
7
|
+
clear(): void;
|
|
8
|
+
append(value: string): void;
|
|
9
|
+
appendLine(value: string): void;
|
|
10
|
+
onDidChange: Event<void>;
|
|
11
|
+
execute(value: string): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface IDebugConsoleModelService {
|
|
15
|
+
debugConsoleSession: IDebugConsoleSession;
|
|
16
|
+
clear(): void;
|
|
17
|
+
copyAll(): void;
|
|
18
|
+
collapseAll(): void;
|
|
19
|
+
copy(node: ITreeNode): void;
|
|
20
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as monaco from '@opensumi/monaco-editor-core/esm/vs/editor/editor.api';
|
|
2
|
+
|
|
3
|
+
export interface IDebugHoverWidget extends monaco.editor.IContentWidget {
|
|
4
|
+
show: (options?: ShowDebugHoverOptions | undefined) => void;
|
|
5
|
+
hide: (options?: ShowDebugHoverOptions | undefined) => void;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface ShowDebugHoverOptions {
|
|
9
|
+
/**
|
|
10
|
+
* 选中区域
|
|
11
|
+
*/
|
|
12
|
+
selection: monaco.Range;
|
|
13
|
+
/**
|
|
14
|
+
* 是否为焦点
|
|
15
|
+
* 默认值:false
|
|
16
|
+
*/
|
|
17
|
+
focus?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* 是否立即调用,当为true时会清理之前的队列
|
|
20
|
+
* 默认值:true
|
|
21
|
+
*/
|
|
22
|
+
immediate?: boolean;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface HideDebugHoverOptions {
|
|
26
|
+
/**
|
|
27
|
+
* 是否立即调用,当为true时会清理之前的队列
|
|
28
|
+
* 默认值:true
|
|
29
|
+
*/
|
|
30
|
+
immediate?: boolean;
|
|
31
|
+
}
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import stream from 'stream';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
IDisposable,
|
|
5
|
+
MaybePromise,
|
|
6
|
+
IJSONSchema,
|
|
7
|
+
IJSONSchemaSnippet,
|
|
8
|
+
URI,
|
|
9
|
+
Disposable,
|
|
10
|
+
Emitter,
|
|
11
|
+
BinaryBuffer,
|
|
12
|
+
decodeBase64,
|
|
13
|
+
encodeBase64,
|
|
14
|
+
Event,
|
|
15
|
+
} from '@opensumi/ide-core-common';
|
|
16
|
+
// eslint-disable-next-line import/no-restricted-paths
|
|
17
|
+
import type { ICodeEditor as IMonacoCodeEditor } from '@opensumi/ide-monaco/lib/browser/monaco-api/types';
|
|
18
|
+
import type { editor } from '@opensumi/monaco-editor-core';
|
|
19
|
+
import * as monaco from '@opensumi/monaco-editor-core/esm/vs/editor/editor.api';
|
|
20
|
+
|
|
21
|
+
import {
|
|
22
|
+
IRuntimeBreakpoint,
|
|
23
|
+
ISourceBreakpoint,
|
|
24
|
+
DebugBreakpointWidgetContext,
|
|
25
|
+
TSourceBrekpointProperties,
|
|
26
|
+
} from './debug-breakpoint';
|
|
27
|
+
import { DebugConfiguration } from './debug-configuration';
|
|
28
|
+
import { DebugEditor } from './debug-editor';
|
|
29
|
+
import { IDebugHoverWidget } from './debug-hover';
|
|
30
|
+
import { IMemoryInvalidationEvent, IMemoryRegion, MemoryRange, MemoryRangeType } from './debug-service';
|
|
31
|
+
import { IDebugSession } from './debug-session';
|
|
32
|
+
|
|
33
|
+
export interface IDebugBreakpointWidget extends IDisposable {
|
|
34
|
+
position: monaco.Position | undefined;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface IDebugBreakpointWidget extends IDisposable {
|
|
38
|
+
position: monaco.Position | undefined;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const DebugAdapterSession = Symbol('DebugAdapterSession');
|
|
42
|
+
|
|
43
|
+
export interface DebugAdapterSession {
|
|
44
|
+
id: string;
|
|
45
|
+
start(channel: any): Promise<void>;
|
|
46
|
+
stop(): Promise<void>;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export const DebugAdapterSessionFactory = Symbol('DebugAdapterSessionFactory');
|
|
50
|
+
|
|
51
|
+
export interface DebugAdapterSessionFactory {
|
|
52
|
+
get(sessionId: string, communicationProvider: DebugStreamConnection): DebugAdapterSession;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface DebugAdapterSpawnExecutable {
|
|
56
|
+
command: string;
|
|
57
|
+
args?: string[];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface DebugAdapterForkExecutable {
|
|
61
|
+
modulePath: string;
|
|
62
|
+
args?: string[];
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* 可执行的调试适配器类型
|
|
67
|
+
* 用于实例化调试适配器的参数
|
|
68
|
+
*
|
|
69
|
+
* 在Launch适配器进程的情况下,参数包含命令和参数。例如:
|
|
70
|
+
* {'command' : 'COMMAND_TO_LAUNCH_DEBUG_ADAPTER', args : [ { 'arg1', 'arg2' } ] }
|
|
71
|
+
*
|
|
72
|
+
* 在Fork适配器进程的情况下,包含要转换的modulePath。例如:
|
|
73
|
+
* {'modulePath' : 'NODE_COMMAND_TO_LAUNCH_DEBUG_ADAPTER', args : [ { 'arg1', 'arg2' } ] }
|
|
74
|
+
*/
|
|
75
|
+
export type DebugAdapterExecutable = DebugAdapterSpawnExecutable | DebugAdapterForkExecutable;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* 与调试进程的通讯渠道
|
|
79
|
+
*/
|
|
80
|
+
export interface DebugStreamConnection extends IDisposable {
|
|
81
|
+
output: stream.Readable;
|
|
82
|
+
input: stream.Writable;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export const DebugAdapterFactory = Symbol('DebugAdapterFactory');
|
|
86
|
+
|
|
87
|
+
export interface DebugAdapterFactory {
|
|
88
|
+
start(executable: DebugAdapterExecutable): DebugStreamConnection;
|
|
89
|
+
connect(debugServerPort: number): DebugStreamConnection;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export const DebugAdapterContribution = Symbol('DebugAdapterContribution');
|
|
93
|
+
|
|
94
|
+
export interface DebugAdapterContribution {
|
|
95
|
+
/**
|
|
96
|
+
* The debug type. Should be a unique value among all debug adapters.
|
|
97
|
+
*/
|
|
98
|
+
readonly type: string;
|
|
99
|
+
|
|
100
|
+
readonly label?: MaybePromise<string | undefined>;
|
|
101
|
+
|
|
102
|
+
readonly languages?: MaybePromise<string[] | undefined>;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* The [debug adapter session](#DebugAdapterSession) factory.
|
|
106
|
+
* If a default implementation of the debug adapter session does not
|
|
107
|
+
* fit all needs it is possible to provide its own implementation using
|
|
108
|
+
* this factory. But it is strongly recommended to extend the default
|
|
109
|
+
* implementation if so.
|
|
110
|
+
*/
|
|
111
|
+
debugAdapterSessionFactory?: DebugAdapterSessionFactory;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* @returns The contributed configuration schema for this debug type.
|
|
115
|
+
*/
|
|
116
|
+
getSchemaAttributes?(): MaybePromise<IJSONSchema[]>;
|
|
117
|
+
|
|
118
|
+
getConfigurationSnippets?(): MaybePromise<IJSONSchemaSnippet[]>;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Provides a [debug adapter executable](#DebugAdapterExecutable)
|
|
122
|
+
* based on [debug configuration](#DebugConfiguration) to launch a new debug adapter
|
|
123
|
+
* or to connect to existed one.
|
|
124
|
+
* @param config The resolved [debug configuration](#DebugConfiguration).
|
|
125
|
+
* @returns The [debug adapter executable](#DebugAdapterExecutable).
|
|
126
|
+
*/
|
|
127
|
+
provideDebugAdapterExecutable?(config: DebugConfiguration): MaybePromise<DebugAdapterExecutable | undefined>;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Provides initial [debug configuration](#DebugConfiguration).
|
|
131
|
+
* @returns An array of [debug configurations](#DebugConfiguration).
|
|
132
|
+
*/
|
|
133
|
+
provideDebugConfigurations?(workspaceFolderUri?: string): MaybePromise<DebugConfiguration[]>;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Resolves a [debug configuration](#DebugConfiguration) by filling in missing values
|
|
137
|
+
* or by adding/changing/removing attributes.
|
|
138
|
+
* @param config The [debug configuration](#DebugConfiguration) to resolve.
|
|
139
|
+
* @returns The resolved debug configuration.
|
|
140
|
+
*/
|
|
141
|
+
resolveDebugConfiguration?(
|
|
142
|
+
config: DebugConfiguration,
|
|
143
|
+
workspaceFolderUri?: string,
|
|
144
|
+
): MaybePromise<DebugConfiguration | undefined>;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export const DebugModelFactory = Symbol('DebugModelFactory');
|
|
148
|
+
export type DebugModelFactory = (editor: DebugEditor) => IDebugModel;
|
|
149
|
+
|
|
150
|
+
export const IDebugModel = Symbol('IDebugModel');
|
|
151
|
+
export interface IDebugModel extends IDisposable {
|
|
152
|
+
uri: URI;
|
|
153
|
+
position: monaco.Position;
|
|
154
|
+
init: () => Promise<void>;
|
|
155
|
+
renderBreakpoints: () => void;
|
|
156
|
+
toggleBreakpoint: (position?: monaco.Position) => void;
|
|
157
|
+
openBreakpointView: (
|
|
158
|
+
position: monaco.Position,
|
|
159
|
+
context?: DebugBreakpointWidgetContext,
|
|
160
|
+
defaultContext?: TSourceBrekpointProperties,
|
|
161
|
+
) => void;
|
|
162
|
+
closeBreakpointView: () => void;
|
|
163
|
+
acceptBreakpoint: () => void;
|
|
164
|
+
focusStackFrame: () => void;
|
|
165
|
+
breakpoint: ISourceBreakpoint | IRuntimeBreakpoint | undefined;
|
|
166
|
+
onContextMenu: (event: editor.IEditorMouseEvent | editor.IPartialEditorMouseEvent) => void;
|
|
167
|
+
onMouseDown: (event: editor.IEditorMouseEvent | editor.IPartialEditorMouseEvent) => void;
|
|
168
|
+
onMouseMove: (event: editor.IEditorMouseEvent | editor.IPartialEditorMouseEvent) => void;
|
|
169
|
+
onMouseLeave: (event: editor.IEditorMouseEvent | editor.IPartialEditorMouseEvent) => void;
|
|
170
|
+
getBreakpoints(
|
|
171
|
+
uri?: URI | undefined,
|
|
172
|
+
filter?: Partial<monaco.IPosition> | undefined,
|
|
173
|
+
): Array<ISourceBreakpoint | IRuntimeBreakpoint>;
|
|
174
|
+
getEditor: () => DebugEditor;
|
|
175
|
+
getBreakpointWidget: () => IDebugBreakpointWidget;
|
|
176
|
+
getDebugHoverWidget: () => IDebugHoverWidget;
|
|
177
|
+
render: () => void;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export class MemoryRegion extends Disposable implements IMemoryRegion {
|
|
181
|
+
private readonly invalidateEmitter = this.registerDispose(new Emitter<IMemoryInvalidationEvent>());
|
|
182
|
+
|
|
183
|
+
/** @inheritdoc */
|
|
184
|
+
public readonly onDidInvalidate = this.invalidateEmitter.event;
|
|
185
|
+
|
|
186
|
+
/** @inheritdoc */
|
|
187
|
+
public readonly writable = !!this.session.capabilities.supportsWriteMemoryRequest;
|
|
188
|
+
|
|
189
|
+
constructor(private readonly memoryReference: string, private readonly session: IDebugSession) {
|
|
190
|
+
super();
|
|
191
|
+
this.registerDispose(
|
|
192
|
+
session.onDidInvalidateMemory((e) => {
|
|
193
|
+
if (e.body.memoryReference === memoryReference) {
|
|
194
|
+
this.invalidate(e.body.offset, e.body.count - e.body.offset);
|
|
195
|
+
}
|
|
196
|
+
}),
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
public async read(fromOffset: number, toOffset: number): Promise<MemoryRange[]> {
|
|
201
|
+
const length = toOffset - fromOffset;
|
|
202
|
+
const offset = fromOffset;
|
|
203
|
+
const result = await this.session.readMemory(this.memoryReference, offset, length);
|
|
204
|
+
|
|
205
|
+
if (result === undefined || !result.body?.data) {
|
|
206
|
+
return [{ type: MemoryRangeType.Unreadable, offset, length }];
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
let data: BinaryBuffer;
|
|
210
|
+
try {
|
|
211
|
+
data = decodeBase64(result.body.data);
|
|
212
|
+
} catch (e) {
|
|
213
|
+
return [{ type: MemoryRangeType.Error, offset, length, error: e.message }];
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
const unreadable = result.body.unreadableBytes || 0;
|
|
217
|
+
const dataLength = length - unreadable;
|
|
218
|
+
if (data.byteLength < dataLength) {
|
|
219
|
+
const pad = BinaryBuffer.alloc(dataLength - data.byteLength);
|
|
220
|
+
pad.buffer.fill(0);
|
|
221
|
+
data = BinaryBuffer.concat([data, pad], dataLength);
|
|
222
|
+
} else if (data.byteLength > dataLength) {
|
|
223
|
+
data = data.slice(0, dataLength);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
if (!unreadable) {
|
|
227
|
+
return [{ type: MemoryRangeType.Valid, offset, length, data }];
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
return [
|
|
231
|
+
{ type: MemoryRangeType.Valid, offset, length: dataLength, data },
|
|
232
|
+
{ type: MemoryRangeType.Unreadable, offset: offset + dataLength, length: unreadable },
|
|
233
|
+
];
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
public async write(offset: number, data: BinaryBuffer): Promise<number> {
|
|
237
|
+
const result = await this.session.writeMemory(this.memoryReference, offset, encodeBase64(data), true);
|
|
238
|
+
const written = result?.body?.bytesWritten ?? data.byteLength;
|
|
239
|
+
this.invalidate(offset, offset + written);
|
|
240
|
+
return written;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
public override dispose() {
|
|
244
|
+
super.dispose();
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
private invalidate(fromOffset: number, toOffset: number) {
|
|
248
|
+
this.invalidateEmitter.fire({ fromOffset, toOffset });
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export enum DebugModelSupportedEventType {
|
|
253
|
+
down = 'Down',
|
|
254
|
+
move = 'Move',
|
|
255
|
+
leave = 'Leave',
|
|
256
|
+
contextMenu = 'contextMenu',
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
export const IDebugModelManager = Symbol('DebugModelManager');
|
|
260
|
+
|
|
261
|
+
export interface IDebugModelManager {
|
|
262
|
+
init(session?: IDebugSession): void;
|
|
263
|
+
model: IDebugModel | undefined;
|
|
264
|
+
resolve(uri: URI): IDebugModel[] | undefined;
|
|
265
|
+
handleMouseEvent(
|
|
266
|
+
uri: URI,
|
|
267
|
+
type: DebugModelSupportedEventType,
|
|
268
|
+
event: monaco.editor.IEditorMouseEvent | monaco.editor.IPartialEditorMouseEvent,
|
|
269
|
+
monacoEditor: IMonacoCodeEditor,
|
|
270
|
+
): void;
|
|
271
|
+
onModelChanged: Event<monaco.editor.IModelChangedEvent>;
|
|
272
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DebugState, IDebugSessionManager } from './debug-session';
|
|
2
|
+
|
|
3
|
+
export const IDebugProgress = Symbol('DebugProgress');
|
|
4
|
+
|
|
5
|
+
export interface IDebugProgress {
|
|
6
|
+
run: (sm: IDebugSessionManager) => void;
|
|
7
|
+
onDebugServiceStateChange: (state: DebugState) => void;
|
|
8
|
+
}
|