@opensumi/ide-debug 2.21.7-rc-1670246007.0 → 2.21.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. package/lib/browser/debug-session.d.ts.map +1 -1
  2. package/lib/browser/debug-session.js +1 -5
  3. package/lib/browser/debug-session.js.map +1 -1
  4. package/lib/browser/index.d.ts.map +1 -1
  5. package/lib/browser/index.js +9 -2
  6. package/lib/browser/index.js.map +1 -1
  7. package/lib/browser/preferences/launch-folder-preference-provider.d.ts +2 -2
  8. package/lib/browser/preferences/launch-folder-preference-provider.d.ts.map +1 -1
  9. package/lib/browser/preferences/launch-folder-preference-provider.js +2 -2
  10. package/lib/browser/preferences/launch-folder-preference-provider.js.map +1 -1
  11. package/lib/browser/view/configuration/debug-configuration.module.less +5 -5
  12. package/lib/browser/view/configuration/debug-configuration.view.d.ts.map +1 -1
  13. package/lib/browser/view/configuration/debug-configuration.view.js +1 -1
  14. package/lib/browser/view/configuration/debug-configuration.view.js.map +1 -1
  15. package/lib/browser/view/configuration/debug-toolbar.view.js +2 -2
  16. package/lib/browser/view/configuration/debug-toolbar.view.js.map +1 -1
  17. package/lib/browser/view/console/debug-console.module.less +1 -2
  18. package/lib/browser/view/console/debug-console.view.js +2 -2
  19. package/lib/browser/view/console/debug-console.view.js.map +1 -1
  20. package/lib/browser/view/variables/debug-variables.module.less +1 -2
  21. package/lib/browser/view/variables/debug-variables.view.js +1 -1
  22. package/lib/browser/view/variables/debug-variables.view.js.map +1 -1
  23. package/lib/browser/view/watch/debug-watch.module.less +1 -2
  24. package/lib/browser/view/watch/debug-watch.view.js +1 -1
  25. package/lib/browser/view/watch/debug-watch.view.js.map +1 -1
  26. package/package.json +24 -25
  27. package/src/browser/assets/breakpoint-conditional-disabled.svg +0 -4
  28. package/src/browser/assets/breakpoint-conditional-unverified.svg +0 -4
  29. package/src/browser/assets/breakpoint-conditional.svg +0 -4
  30. package/src/browser/assets/breakpoint-disabled.svg +0 -4
  31. package/src/browser/assets/breakpoint-hint.svg +0 -4
  32. package/src/browser/assets/breakpoint-log-disabled.svg +0 -4
  33. package/src/browser/assets/breakpoint-log-unverified.svg +0 -4
  34. package/src/browser/assets/breakpoint-log.svg +0 -4
  35. package/src/browser/assets/breakpoint-unsupported.svg +0 -4
  36. package/src/browser/assets/breakpoint-unverified.svg +0 -4
  37. package/src/browser/assets/breakpoint.svg +0 -4
  38. package/src/browser/assets/breakpoints-activate-inverse.svg +0 -4
  39. package/src/browser/assets/breakpoints-activate.svg +0 -4
  40. package/src/browser/assets/configure-inverse.svg +0 -4
  41. package/src/browser/assets/configure.svg +0 -4
  42. package/src/browser/assets/continue-inverse.svg +0 -4
  43. package/src/browser/assets/current-and-breakpoint.svg +0 -4
  44. package/src/browser/assets/current-arrow.svg +0 -4
  45. package/src/browser/assets/remove-all-inverse.svg +0 -4
  46. package/src/browser/assets/remove-all.svg +0 -4
  47. package/src/browser/assets/repl-inverse.svg +0 -4
  48. package/src/browser/assets/repl.svg +0 -4
  49. package/src/browser/assets/restart-inverse.svg +0 -4
  50. package/src/browser/assets/stackframe-and-breakpoint.svg +0 -4
  51. package/src/browser/assets/stackframe-arrow.svg +0 -4
  52. package/src/browser/assets/start-inverse.svg +0 -4
  53. package/src/browser/breakpoint/breakpoint-decoration.ts +0 -57
  54. package/src/browser/breakpoint/breakpoint-manager.ts +0 -348
  55. package/src/browser/breakpoint/breakpoint-marker.ts +0 -70
  56. package/src/browser/breakpoint/index.ts +0 -3
  57. package/src/browser/components/debug-action/index.module.less +0 -73
  58. package/src/browser/components/debug-action/index.tsx +0 -40
  59. package/src/browser/components/debug-exception-widget.less +0 -42
  60. package/src/browser/components/floating-click-widget/index.module.less +0 -5
  61. package/src/browser/components/floating-click-widget/index.tsx +0 -21
  62. package/src/browser/components/index.ts +0 -1
  63. package/src/browser/contextkeys/debug-call-stack-item-type-key.ts +0 -4
  64. package/src/browser/contextkeys/debug-contextkey.service.ts +0 -54
  65. package/src/browser/contextkeys/index.ts +0 -1
  66. package/src/browser/debug-ansi-handle.ts +0 -521
  67. package/src/browser/debug-configuration-manager.ts +0 -513
  68. package/src/browser/debug-configuration-model.ts +0 -66
  69. package/src/browser/debug-contribution.ts +0 -904
  70. package/src/browser/debug-exception-widget.tsx +0 -89
  71. package/src/browser/debug-link-detector.ts +0 -234
  72. package/src/browser/debug-memory.ts +0 -220
  73. package/src/browser/debug-preferences.ts +0 -70
  74. package/src/browser/debug-progress.service.ts +0 -122
  75. package/src/browser/debug-schema-updater.ts +0 -67
  76. package/src/browser/debug-service.ts +0 -42
  77. package/src/browser/debug-session-connection.ts +0 -333
  78. package/src/browser/debug-session-contribution.ts +0 -57
  79. package/src/browser/debug-session-manager.ts +0 -622
  80. package/src/browser/debug-session.ts +0 -1182
  81. package/src/browser/debug-style.less +0 -128
  82. package/src/browser/debugUtils.ts +0 -110
  83. package/src/browser/editor/debug-breakpoint-widget.ts +0 -99
  84. package/src/browser/editor/debug-breakpoint-zone-widget.tsx +0 -262
  85. package/src/browser/editor/debug-breakpoint.module.less +0 -31
  86. package/src/browser/editor/debug-editor-contribution.ts +0 -590
  87. package/src/browser/editor/debug-expression-provider.ts +0 -101
  88. package/src/browser/editor/debug-hover-model.ts +0 -38
  89. package/src/browser/editor/debug-hover-source.ts +0 -107
  90. package/src/browser/editor/debug-hover-tree.model.service.ts +0 -332
  91. package/src/browser/editor/debug-hover-widget.tsx +0 -200
  92. package/src/browser/editor/debug-hover.module.less +0 -29
  93. package/src/browser/editor/debug-hover.view.tsx +0 -147
  94. package/src/browser/editor/debug-model-manager.ts +0 -220
  95. package/src/browser/editor/debug-model.ts +0 -853
  96. package/src/browser/editor/debug-run-to-cursor.service.ts +0 -180
  97. package/src/browser/editor/debug-styles.ts +0 -66
  98. package/src/browser/editor/evaluatable-expression.ts +0 -47
  99. package/src/browser/editor/index.ts +0 -6
  100. package/src/browser/index.ts +0 -121
  101. package/src/browser/markers/index.ts +0 -2
  102. package/src/browser/markers/marker-manager.ts +0 -201
  103. package/src/browser/markers/marker.ts +0 -20
  104. package/src/browser/model/debug-source.ts +0 -144
  105. package/src/browser/model/debug-stack-frame.ts +0 -111
  106. package/src/browser/model/debug-thread.ts +0 -186
  107. package/src/browser/model/debug-watch.ts +0 -130
  108. package/src/browser/model/index.ts +0 -4
  109. package/src/browser/preferences/launch-folder-preference-provider.ts +0 -23
  110. package/src/browser/preferences/launch-preferences-contribution.ts +0 -9
  111. package/src/browser/preferences/launch-preferences.ts +0 -16
  112. package/src/browser/tree/debug-console-tree-node.define.tsx +0 -76
  113. package/src/browser/tree/debug-tree-node.define.ts +0 -768
  114. package/src/browser/tree/index.ts +0 -2
  115. package/src/browser/view/breakpoints/debug-breakpoints.module.less +0 -72
  116. package/src/browser/view/breakpoints/debug-breakpoints.service.ts +0 -217
  117. package/src/browser/view/breakpoints/debug-breakpoints.view.tsx +0 -174
  118. package/src/browser/view/configuration/debug-configuration.module.less +0 -110
  119. package/src/browser/view/configuration/debug-configuration.service.ts +0 -170
  120. package/src/browser/view/configuration/debug-configuration.view.tsx +0 -252
  121. package/src/browser/view/configuration/debug-toolbar.service.ts +0 -167
  122. package/src/browser/view/configuration/debug-toolbar.view.tsx +0 -335
  123. package/src/browser/view/console/debug-console-filter.model.ts +0 -49
  124. package/src/browser/view/console/debug-console-filter.service.ts +0 -81
  125. package/src/browser/view/console/debug-console-filter.view.tsx +0 -78
  126. package/src/browser/view/console/debug-console-model.ts +0 -48
  127. package/src/browser/view/console/debug-console-session.ts +0 -164
  128. package/src/browser/view/console/debug-console-toolbar.view.tsx +0 -28
  129. package/src/browser/view/console/debug-console-tree.model.service.ts +0 -550
  130. package/src/browser/view/console/debug-console.contribution.ts +0 -181
  131. package/src/browser/view/console/debug-console.module.less +0 -373
  132. package/src/browser/view/console/debug-console.service.ts +0 -433
  133. package/src/browser/view/console/debug-console.view.tsx +0 -500
  134. package/src/browser/view/debug-view-model.ts +0 -182
  135. package/src/browser/view/frames/debug-call-stack-frame.view.tsx +0 -224
  136. package/src/browser/view/frames/debug-call-stack-session.view.tsx +0 -244
  137. package/src/browser/view/frames/debug-call-stack-thread.view.tsx +0 -93
  138. package/src/browser/view/frames/debug-call-stack.contribution.ts +0 -88
  139. package/src/browser/view/frames/debug-call-stack.module.less +0 -193
  140. package/src/browser/view/frames/debug-call-stack.operation.tsx +0 -97
  141. package/src/browser/view/frames/debug-call-stack.service.ts +0 -105
  142. package/src/browser/view/frames/debug-call-stack.view.tsx +0 -43
  143. package/src/browser/view/variables/debug-variables-model.ts +0 -38
  144. package/src/browser/view/variables/debug-variables-tree.model.service.ts +0 -467
  145. package/src/browser/view/variables/debug-variables.contribution.ts +0 -244
  146. package/src/browser/view/variables/debug-variables.module.less +0 -149
  147. package/src/browser/view/variables/debug-variables.view.tsx +0 -303
  148. package/src/browser/view/watch/debug-watch-model.ts +0 -38
  149. package/src/browser/view/watch/debug-watch-tree.model.service.ts +0 -567
  150. package/src/browser/view/watch/debug-watch.contribution.ts +0 -167
  151. package/src/browser/view/watch/debug-watch.module.less +0 -189
  152. package/src/browser/view/watch/debug-watch.view.tsx +0 -337
  153. package/src/common/constants.ts +0 -81
  154. package/src/common/debug-breakpoint.ts +0 -43
  155. package/src/common/debug-configuration.ts +0 -68
  156. package/src/common/debug-editor.ts +0 -4
  157. package/src/common/debug-hover.ts +0 -31
  158. package/src/common/debug-model.ts +0 -247
  159. package/src/common/debug-progress.ts +0 -8
  160. package/src/common/debug-schema-updater.ts +0 -1
  161. package/src/common/debug-service.ts +0 -176
  162. package/src/common/debug-session-options.ts +0 -19
  163. package/src/common/debug-session.ts +0 -200
  164. package/src/common/evaluatable-expression.ts +0 -43
  165. package/src/common/index.ts +0 -14
  166. package/src/common/inline-values.ts +0 -77
  167. package/src/common/terminal.ts +0 -163
  168. package/src/common/types.ts +0 -86
  169. package/src/index.ts +0 -1
