@opensumi/ide-debug 2.21.6 → 2.21.7-next-1670485458.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/debug-session.d.ts.map +1 -1
- package/lib/browser/debug-session.js +5 -1
- package/lib/browser/debug-session.js.map +1 -1
- 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/frames/debug-call-stack-session.view.d.ts.map +1 -1
- package/lib/browser/view/frames/debug-call-stack-session.view.js +16 -13
- package/lib/browser/view/frames/debug-call-stack-session.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 +25 -24
- 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 +1182 -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 +244 -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,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,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,247 @@
|
|
|
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
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const launchSchemaUri = 'vscode://schemas/launch';
|
|
@@ -0,0 +1,176 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
}
|