@opensumi/ide-debug 2.21.5 → 2.21.6-next-1669195469.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/index.d.ts.map +1 -1
- package/lib/browser/index.js +2 -9
- package/lib/browser/index.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/view/configuration/debug-configuration.module.less +5 -5
- 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.view.js +2 -2
- package/lib/browser/view/configuration/debug-toolbar.view.js.map +1 -1
- package/lib/browser/view/console/debug-console.module.less +2 -1
- package/lib/browser/view/console/debug-console.view.js +2 -2
- package/lib/browser/view/console/debug-console.view.js.map +1 -1
- package/lib/browser/view/variables/debug-variables.module.less +2 -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.module.less +2 -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/package.json +26 -25
- 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 +513 -0
- package/src/browser/debug-configuration-model.ts +66 -0
- package/src/browser/debug-contribution.ts +904 -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 +333 -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 +1179 -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 +31 -0
- package/src/browser/editor/debug-editor-contribution.ts +590 -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 +220 -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 +121 -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 +130 -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 +164 -0
- package/src/browser/view/console/debug-console-toolbar.view.tsx +28 -0
- package/src/browser/view/console/debug-console-tree.model.service.ts +550 -0
- package/src/browser/view/console/debug-console.contribution.ts +181 -0
- package/src/browser/view/console/debug-console.module.less +373 -0
- package/src/browser/view/console/debug-console.service.ts +433 -0
- package/src/browser/view/console/debug-console.view.tsx +500 -0
- package/src/browser/view/debug-view-model.ts +182 -0
- package/src/browser/view/frames/debug-call-stack-frame.view.tsx +224 -0
- package/src/browser/view/frames/debug-call-stack-session.view.tsx +237 -0
- package/src/browser/view/frames/debug-call-stack-thread.view.tsx +93 -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 +467 -0
- package/src/browser/view/variables/debug-variables.contribution.ts +244 -0
- package/src/browser/view/variables/debug-variables.module.less +149 -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 +567 -0
- package/src/browser/view/watch/debug-watch.contribution.ts +167 -0
- package/src/browser/view/watch/debug-watch.module.less +189 -0
- package/src/browser/view/watch/debug-watch.view.tsx +337 -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-editor.ts +4 -0
- package/src/common/debug-hover.ts +31 -0
- package/src/common/debug-model.ts +247 -0
- package/src/common/debug-progress.ts +8 -0
- package/src/common/debug-schema-updater.ts +1 -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 +14 -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,4 @@
|
|
|
1
|
+
<!--Copyright (c) Microsoft Corporation. All rights reserved.-->
|
|
2
|
+
<!--Copyright (C) 2018 TypeFox and others.-->
|
|
3
|
+
<!--Licensed under the MIT License. See License.txt in the project root for license information.-->
|
|
4
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.icon-canvas-transparent,.icon-vs-out{fill:#f6f6f6;}.icon-canvas-transparent{opacity:0;}.icon-disabled-grey{fill:#848484;}</style></defs><title>breakpoint-log-unverified</title><g id="canvas"><path class="icon-canvas-transparent" d="M16,0V16H0V0Z"/></g><g id="outline" style="display: none;"><path class="icon-vs-out" d="M13.664,8,8,13.664,2.336,8,8,2.336Z"/></g><g id="iconBg"><path class="icon-disabled-grey" d="M8,3.75,3.75,8,8,12.25,12.25,8ZM5.518,8,8,5.518,10.482,8,8,10.482Z"/></g></svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<!--Copyright (c) Microsoft Corporation. All rights reserved.-->
|
|
2
|
+
<!--Copyright (C) 2018 TypeFox and others.-->
|
|
3
|
+
<!--Licensed under the MIT License. See License.txt in the project root for license information.-->
|
|
4
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.icon-canvas-transparent,.icon-vs-out{fill:#f6f6f6;}.icon-canvas-transparent{opacity:0;}.icon-vs-red{fill:#e51400;}</style></defs><title>breakpoint-log</title><g id="canvas"><path class="icon-canvas-transparent" d="M16,0V16H0V0Z"/></g><g id="outline" style="display: none;"><path class="icon-vs-out" d="M13.414,8,8,13.414,2.586,8,8,2.586Z"/></g><g id="iconBg"><path class="icon-vs-red" d="M12,8,8,12,4,8,8,4Z"/></g></svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<!--Copyright (c) Microsoft Corporation. All rights reserved.-->
|
|
2
|
+
<!--Copyright (C) 2018 TypeFox and others.-->
|
|
3
|
+
<!--Licensed under the MIT License. See License.txt in the project root for license information.-->
|
|
4
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.icon-canvas-transparent,.icon-vs-out{fill:#f6f6f6;}.icon-canvas-transparent{opacity:0;}.icon-vs-red{fill:#e51400;}.icon-white{fill:#fff;}</style></defs><title>breakpoint-unsupported</title><g id="canvas"><path class="icon-canvas-transparent" d="M16,0V16H0V0Z"/></g><g id="outline" style="display: none;"><path class="icon-vs-out" d="M12.632,8A4.632,4.632,0,1,1,8,3.368,4.638,4.638,0,0,1,12.632,8Z"/></g><g id="iconBg"><path class="icon-vs-red" d="M11.789,8A3.789,3.789,0,1,1,8,4.211,3.788,3.788,0,0,1,11.789,8Z"/><path class="icon-white" d="M7.5,9.5h1v1h-1Zm0-4v3h1v-3Z"/></g></svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<!--Copyright (c) Microsoft Corporation. All rights reserved.-->
|
|
2
|
+
<!--Copyright (C) 2018 TypeFox and others.-->
|
|
3
|
+
<!--Licensed under the MIT License. See License.txt in the project root for license information.-->
|
|
4
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.icon-canvas-transparent,.icon-vs-out{fill:#f6f6f6;}.icon-canvas-transparent{opacity:0;}.icon-disabled-grey{fill:#848484;}</style></defs><title>breakpoint-unverified</title><g id="canvas"><path class="icon-canvas-transparent" d="M16,0V16H0V0Z"/></g><g id="outline" style="display: none;"><path class="icon-vs-out" d="M12.632,8A4.632,4.632,0,1,1,8,3.368,4.638,4.638,0,0,1,12.632,8Z"/></g><g id="iconBg"><path class="icon-disabled-grey" d="M8,4.211A3.789,3.789,0,1,0,11.79,8,3.788,3.788,0,0,0,8,4.211ZM8,10.29A2.29,2.29,0,1,1,10.29,8,2.292,2.292,0,0,1,8,10.29Z"/></g></svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<!--Copyright (c) Microsoft Corporation. All rights reserved.-->
|
|
2
|
+
<!--Copyright (C) 2018 TypeFox and others.-->
|
|
3
|
+
<!--Licensed under the MIT License. See License.txt in the project root for license information.-->
|
|
4
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.icon-canvas-transparent,.icon-vs-out{fill:#f6f6f6;}.icon-canvas-transparent{opacity:0;}.icon-vs-red{fill:#e51400;}</style></defs><title>breakpoint</title><g id="canvas"><path class="icon-canvas-transparent" d="M16,0V16H0V0Z"/></g><g id="outline" style="display: none;"><path class="icon-vs-out" d="M12.632,8A4.632,4.632,0,1,1,8,3.368,4.638,4.638,0,0,1,12.632,8Z"/></g><g id="iconBg"><path class="icon-vs-red" d="M11.789,8A3.789,3.789,0,1,1,8,4.211,3.788,3.788,0,0,1,11.789,8Z"/></g></svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<!--Copyright (c) Microsoft Corporation. All rights reserved.-->
|
|
2
|
+
<!--Copyright (C) 2018 TypeFox and others.-->
|
|
3
|
+
<!--Licensed under the MIT License. See License.txt in the project root for license information.-->
|
|
4
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.icon-canvas-transparent,.icon-vs-out{fill:#252526;}.icon-canvas-transparent{opacity:0;}.icon-vs-bg{fill:#c5c5c5;}</style></defs><title>breakpoints-activate</title><g id="canvas"><path class="icon-canvas-transparent" d="M16,0V16H0V0Z"/></g><g id="outline" style="display: none;"><path class="icon-vs-out" d="M16,5.5A5.536,5.536,0,0,1,11,11a5.536,5.536,0,0,1-5.5,5A5.549,5.549,0,0,1,0,10.5,5.465,5.465,0,0,1,5,5a5.512,5.512,0,0,1,11,.5Z"/></g><g id="iconBg"><path class="icon-vs-bg" d="M15,5.5A4.395,4.395,0,0,1,11,10a2.957,2.957,0,0,0-.2-1A3.565,3.565,0,0,0,14,5.5a3.507,3.507,0,0,0-7-.3A3.552,3.552,0,0,0,6,5a4.622,4.622,0,0,1,4.5-4A4.481,4.481,0,0,1,15,5.5ZM5.5,6A4.5,4.5,0,1,0,10,10.5,4.5,4.5,0,0,0,5.5,6Z"/></g></svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<!--Copyright (c) Microsoft Corporation. All rights reserved.-->
|
|
2
|
+
<!--Copyright (C) 2018 TypeFox and others.-->
|
|
3
|
+
<!--Licensed under the MIT License. See License.txt in the project root for license information.-->
|
|
4
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.icon-canvas-transparent,.icon-vs-out{fill:#f6f6f6;}.icon-canvas-transparent{opacity:0;}.icon-vs-bg{fill:#424242;}</style></defs><title>breakpoints-activate</title><g id="canvas"><path class="icon-canvas-transparent" d="M16,0V16H0V0Z"/></g><g id="outline" style="display: none;"><path class="icon-vs-out" d="M16,5.5A5.536,5.536,0,0,1,11,11a5.536,5.536,0,0,1-5.5,5A5.549,5.549,0,0,1,0,10.5,5.465,5.465,0,0,1,5,5a5.512,5.512,0,0,1,11,.5Z"/></g><g id="iconBg"><path class="icon-vs-bg" d="M15,5.5A4.395,4.395,0,0,1,11,10a2.957,2.957,0,0,0-.2-1A3.565,3.565,0,0,0,14,5.5a3.507,3.507,0,0,0-7-.3A3.552,3.552,0,0,0,6,5a4.622,4.622,0,0,1,4.5-4A4.481,4.481,0,0,1,15,5.5ZM5.5,6A4.5,4.5,0,1,0,10,10.5,4.5,4.5,0,0,0,5.5,6Z"/></g></svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<!--Copyright (c) Microsoft Corporation. All rights reserved.-->
|
|
2
|
+
<!--Copyright (C) 2018 TypeFox and others.-->
|
|
3
|
+
<!--Licensed under the MIT License. See License.txt in the project root for license information.-->
|
|
4
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.icon-canvas-transparent,.icon-vs-out{fill:#252526;}.icon-canvas-transparent{opacity:0;}.icon-vs-bg{fill:#c5c5c5;}</style></defs><title>configure</title><g id="canvas"><path class="icon-canvas-transparent" d="M16,0V16H0V0Z"/></g><g id="outline" style="display: none;"><path class="icon-vs-out" d="M16,10.015l-2.238.372,1.318,1.847L12.233,15.08l-1.847-1.318L10.013,16H5.986l-.373-2.237L3.767,15.08.919,12.233l1.319-1.847L0,10.013V5.986l2.238-.373L.919,3.767,3.768.919,5.613,2.238,5.986,0h4.028l.372,2.238L12.233.919,15.08,3.768,13.762,5.613,16,5.986Z"/></g><g id="iconBg"><path class="icon-vs-bg" d="M12.876,9.521,15,9.167V6.834L12.879,6.48a5.12,5.12,0,0,0-.354-.854l1.25-1.75-1.65-1.65L10.373,3.477c-.137-.072-.262-.159-.408-.219s-.3-.087-.444-.133L9.167,1H6.834L6.48,3.121a5.118,5.118,0,0,0-.854.354l-1.75-1.25-1.65,1.65L3.477,5.627c-.072.137-.159.262-.219.408s-.087.3-.133.444L1,6.833V9.166l2.121.354a5.122,5.122,0,0,0,.354.854l-1.25,1.75,1.65,1.65,1.752-1.252c.137.072.262.159.408.22s.3.087.444.133L6.833,15H9.166l.354-2.121a5.121,5.121,0,0,0,.854-.354l1.75,1.25,1.65-1.65-1.252-1.752c.072-.137.159-.263.219-.409S12.83,9.669,12.876,9.521ZM8,10.212A2.212,2.212,0,1,1,10.212,8,2.212,2.212,0,0,1,8,10.212Z"/></g></svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<!--Copyright (c) Microsoft Corporation. All rights reserved.-->
|
|
2
|
+
<!--Copyright (C) 2018 TypeFox and others.-->
|
|
3
|
+
<!--Licensed under the MIT License. See License.txt in the project root for license information.-->
|
|
4
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.icon-canvas-transparent,.icon-vs-out{fill:#f6f6f6;}.icon-canvas-transparent{opacity:0;}.icon-vs-bg{fill:#424242;}</style></defs><title>configure</title><g id="canvas"><path class="icon-canvas-transparent" d="M16,0V16H0V0Z"/></g><g id="outline" style="display: none;"><path class="icon-vs-out" d="M16,10.015l-2.238.372,1.318,1.847L12.233,15.08l-1.847-1.318L10.013,16H5.986l-.373-2.237L3.767,15.08.919,12.233l1.319-1.847L0,10.013V5.986l2.238-.373L.919,3.767,3.768.919,5.613,2.238,5.986,0h4.028l.372,2.238L12.233.919,15.08,3.768,13.762,5.613,16,5.986Z"/></g><g id="iconBg"><path class="icon-vs-bg" d="M12.876,9.521,15,9.167V6.834L12.879,6.48a5.12,5.12,0,0,0-.354-.854l1.25-1.75-1.65-1.65L10.373,3.477c-.137-.072-.262-.159-.408-.219s-.3-.087-.444-.133L9.167,1H6.834L6.48,3.121a5.118,5.118,0,0,0-.854.354l-1.75-1.25-1.65,1.65L3.477,5.627c-.072.137-.159.262-.219.408s-.087.3-.133.444L1,6.833V9.166l2.121.354a5.122,5.122,0,0,0,.354.854l-1.25,1.75,1.65,1.65,1.752-1.252c.137.072.262.159.408.22s.3.087.444.133L6.833,15H9.166l.354-2.121a5.121,5.121,0,0,0,.854-.354l1.75,1.25,1.65-1.65-1.252-1.752c.072-.137.159-.263.219-.409S12.83,9.669,12.876,9.521ZM8,10.212A2.212,2.212,0,1,1,10.212,8,2.212,2.212,0,0,1,8,10.212Z"/></g></svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<!--Copyright (c) Microsoft Corporation. All rights reserved.-->
|
|
2
|
+
<!--Copyright (C) 2018 TypeFox and others.-->
|
|
3
|
+
<!--Licensed under the MIT License. See License.txt in the project root for license information.-->
|
|
4
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.icon-canvas-transparent,.icon-vs-out{fill:#252526;}.icon-canvas-transparent{opacity:0;}.icon-vs-action-blue{fill:#75beff;}</style></defs><title>continue</title><g id="canvas"><path class="icon-canvas-transparent" d="M16,0V16H0V0Z"/></g><g id="outline" style="display: none;"><path class="icon-vs-out" d="M15.64,8l-7.8,6H2V2H7.84Z"/></g><g id="iconBg"><path class="icon-vs-action-blue" d="M3,3H5V13H3ZM7.5,3V13L14,8Z"/></g></svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<!--Copyright (c) Microsoft Corporation. All rights reserved.-->
|
|
2
|
+
<!--Copyright (C) 2018 TypeFox and others.-->
|
|
3
|
+
<!--Licensed under the MIT License. See License.txt in the project root for license information.-->
|
|
4
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.icon-canvas-transparent,.icon-vs-out{fill:#f6f6f6;}.icon-canvas-transparent{opacity:0;}.icon-vs-yellow{fill:#fc0;}.icon-vs-red{fill:#e51400;}</style></defs><title>current-and-breakpoint</title><g id="canvas"><path class="icon-canvas-transparent" d="M16,0V16H0V0Z"/></g><g id="outline" style="display: none;"><path class="icon-vs-out" d="M13.829,8,9.454,13H4V3H9.454Z"/></g><g id="iconBg"><path class="icon-vs-yellow" d="M12.5,8,9,12H5V4H9Z"/><path class="icon-vs-red" d="M10.5,8A2.5,2.5,0,1,1,8,5.5,2.5,2.5,0,0,1,10.5,8Z"/></g></svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<!--Copyright (c) Microsoft Corporation. All rights reserved.-->
|
|
2
|
+
<!--Copyright (C) 2018 TypeFox and others.-->
|
|
3
|
+
<!--Licensed under the MIT License. See License.txt in the project root for license information.-->
|
|
4
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.icon-canvas-transparent,.icon-vs-out{fill:#f6f6f6;}.icon-canvas-transparent{opacity:0;}.icon-vs-yellow{fill:#fc0;}</style></defs><title>current-arrow</title><g id="canvas"><path class="icon-canvas-transparent" d="M16,0V16H0V0Z"/></g><g id="outline" style="display: none;"><path class="icon-vs-out" d="M13.829,8,9.454,13H4V3H9.454Z"/></g><g id="iconBg"><path class="icon-vs-yellow" d="M12.5,8,9,12H5V4H9Z"/></g></svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<!--Copyright (c) Microsoft Corporation. All rights reserved.-->
|
|
2
|
+
<!--Copyright (C) 2018 TypeFox and others.-->
|
|
3
|
+
<!--Licensed under the MIT License. See License.txt in the project root for license information.-->
|
|
4
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.icon-canvas-transparent,.icon-vs-out{fill:#252526;}.icon-canvas-transparent{opacity:0;}.icon-vs-bg{fill:#c5c5c5;}</style></defs><title>remove-all</title><g id="canvas"><path class="icon-canvas-transparent" d="M16,0V16H0V0Z"/></g><g id="outline" style="display: none;"><path class="icon-vs-out" d="M16,1V12H14v2H12v2H0V5H2V3H4V1Z"/></g><g id="iconBg"><path class="icon-vs-bg" d="M15,2v9H14V3H5V2ZM3,5h9v8h1V4H3ZM1,6H11v9H1Zm4.116,4.5L3.058,12.558l.884.884L6,11.384l2.058,2.058.884-.884L6.884,10.5,8.942,8.442l-.884-.884L6,9.616,3.942,7.558l-.884.884Z"/></g></svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<!--Copyright (c) Microsoft Corporation. All rights reserved.-->
|
|
2
|
+
<!--Copyright (C) 2018 TypeFox and others.-->
|
|
3
|
+
<!--Licensed under the MIT License. See License.txt in the project root for license information.-->
|
|
4
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.icon-canvas-transparent,.icon-vs-out{fill:#f6f6f6;}.icon-canvas-transparent{opacity:0;}.icon-vs-bg{fill:#424242;}.icon-vs-fg{fill:#f0eff1;}</style></defs><title>remove-all_16x</title><g id="canvas"><path class="icon-canvas-transparent" d="M16,0V16H0V0Z"/></g><g id="outline"><path class="icon-vs-out" d="M16,1V12H14v2H12v2H0V5H2V3H4V1Z"/></g><g id="iconBg"><path class="icon-vs-bg" d="M3,4H13v9H12V5H3ZM1,15H11V6H1ZM5,2V3h9v8h1V2Z"/></g><g id="iconFg"><path class="icon-vs-fg" d="M6.75,10.75,9,13H7.5L6,11.5,4.5,13H3l2.25-2.25L3,8.5H4.5L6,10,7.5,8.5H9Z"/></g></svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<!--Copyright (c) Microsoft Corporation. All rights reserved.-->
|
|
2
|
+
<!--Copyright (C) 2018 TypeFox and others.-->
|
|
3
|
+
<!--Licensed under the MIT License. See License.txt in the project root for license information.-->
|
|
4
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.icon-canvas-transparent,.icon-vs-out{fill:#252526;}.icon-canvas-transparent{opacity:0;}.icon-vs-bg{fill:#c5c5c5;}</style></defs><title>repl</title><g id="canvas"><path class="icon-canvas-transparent" d="M16,0V16H0V0Z"/></g><g id="outline" style="display: none;"><path class="icon-vs-out" d="M16,2V14H0V2Z"/></g><g id="iconBg"><path id="iconBg-2" data-name="iconBg" class="icon-vs-bg" d="M1,3V13H15V3Zm13,9H2V4H14ZM7.5,8,4.875,10.75,4,9.833,5.75,8,4,6.167l.875-.917Z"/></g></svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<!--Copyright (c) Microsoft Corporation. All rights reserved.-->
|
|
2
|
+
<!--Copyright (C) 2018 TypeFox and others.-->
|
|
3
|
+
<!--Licensed under the MIT License. See License.txt in the project root for license information.-->
|
|
4
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.icon-canvas-transparent,.icon-vs-out{fill:#f6f6f6;}.icon-canvas-transparent{opacity:0;}.icon-vs-bg{fill:#424242;}</style></defs><title>repl</title><g id="canvas"><path class="icon-canvas-transparent" d="M16,0V16H0V0Z"/></g><g id="outline" style="display: none;"><path class="icon-vs-out" d="M16,2V14H0V2Z"/></g><g id="iconBg"><path id="iconBg-2" data-name="iconBg" class="icon-vs-bg" d="M1,3V13H15V3Zm13,9H2V4H14ZM7.5,8,4.875,10.75,4,9.833,5.75,8,4,6.167l.875-.917Z"/></g></svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<!--Copyright (c) Microsoft Corporation. All rights reserved.-->
|
|
2
|
+
<!--Copyright (C) 2018 TypeFox and others.-->
|
|
3
|
+
<!--Licensed under the MIT License. See License.txt in the project root for license information.-->
|
|
4
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><style>.st0{fill:#252526;fill-opacity:0}.st1{display:none}.st2{display:inline;fill:#252526}.st3{fill:#89d185}</style><title>restart</title><path class="st0" d="M16 0v16H0V0h16z" id="canvas"/><g id="outline" class="st1" style="display: none;"><path class="st2" d="M8.5 1C6.9 1 5.3 1.5 4 2.5V1H0v8h3.1L1 9.6l.3 1c1.1 4 5.3 6.3 9.3 5.2s6.3-5.3 5.2-9.3C14.8 3.2 11.9 1 8.5 1zm0 11c-1.6 0-2.9-1-3.4-2.5L5 9h3V5h.5C10.4 5 12 6.6 12 8.5S10.4 12 8.5 12z"/></g><path class="st3" d="M15 8c0 3.6-2.9 6.5-6.5 6.5-2.9 0-5.5-1.9-6.3-4.7l1.9-.5c.7 2.4 3.2 3.8 5.6 3.1 2.4-.7 3.8-3.2 3.1-5.6S9.7 3 7.3 3.7c-1 .3-1.9.9-2.5 1.8H7v2H1v-6h2v3.1c1.9-3 5.9-4 8.9-2.1C13.8 3.7 15 5.7 15 8z" id="iconBg"/></svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<!--Copyright (c) Microsoft Corporation. All rights reserved.-->
|
|
2
|
+
<!--Copyright (C) 2018 TypeFox and others.-->
|
|
3
|
+
<!--Licensed under the MIT License. See License.txt in the project root for license information.-->
|
|
4
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.icon-canvas-transparent,.icon-vs-out{fill:#f6f6f6;}.icon-canvas-transparent{opacity:0;}.cls-1{fill:#9cce9c;}.icon-vs-red{fill:#e51400;}</style></defs><title>stackframe-and-breakpoint</title><g id="canvas"><path class="icon-canvas-transparent" d="M16,0V16H0V0Z"/></g><g id="outline" style="display: none;"><path class="icon-vs-out" d="M13.829,8,9.454,13H4V3H9.454Z"/></g><g id="iconBg"><path class="cls-1" d="M12.5,8,9,12H5V4H9Z"/><path class="icon-vs-red" d="M10.5,8A2.5,2.5,0,1,1,8,5.5,2.5,2.5,0,0,1,10.5,8Z"/></g></svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<!--Copyright (c) Microsoft Corporation. All rights reserved.-->
|
|
2
|
+
<!--Copyright (C) 2018 TypeFox and others.-->
|
|
3
|
+
<!--Licensed under the MIT License. See License.txt in the project root for license information.-->
|
|
4
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.icon-canvas-transparent,.icon-vs-out{fill:#f6f6f6;}.icon-canvas-transparent{opacity:0;}.cls-1{fill:#9cce9c;}</style></defs><title>stackframe-arrow</title><g id="canvas"><path class="icon-canvas-transparent" d="M16,0V16H0V0Z"/></g><g id="outline" style="display: none;"><path class="icon-vs-out" d="M13.829,8,9.454,13H4V3H9.454Z"/></g><g id="iconBg"><path class="cls-1" d="M12.5,8,9,12H5V4H9Z"/></g></svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<!--Copyright (c) Microsoft Corporation. All rights reserved.-->
|
|
2
|
+
<!--Copyright (C) 2018 TypeFox and others.-->
|
|
3
|
+
<!--Licensed under the MIT License. See License.txt in the project root for license information.-->
|
|
4
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.icon-canvas-transparent,.icon-vs-out{fill:#252526;}.icon-canvas-transparent{opacity:0;}.icon-vs-action-green{fill:#89d185;}</style></defs><title>continue</title><g id="canvas"><path class="icon-canvas-transparent" d="M16,0V16H0V0Z"/></g><g id="outline" style="display: none;"><path class="icon-vs-out" d="M14.334,8,3.667,16H3V0h.667Z"/></g><g id="iconBg"><path class="icon-vs-action-green" d="M4,1.5v13L12.667,8,4,1.5Z"/></g></svg>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { localize } from '@opensumi/ide-core-browser';
|
|
2
|
+
|
|
3
|
+
import { IDebugBreakpoint } from '../../common';
|
|
4
|
+
|
|
5
|
+
import { isRuntimeBreakpoint } from './breakpoint-marker';
|
|
6
|
+
|
|
7
|
+
export interface IBreakpointDecoration {
|
|
8
|
+
readonly className: string;
|
|
9
|
+
readonly message: string[];
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export class DebugDecorator {
|
|
13
|
+
protected getDisabledBreakpointDecoration(breakpoint: IDebugBreakpoint): IBreakpointDecoration {
|
|
14
|
+
const decoration = this.getBreakpointDecoration(breakpoint);
|
|
15
|
+
return {
|
|
16
|
+
className: decoration.className + '-disabled',
|
|
17
|
+
message: [localize('debug.breakpoint.disabled') + decoration.message[0]],
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
protected getBreakpointDecoration(breakpoint: IDebugBreakpoint, message?: string[]): IBreakpointDecoration {
|
|
22
|
+
if (breakpoint.raw.logMessage) {
|
|
23
|
+
return {
|
|
24
|
+
className: 'sumi-debug-logpoint',
|
|
25
|
+
message: message || [localize('debug.breakpoint.logpointMessage')],
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
if (breakpoint.raw.condition || breakpoint.raw.hitCondition) {
|
|
29
|
+
return {
|
|
30
|
+
className: 'sumi-debug-conditional-breakpoint',
|
|
31
|
+
message: message || [localize('debug.breakpoint.conditionalMessage')],
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
className: 'sumi-debug-breakpoint',
|
|
36
|
+
message: message || [localize('debug.breakpoint.breakpointMessage')],
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
protected getUnverifiedBreakpointDecoration(breakpoint: IDebugBreakpoint): IBreakpointDecoration {
|
|
41
|
+
const decoration = this.getBreakpointDecoration(breakpoint);
|
|
42
|
+
return {
|
|
43
|
+
className: decoration.className + '-unverified',
|
|
44
|
+
message: [breakpoint.message || localize('debug.breakpoint.unverified') + decoration.message[0]],
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
getDecoration(breakpoint: IDebugBreakpoint, isDebugMode = false, enabled = true): IBreakpointDecoration {
|
|
49
|
+
if (!breakpoint.enabled || !enabled) {
|
|
50
|
+
return this.getDisabledBreakpointDecoration(breakpoint);
|
|
51
|
+
}
|
|
52
|
+
if (isDebugMode && !isRuntimeBreakpoint(breakpoint)) {
|
|
53
|
+
return this.getUnverifiedBreakpointDecoration(breakpoint);
|
|
54
|
+
}
|
|
55
|
+
return this.getBreakpointDecoration(breakpoint);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
import { Injectable, Autowired } from '@opensumi/di';
|
|
2
|
+
import {
|
|
3
|
+
Emitter,
|
|
4
|
+
Event,
|
|
5
|
+
URI,
|
|
6
|
+
isUndefined,
|
|
7
|
+
StorageProvider,
|
|
8
|
+
IStorage,
|
|
9
|
+
STORAGE_NAMESPACE,
|
|
10
|
+
IReporterService,
|
|
11
|
+
} from '@opensumi/ide-core-browser';
|
|
12
|
+
import { Deferred } from '@opensumi/ide-core-common';
|
|
13
|
+
import * as monaco from '@opensumi/monaco-editor-core/esm/vs/editor/editor.api';
|
|
14
|
+
import { DebugProtocol } from '@opensumi/vscode-debugprotocol';
|
|
15
|
+
|
|
16
|
+
import { BreakpointsChangeEvent, DEBUG_REPORT_NAME, IDebugBreakpoint } from '../../common';
|
|
17
|
+
import { DebugModel } from '../editor';
|
|
18
|
+
import { MarkerManager, Marker } from '../markers';
|
|
19
|
+
|
|
20
|
+
import { DebugExceptionBreakpoint, BREAKPOINT_KIND } from './breakpoint-marker';
|
|
21
|
+
|
|
22
|
+
export interface ExceptionBreakpointsChangeEvent {
|
|
23
|
+
filters: string[];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface SelectedBreakpoint {
|
|
27
|
+
breakpoint?: IDebugBreakpoint;
|
|
28
|
+
model: DebugModel;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@Injectable()
|
|
32
|
+
export class BreakpointManager extends MarkerManager<IDebugBreakpoint> {
|
|
33
|
+
protected readonly owner = 'breakpoint';
|
|
34
|
+
private _selectedBreakpoint: SelectedBreakpoint;
|
|
35
|
+
|
|
36
|
+
private defaultExceptionFilter: DebugProtocol.ExceptionBreakpointsFilter[] = [];
|
|
37
|
+
private exceptionFilterValue: { [key: string]: boolean } | undefined;
|
|
38
|
+
private _affected = new Set<string>();
|
|
39
|
+
|
|
40
|
+
@Autowired(StorageProvider)
|
|
41
|
+
private readonly storageProvider: StorageProvider;
|
|
42
|
+
|
|
43
|
+
@Autowired(IReporterService)
|
|
44
|
+
private readonly reporterService: IReporterService;
|
|
45
|
+
|
|
46
|
+
getKind(): string {
|
|
47
|
+
return BREAKPOINT_KIND;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
get selectedBreakpoint() {
|
|
51
|
+
return this._selectedBreakpoint;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
set selectedBreakpoint(value: SelectedBreakpoint) {
|
|
55
|
+
this._selectedBreakpoint = value;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
get affected() {
|
|
59
|
+
return Array.from(this._affected.values());
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
protected breakpointsDeffered: Deferred<void> | null = null;
|
|
63
|
+
|
|
64
|
+
protected readonly onDidChangeBreakpointsEmitter = new Emitter<BreakpointsChangeEvent>();
|
|
65
|
+
readonly onDidChangeBreakpoints: Event<BreakpointsChangeEvent> = this.onDidChangeBreakpointsEmitter.event;
|
|
66
|
+
protected readonly onDidChangeExceptionsBreakpointsEmitter = new Emitter<ExceptionBreakpointsChangeEvent>();
|
|
67
|
+
readonly onDidChangeExceptionsBreakpoints: Event<ExceptionBreakpointsChangeEvent> =
|
|
68
|
+
this.onDidChangeExceptionsBreakpointsEmitter.event;
|
|
69
|
+
|
|
70
|
+
public setBpDeffered(): this {
|
|
71
|
+
this.breakpointsDeffered = new Deferred();
|
|
72
|
+
return this;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
public resolveBpDeffered(): void {
|
|
76
|
+
if (this.breakpointsDeffered) {
|
|
77
|
+
this.breakpointsDeffered.resolve();
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
public promiseBpDeffered(): Promise<void> {
|
|
82
|
+
if (this.breakpointsDeffered) {
|
|
83
|
+
return this.breakpointsDeffered.promise;
|
|
84
|
+
} else {
|
|
85
|
+
return Promise.resolve();
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
setMarkers(uri: URI, owner: string, newMarkers: IDebugBreakpoint[]): Marker<IDebugBreakpoint>[] {
|
|
90
|
+
const result = super.setMarkers(uri, owner, newMarkers);
|
|
91
|
+
const added: IDebugBreakpoint[] = [];
|
|
92
|
+
const removed: IDebugBreakpoint[] = [];
|
|
93
|
+
const changed: IDebugBreakpoint[] = [];
|
|
94
|
+
const oldMarkers = new Map(result.map(({ data }) => [data.id, data] as [string, IDebugBreakpoint]));
|
|
95
|
+
const ids = new Set<string>();
|
|
96
|
+
|
|
97
|
+
for (const newMarker of newMarkers) {
|
|
98
|
+
ids.add(newMarker.id);
|
|
99
|
+
if (oldMarkers.has(newMarker.id)) {
|
|
100
|
+
changed.push(newMarker);
|
|
101
|
+
} else {
|
|
102
|
+
added.push(newMarker);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
for (const [id, data] of oldMarkers.entries()) {
|
|
106
|
+
if (!ids.has(id)) {
|
|
107
|
+
removed.push(data);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
this.onDidChangeBreakpointsEmitter.fire({ affected: [uri], added, removed, changed });
|
|
111
|
+
return result;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
getBreakpoint(uri: URI, filter: number | Partial<monaco.IPosition> | undefined): IDebugBreakpoint | undefined {
|
|
115
|
+
if (typeof filter === 'number') {
|
|
116
|
+
filter = { lineNumber: filter };
|
|
117
|
+
}
|
|
118
|
+
return this.getBreakpoints(uri, filter)[0];
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
getBreakpoints(uri?: URI, filter?: Partial<monaco.IPosition>): IDebugBreakpoint[] {
|
|
122
|
+
let dataFilter: ((breakpoint: IDebugBreakpoint) => boolean) | undefined;
|
|
123
|
+
if (filter) {
|
|
124
|
+
dataFilter = (breakpoint: IDebugBreakpoint) => {
|
|
125
|
+
if (
|
|
126
|
+
(filter.lineNumber && breakpoint.raw.line !== filter.lineNumber) ||
|
|
127
|
+
(filter.column && breakpoint.raw.column !== filter.column)
|
|
128
|
+
) {
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
return true;
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
return this.findMarkers({
|
|
135
|
+
uri,
|
|
136
|
+
dataFilter,
|
|
137
|
+
}).map((marker) => marker.data);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
setBreakpoints(uri: URI, breakpoints: IDebugBreakpoint[]): void {
|
|
141
|
+
if (breakpoints.length > 0) {
|
|
142
|
+
this._affected.add(uri.toString());
|
|
143
|
+
} else {
|
|
144
|
+
this._affected.delete(uri.toString());
|
|
145
|
+
}
|
|
146
|
+
this.setMarkers(
|
|
147
|
+
uri,
|
|
148
|
+
this.owner,
|
|
149
|
+
breakpoints.sort((a, b) => a.raw.line - b.raw.line),
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
addBreakpoint(breakpoint: IDebugBreakpoint): boolean {
|
|
154
|
+
const uri = new URI(breakpoint.uri);
|
|
155
|
+
const breakpoints = this.getBreakpoints(uri);
|
|
156
|
+
const existed = breakpoints.find(
|
|
157
|
+
({ raw }) => raw.line === breakpoint.raw.line && raw.column === breakpoint.raw.column,
|
|
158
|
+
);
|
|
159
|
+
this.reporterService.point(DEBUG_REPORT_NAME?.DEBUG_BREAKPOINT, 'add');
|
|
160
|
+
if (!existed) {
|
|
161
|
+
this.setBreakpoints(uri, [...breakpoints, breakpoint]);
|
|
162
|
+
return true;
|
|
163
|
+
}
|
|
164
|
+
return false;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
delBreakpoint(breakpoint: IDebugBreakpoint): boolean {
|
|
168
|
+
const uri = URI.parse(breakpoint.uri);
|
|
169
|
+
const breakpoints = this.getBreakpoints(uri);
|
|
170
|
+
const index = breakpoints.findIndex((bp) => bp.id === breakpoint.id);
|
|
171
|
+
if (index > -1) {
|
|
172
|
+
breakpoints.splice(index, 1);
|
|
173
|
+
this.setBreakpoints(uri, ([] as IDebugBreakpoint[]).concat(breakpoints));
|
|
174
|
+
return true;
|
|
175
|
+
}
|
|
176
|
+
return false;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
clearBreakpoints() {
|
|
180
|
+
const affected = new Set<string>();
|
|
181
|
+
const breakpoints = this.getBreakpoints();
|
|
182
|
+
breakpoints.map((b) => affected.add(b.uri));
|
|
183
|
+
this.cleanAllMarkers();
|
|
184
|
+
this._affected.clear();
|
|
185
|
+
this.onDidChangeBreakpointsEmitter.fire({
|
|
186
|
+
affected: Array.from(affected.values()).map((str) => URI.parse(str)),
|
|
187
|
+
added: [],
|
|
188
|
+
removed: breakpoints,
|
|
189
|
+
changed: [],
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
updateBreakpoint(breakpoint: IDebugBreakpoint, statusUpdated = false) {
|
|
194
|
+
const uri = URI.parse(breakpoint.uri);
|
|
195
|
+
this.onDidChangeBreakpointsEmitter.fire({
|
|
196
|
+
affected: [uri],
|
|
197
|
+
added: [],
|
|
198
|
+
removed: [],
|
|
199
|
+
changed: [breakpoint],
|
|
200
|
+
statusUpdated,
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
updateBreakpoints(breakpoints: IDebugBreakpoint[], statusUpdated = false) {
|
|
205
|
+
const uriStrings = new Set<string>();
|
|
206
|
+
breakpoints.forEach((breakpoint) => {
|
|
207
|
+
uriStrings.add(breakpoint.uri);
|
|
208
|
+
});
|
|
209
|
+
this.onDidChangeBreakpointsEmitter.fire({
|
|
210
|
+
affected: Array.from(uriStrings.values()).map((v) => URI.parse(v)),
|
|
211
|
+
added: [],
|
|
212
|
+
removed: [],
|
|
213
|
+
changed: breakpoints,
|
|
214
|
+
statusUpdated,
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
enableAllBreakpoints(enabled: boolean): void {
|
|
219
|
+
for (const uriString of this.getUris()) {
|
|
220
|
+
let didChange = false;
|
|
221
|
+
const uri = new URI(uriString);
|
|
222
|
+
const markers = this.findMarkers({ uri });
|
|
223
|
+
for (const marker of markers) {
|
|
224
|
+
if (marker.data.enabled !== enabled) {
|
|
225
|
+
marker.data.enabled = enabled;
|
|
226
|
+
didChange = true;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
if (didChange) {
|
|
230
|
+
this.fireOnDidChangeMarkers(uri);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
protected _breakpointsEnabled = true;
|
|
236
|
+
get breakpointsEnabled(): boolean {
|
|
237
|
+
return this._breakpointsEnabled;
|
|
238
|
+
}
|
|
239
|
+
set breakpointsEnabled(breakpointsEnabled: boolean) {
|
|
240
|
+
if (this._breakpointsEnabled !== breakpointsEnabled) {
|
|
241
|
+
this._breakpointsEnabled = breakpointsEnabled;
|
|
242
|
+
for (const uri of this.getUris()) {
|
|
243
|
+
this.fireOnDidChangeMarkers(new URI(uri));
|
|
244
|
+
}
|
|
245
|
+
this.updateBreakpoints(this.getBreakpoints());
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
async load(): Promise<void> {
|
|
250
|
+
const storage: IStorage = await this.storageProvider(STORAGE_NAMESPACE.DEBUG);
|
|
251
|
+
const data = storage.get<BreakpointManager.Data>('breakpoints', {
|
|
252
|
+
breakpointsEnabled: true,
|
|
253
|
+
breakpoints: {},
|
|
254
|
+
defaultExceptionFilter: [],
|
|
255
|
+
});
|
|
256
|
+
this._breakpointsEnabled = data!.breakpointsEnabled;
|
|
257
|
+
// eslint-disable-next-line guard-for-in
|
|
258
|
+
for (const uri in data!.breakpoints) {
|
|
259
|
+
this.setBreakpoints(
|
|
260
|
+
new URI(uri),
|
|
261
|
+
data!.breakpoints[uri].map((v) => Object.assign(v, { status: new Map() })),
|
|
262
|
+
);
|
|
263
|
+
}
|
|
264
|
+
this.defaultExceptionFilter = data.defaultExceptionFilter || [];
|
|
265
|
+
this.exceptionFilterValue = {};
|
|
266
|
+
this.defaultExceptionFilter.forEach((item) => {
|
|
267
|
+
this.exceptionFilterValue![item.filter] = !!item.default;
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
async save(): Promise<void> {
|
|
272
|
+
const data: BreakpointManager.Data = {
|
|
273
|
+
breakpointsEnabled: this.breakpointsEnabled,
|
|
274
|
+
breakpoints: {},
|
|
275
|
+
defaultExceptionFilter: this.defaultExceptionFilter,
|
|
276
|
+
};
|
|
277
|
+
const uris = this.getUris();
|
|
278
|
+
for (const uri of uris) {
|
|
279
|
+
data.breakpoints[uri] = this.findMarkers({ uri: new URI(uri) }).map((marker) => marker.data);
|
|
280
|
+
}
|
|
281
|
+
const storage: IStorage = await this.storageProvider(STORAGE_NAMESPACE.DEBUG);
|
|
282
|
+
await storage.set('breakpoints', data);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
clearAllStatus(sessionId: string) {
|
|
286
|
+
const breakpoints = this.getBreakpoints();
|
|
287
|
+
breakpoints.forEach((breakpoint) => {
|
|
288
|
+
breakpoint.status.delete(sessionId);
|
|
289
|
+
});
|
|
290
|
+
this.updateBreakpoints(breakpoints);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* 设置异常断点元信息
|
|
295
|
+
* @param session
|
|
296
|
+
* @param filter
|
|
297
|
+
*/
|
|
298
|
+
setExceptionBreakpoints(filters: DebugProtocol.ExceptionBreakpointsFilter[]) {
|
|
299
|
+
this.defaultExceptionFilter = filters;
|
|
300
|
+
for (const item of filters) {
|
|
301
|
+
if (!isUndefined(this.exceptionFilterValue)) {
|
|
302
|
+
this.updateExceptionBreakpoints(
|
|
303
|
+
item.filter,
|
|
304
|
+
isUndefined(this.exceptionFilterValue[item.filter]) ? !!item.default : this.exceptionFilterValue[item.filter],
|
|
305
|
+
);
|
|
306
|
+
} else {
|
|
307
|
+
this.updateExceptionBreakpoints(item.filter, !!item.default);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* 获取异常断点元信息
|
|
314
|
+
* @param session
|
|
315
|
+
*/
|
|
316
|
+
getExceptionBreakpoints(): DebugExceptionBreakpoint[] {
|
|
317
|
+
return this.defaultExceptionFilter.map((breakpoint) => ({
|
|
318
|
+
...breakpoint,
|
|
319
|
+
default: (this.exceptionFilterValue || {})[breakpoint.filter] || false,
|
|
320
|
+
}));
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* 通知DebugSession更新Exception配置
|
|
325
|
+
* @param exceptionBreakpoints
|
|
326
|
+
*/
|
|
327
|
+
updateExceptionBreakpoints(filter: string, value: boolean) {
|
|
328
|
+
if (isUndefined(this.exceptionFilterValue)) {
|
|
329
|
+
this.exceptionFilterValue = {};
|
|
330
|
+
}
|
|
331
|
+
this.exceptionFilterValue[filter] = value;
|
|
332
|
+
|
|
333
|
+
const filters = this.defaultExceptionFilter
|
|
334
|
+
.filter((exp) => (this.exceptionFilterValue || {})[exp.filter])
|
|
335
|
+
.map((exp) => exp.filter);
|
|
336
|
+
this.onDidChangeExceptionsBreakpointsEmitter.fire({ filters });
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
export namespace BreakpointManager {
|
|
341
|
+
export interface Data {
|
|
342
|
+
breakpointsEnabled: boolean;
|
|
343
|
+
breakpoints: {
|
|
344
|
+
[uri: string]: IDebugBreakpoint[];
|
|
345
|
+
};
|
|
346
|
+
defaultExceptionFilter: DebugExceptionBreakpoint[];
|
|
347
|
+
}
|
|
348
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import btoa = require('btoa');
|
|
2
|
+
|
|
3
|
+
import { URI } from '@opensumi/ide-core-common';
|
|
4
|
+
import { DebugProtocol } from '@opensumi/vscode-debugprotocol/lib/debugProtocol';
|
|
5
|
+
|
|
6
|
+
import { IRuntimeBreakpoint, IDebugBreakpoint } from '../../common';
|
|
7
|
+
import { Marker } from '../markers';
|
|
8
|
+
|
|
9
|
+
export const BREAKPOINT_KIND = 'breakpoint';
|
|
10
|
+
|
|
11
|
+
function generateId(uri: string, line: number, column = 1) {
|
|
12
|
+
return btoa(`${uri}:${line}:${column}`);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export namespace DebugBreakpoint {
|
|
16
|
+
export function create(uri: URI, data: DebugProtocol.SourceBreakpoint, enabled = true): IDebugBreakpoint {
|
|
17
|
+
return {
|
|
18
|
+
id: generateId(uri.toString(), data.line, data.column),
|
|
19
|
+
uri: uri.toString(),
|
|
20
|
+
enabled,
|
|
21
|
+
status: new Map<string, DebugProtocol.Breakpoint>(),
|
|
22
|
+
raw: {
|
|
23
|
+
column: undefined,
|
|
24
|
+
condition: undefined,
|
|
25
|
+
hitCondition: undefined,
|
|
26
|
+
logMessage: undefined,
|
|
27
|
+
...data,
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface IExceptionBreakpoint {
|
|
34
|
+
label: string;
|
|
35
|
+
filter: string;
|
|
36
|
+
default?: boolean;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export type DebugExceptionBreakpoint = IExceptionBreakpoint;
|
|
40
|
+
|
|
41
|
+
export function isDebugBreakpoint(
|
|
42
|
+
breakpoint: IDebugBreakpoint | DebugExceptionBreakpoint,
|
|
43
|
+
): breakpoint is IDebugBreakpoint {
|
|
44
|
+
return !!breakpoint && !!(breakpoint as IDebugBreakpoint).raw;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function getStatus(breakpoint: IRuntimeBreakpoint) {
|
|
48
|
+
return Array.from(breakpoint.status.values()).filter((b) => b.verified)[0];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function isRuntimeBreakpoint(breakpoint: IDebugBreakpoint): breakpoint is IRuntimeBreakpoint {
|
|
52
|
+
const status = getStatus(breakpoint);
|
|
53
|
+
return !!(status && status.verified);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function isDebugExceptionBreakpoint(
|
|
57
|
+
breakpoint: IDebugBreakpoint | DebugExceptionBreakpoint,
|
|
58
|
+
): breakpoint is DebugExceptionBreakpoint {
|
|
59
|
+
return breakpoint && !!(breakpoint as DebugExceptionBreakpoint).filter;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface BreakpointMarker extends Marker<IDebugBreakpoint> {
|
|
63
|
+
kind: 'breakpoint';
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export namespace BreakpointMarker {
|
|
67
|
+
export function is(node: Marker<object>): node is BreakpointMarker {
|
|
68
|
+
return 'kind' in node && node.kind === BREAKPOINT_KIND;
|
|
69
|
+
}
|
|
70
|
+
}
|