@@ -1,81 +0,0 @@
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);
@@ -1,43 +0,0 @@
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;
@@ -1,68 +0,0 @@
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__';
@@ -1,4 +0,0 @@
1
- // eslint-disable-next-line import/no-restricted-paths
2
- import type { ICodeEditor as IMonacoCodeEditor } from '@opensumi/ide-monaco/lib/browser/monaco-api/types';
3
- export const DebugEditor = Symbol('DebugEditor');
4
- export type DebugEditor = IMonacoCodeEditor;
@@ -1,31 +0,0 @@
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
- }
@@ -1,247 +0,0 @@
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
- } from '@opensumi/ide-core-common';
15
- import type { editor } from '@opensumi/monaco-editor-core';
16
- import * as monaco from '@opensumi/monaco-editor-core/esm/vs/editor/editor.api';
17
-
18
- import {
19
- IRuntimeBreakpoint,
20
- ISourceBreakpoint,
21
- DebugBreakpointWidgetContext,
22
- TSourceBrekpointProperties,
23
- } from './debug-breakpoint';
24
- import { DebugConfiguration } from './debug-configuration';
25
- import { DebugEditor } from './debug-editor';
26
- import { IDebugHoverWidget } from './debug-hover';
27
- import { IMemoryInvalidationEvent, IMemoryRegion, MemoryRange, MemoryRangeType } from './debug-service';
28
- import { IDebugSession } from './debug-session';
29
-
30
- export interface IDebugBreakpointWidget extends IDisposable {
31
- position: monaco.Position | undefined;
32
- }
33
-
34
- export interface IDebugBreakpointWidget extends IDisposable {
35
- position: monaco.Position | undefined;
36
- }
37
-
38
- export const DebugAdapterSession = Symbol('DebugAdapterSession');
39
-
40
- export interface DebugAdapterSession {
41
- id: string;
42
- start(channel: any): Promise<void>;
43
- stop(): Promise<void>;
44
- }
45
-
46
- export const DebugAdapterSessionFactory = Symbol('DebugAdapterSessionFactory');
47
-
48
- export interface DebugAdapterSessionFactory {
49
- get(sessionId: string, communicationProvider: DebugStreamConnection): DebugAdapterSession;
50
- }
51
-
52
- export interface DebugAdapterSpawnExecutable {
53
- command: string;
54
- args?: string[];
55
- }
56
-
57
- export interface DebugAdapterForkExecutable {
58
- modulePath: string;
59
- args?: string[];
60
- }
61
-
62
- /**
63
- * 可执行的调试适配器类型
64
- * 用于实例化调试适配器的参数
65
- *
66
- * 在Launch适配器进程的情况下,参数包含命令和参数。例如:
67
- * {'command' : 'COMMAND_TO_LAUNCH_DEBUG_ADAPTER', args : [ { 'arg1', 'arg2' } ] }
68
- *
69
- * 在Fork适配器进程的情况下,包含要转换的modulePath。例如:
70
- * {'modulePath' : 'NODE_COMMAND_TO_LAUNCH_DEBUG_ADAPTER', args : [ { 'arg1', 'arg2' } ] }
71
- */
72
- export type DebugAdapterExecutable = DebugAdapterSpawnExecutable | DebugAdapterForkExecutable;
73
-
74
- /**
75
- * 与调试进程的通讯渠道
76
- */
77
- export interface DebugStreamConnection extends IDisposable {
78
- output: stream.Readable;
79
- input: stream.Writable;
80
- }
81
-
82
- export const DebugAdapterFactory = Symbol('DebugAdapterFactory');
83
-
84
- export interface DebugAdapterFactory {
85
- start(executable: DebugAdapterExecutable): DebugStreamConnection;
86
- connect(debugServerPort: number): DebugStreamConnection;
87
- }
88
-
89
- export const DebugAdapterContribution = Symbol('DebugAdapterContribution');
90
-
91
- export interface DebugAdapterContribution {
92
- /**
93
- * The debug type. Should be a unique value among all debug adapters.
94
- */
95
- readonly type: string;
96
-
97
- readonly label?: MaybePromise<string | undefined>;
98
-
99
- readonly languages?: MaybePromise<string[] | undefined>;
100
-
101
- /**
102
- * The [debug adapter session](#DebugAdapterSession) factory.
103
- * If a default implementation of the debug adapter session does not
104
- * fit all needs it is possible to provide its own implementation using
105
- * this factory. But it is strongly recommended to extend the default
106
- * implementation if so.
107
- */
108
- debugAdapterSessionFactory?: DebugAdapterSessionFactory;
109
-
110
- /**
111
- * @returns The contributed configuration schema for this debug type.
112
- */
113
- getSchemaAttributes?(): MaybePromise<IJSONSchema[]>;
114
-
115
- getConfigurationSnippets?(): MaybePromise<IJSONSchemaSnippet[]>;
116
-
117
- /**
118
- * Provides a [debug adapter executable](#DebugAdapterExecutable)
119
- * based on [debug configuration](#DebugConfiguration) to launch a new debug adapter
120
- * or to connect to existed one.
121
- * @param config The resolved [debug configuration](#DebugConfiguration).
122
- * @returns The [debug adapter executable](#DebugAdapterExecutable).
123
- */
124
- provideDebugAdapterExecutable?(config: DebugConfiguration): MaybePromise<DebugAdapterExecutable | undefined>;
125
-
126
- /**
127
- * Provides initial [debug configuration](#DebugConfiguration).
128
- * @returns An array of [debug configurations](#DebugConfiguration).
129
- */
130
- provideDebugConfigurations?(workspaceFolderUri?: string): MaybePromise<DebugConfiguration[]>;
131
-
132
- /**
133
- * Resolves a [debug configuration](#DebugConfiguration) by filling in missing values
134
- * or by adding/changing/removing attributes.
135
- * @param config The [debug configuration](#DebugConfiguration) to resolve.
136
- * @returns The resolved debug configuration.
137
- */
138
- resolveDebugConfiguration?(
139
- config: DebugConfiguration,
140
- workspaceFolderUri?: string,
141
- ): MaybePromise<DebugConfiguration | undefined>;
142
- }
143
-
144
- export const DebugModelFactory = Symbol('DebugModelFactory');
145
- export type DebugModelFactory = (editor: DebugEditor) => IDebugModel;
146
-
147
- export const IDebugModel = Symbol('IDebugModel');
148
- export interface IDebugModel extends IDisposable {
149
- uri: URI;
150
- position: monaco.Position;
151
- init: () => Promise<void>;
152
- renderBreakpoints: () => void;
153
- toggleBreakpoint: (position?: monaco.Position) => void;
154
- openBreakpointView: (
155
- position: monaco.Position,
156
- context?: DebugBreakpointWidgetContext,
157
- defaultContext?: TSourceBrekpointProperties,
158
- ) => void;
159
- closeBreakpointView: () => void;
160
- acceptBreakpoint: () => void;
161
- focusStackFrame: () => void;
162
- breakpoint: ISourceBreakpoint | IRuntimeBreakpoint | undefined;
163
- onContextMenu: (event: editor.IEditorMouseEvent | editor.IPartialEditorMouseEvent) => void;
164
- onMouseDown: (event: editor.IEditorMouseEvent | editor.IPartialEditorMouseEvent) => void;
165
- onMouseMove: (event: editor.IEditorMouseEvent | editor.IPartialEditorMouseEvent) => void;
166
- onMouseLeave: (event: editor.IEditorMouseEvent | editor.IPartialEditorMouseEvent) => void;
167
- getBreakpoints(
168
- uri?: URI | undefined,
169
- filter?: Partial<monaco.IPosition> | undefined,
170
- ): Array<ISourceBreakpoint | IRuntimeBreakpoint>;
171
- getEditor: () => DebugEditor;
172
- getBreakpointWidget: () => IDebugBreakpointWidget;
173
- getDebugHoverWidget: () => IDebugHoverWidget;
174
- render: () => void;
175
- }
176
-
177
- export class MemoryRegion extends Disposable implements IMemoryRegion {
178
- private readonly invalidateEmitter = this.registerDispose(new Emitter<IMemoryInvalidationEvent>());
179
-
180
- /** @inheritdoc */
181
- public readonly onDidInvalidate = this.invalidateEmitter.event;
182
-
183
- /** @inheritdoc */
184
- public readonly writable = !!this.session.capabilities.supportsWriteMemoryRequest;
185
-
186
- constructor(private readonly memoryReference: string, private readonly session: IDebugSession) {
187
- super();
188
- this.registerDispose(
189
- session.onDidInvalidateMemory((e) => {
190
- if (e.body.memoryReference === memoryReference) {
191
- this.invalidate(e.body.offset, e.body.count - e.body.offset);
192
- }
193
- }),
194
- );
195
- }
196
-
197
- public async read(fromOffset: number, toOffset: number): Promise<MemoryRange[]> {
198
- const length = toOffset - fromOffset;
199
- const offset = fromOffset;
200
- const result = await this.session.readMemory(this.memoryReference, offset, length);
201
-
202
- if (result === undefined || !result.body?.data) {
203
- return [{ type: MemoryRangeType.Unreadable, offset, length }];
204
- }
205
-
206
- let data: BinaryBuffer;
207
- try {
208
- data = decodeBase64(result.body.data);
209
- } catch (e) {
210
- return [{ type: MemoryRangeType.Error, offset, length, error: e.message }];
211
- }
212
-
213
- const unreadable = result.body.unreadableBytes || 0;
214
- const dataLength = length - unreadable;
215
- if (data.byteLength < dataLength) {
216
- const pad = BinaryBuffer.alloc(dataLength - data.byteLength);
217
- pad.buffer.fill(0);
218
- data = BinaryBuffer.concat([data, pad], dataLength);
219
- } else if (data.byteLength > dataLength) {
220
- data = data.slice(0, dataLength);
221
- }
222
-
223
- if (!unreadable) {
224
- return [{ type: MemoryRangeType.Valid, offset, length, data }];
225
- }
226
-
227
- return [
228
- { type: MemoryRangeType.Valid, offset, length: dataLength, data },
229
- { type: MemoryRangeType.Unreadable, offset: offset + dataLength, length: unreadable },
230
- ];
231
- }
232
-
233
- public async write(offset: number, data: BinaryBuffer): Promise<number> {
234
- const result = await this.session.writeMemory(this.memoryReference, offset, encodeBase64(data), true);
235
- const written = result?.body?.bytesWritten ?? data.byteLength;
236
- this.invalidate(offset, offset + written);
237
- return written;
238
- }
239
-
240
- public override dispose() {
241
- super.dispose();
242
- }
243
-
244
- private invalidate(fromOffset: number, toOffset: number) {
245
- this.invalidateEmitter.fire({ fromOffset, toOffset });
246
- }
247
- }
@@ -1,8 +0,0 @@
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
- }
@@ -1 +0,0 @@
1
- export const launchSchemaUri = 'vscode://schemas/launch';
@@ -1,176 +0,0 @@
1
- import {
2
- IDisposable,
3
- IJSONSchema,
4
- IJSONSchemaSnippet,
5
- ApplicationError,
6
- Event,
7
- BinaryBuffer,
8
- } from '@opensumi/ide-core-common';
9
-
10
- import { DebugConfiguration } from './debug-configuration';
11
- import { IDebugSessionDTO } from './debug-session-options';
12
-
13
- export interface IMemoryInvalidationEvent {
14
- fromOffset: number;
15
- toOffset: number;
16
- }
17
-
18
- export const enum MemoryRangeType {
19
- Valid,
20
- Unreadable,
21
- Error,
22
- }
23
-
24
- export interface IMemoryRange {
25
- type: MemoryRangeType;
26
- offset: number;
27
- length: number;
28
- }
29
-
30
- export interface IUnreadableMemoryRange extends IMemoryRange {
31
- type: MemoryRangeType.Unreadable;
32
- }
33
-
34
- export interface IErrorMemoryRange extends IMemoryRange {
35
- type: MemoryRangeType.Error;
36
- error: string;
37
- }
38
-
39
- export interface IValidMemoryRange extends IMemoryRange {
40
- type: MemoryRangeType.Valid;
41
- offset: number;
42
- length: number;
43
- data: BinaryBuffer;
44
- }
45
-
46
- /**
47
- * Union type of memory that can be returned from read(). Since a read request
48
- * could encompass multiple previously-read ranges, multiple of these types
49
- * are possible to return.
50
- */
51
- export type MemoryRange = IValidMemoryRange | IUnreadableMemoryRange | IErrorMemoryRange;
52
-
53
- /**
54
- * An IMemoryRegion corresponds to a contiguous range of memory referred to
55
- * by a DAP `memoryReference`.
56
- */
57
- export interface IMemoryRegion extends IDisposable {
58
- /**
59
- * Event that fires when memory changes. Can be a result of memory events or
60
- * `write` requests.
61
- */
62
- readonly onDidInvalidate: Event<IMemoryInvalidationEvent>;
63
-
64
- /**
65
- * Whether writes are supported on this memory region.
66
- */
67
- readonly writable: boolean;
68
-
69
- /**
70
- * Requests memory ranges from the debug adapter. It returns a list of memory
71
- * ranges that overlap (but may exceed!) the given offset. Use the `offset`
72
- * and `length` of each range for display.
73
- */
74
- read(fromOffset: number, toOffset: number): Promise<MemoryRange[]>;
75
-
76
- /**
77
- * Writes memory to the debug adapter at the given offset.
78
- */
79
- write(offset: number, data: BinaryBuffer): Promise<number>;
80
- }
81
-
82
- export interface DebuggerDescription {
83
- type: string;
84
- label: string;
85
- }
86
-
87
- export const DebugAdapterPath = 'DebugAdaptor';
88
-
89
- // Browser DI Token
90
- export const IDebugServer = Symbol('DebugServer');
91
-
92
- export interface DebugServer extends IDisposable {
93
- /**
94
- * 查找并返回注册了的Debug类型
95
- * @returns Debug 类型数组
96
- */
97
- debugTypes(): Promise<string[]>;
98
-
99
- /**
100
- * 根据语言获取对应的Debuggers
101
- * @param language
102
- */
103
- getDebuggersForLanguage(language: string): Promise<DebuggerDescription[]>;
104
-
105
- /**
106
- * 根据调试类型获取支持的Schema
107
- * @param debugType 调试类型
108
- */
109
- getSchemaAttributes(debugType: string): Promise<IJSONSchema[]>;
110
-
111
- /**
112
- * 根据调试类型获取对应的片段
113
- */
114
- getConfigurationSnippets(): Promise<IJSONSchemaSnippet[]>;
115
-
116
- /**
117
- * 提供对应调试类型下的配置
118
- * @param debugType 调试类型
119
- */
120
- provideDebugConfigurations(debugType: string, workspaceFolderUri: string | undefined): Promise<DebugConfiguration[]>;
121
-
122
- /**
123
- * 处理调试配置,补全缺省值
124
- * @param config 需要处理的配置
125
- * @param workspaceFolderUri 工作区目录路径
126
- */
127
- resolveDebugConfiguration(
128
- config: DebugConfiguration,
129
- workspaceFolderUri: string | undefined,
130
- ): Promise<DebugConfiguration | undefined | null>;
131
-
132
- /**
133
- * 进一步处理调试配置,通过补全缺省值的方式
134
- * 具体实现通过插件进行二次实现
135
- * @param {DebugConfiguration} 处理的配置
136
- * @param {(string | undefined)} 工作区路径
137
- */
138
- resolveDebugConfigurationWithSubstitutedVariables(
139
- config: DebugConfiguration,
140
- workspaceFolderUri: string | undefined,
141
- ): Promise<DebugConfiguration | undefined | null>;
142
- /**
143
- * 创建一个新的DebugAdapterSession进程
144
- * @param config 传入配置
145
- * @returns DebugAdapterSession对应sessionId.
146
- */
147
- createDebugSession(config: IDebugSessionDTO): Promise<string | void>;
148
-
149
- /**
150
- * 终止一个调试进程
151
- * @param sessionId
152
- */
153
- terminateDebugSession(sessionId: string): Promise<void>;
154
- }
155
-
156
- export const IDebugService = Symbol('DebugService');
157
-
158
- export interface IDebugService {
159
- onDidDebugContributionPointChange: Event<IDebugServiceContributionPoint>;
160
- unregisterDebugContributionPoints(extensionFolder: string): void;
161
- registerDebugContributionPoints(extensionFolder: string, contributions: IJSONSchema[]): void;
162
- debugContributionPoints: Map<string, IJSONSchema[]>;
163
- }
164
-
165
- export interface IDebugServiceContributionPoint {
166
- path: string;
167
- contributions: IJSONSchema[];
168
- removed?: boolean;
169
- }
170
-
171
- export namespace DebugError {
172
- export const NotFound = ApplicationError.declare(-41000, (type: string) => ({
173
- message: `'${type}' debugger type is not supported.`,
174
- data: { type },
175
- }));
176
- }
@@ -1,19 +0,0 @@
1
- import { DebugConfiguration } from './debug-configuration';
2
- import { IDebugSessionOptions } from './debug-session';
3
-
4
- export interface DebugSessionOptions extends IDebugSessionOptions {
5
- configuration: DebugConfiguration;
6
- workspaceFolderUri?: string;
7
- index: number;
8
- }
9
-
10
- export interface IDebugSessionDTO extends DebugSessionOptions {
11
- id: number;
12
- parent?: string;
13
- }
14
-
15
- export namespace IDebugSessionDTO {
16
- export function is(options: DebugSessionOptions): options is IDebugSessionDTO {
17
- return 'id' in options;
18
- }
19
- }