1
>
/*---------------------------------------------------------------------------------------------
mockDebug.ts
2
>
* Copyright (c) Microsoft Corporation. All rights reserved.
3
>
* Licensed under the MIT License. See License.txt in the project root for license information.
4
>
*--------------------------------------------------------------------------------------------*/
5
>
6
>
import { DeferredPromise } from '../../../../../base/common/async.js';
7
>
import { CancellationToken } from '../../../../../base/common/cancellation.js';
8
>
import { Event } from '../../../../../base/common/event.js';
9
>
import { URI as uri } from '../../../../../base/common/uri.js';
10
>
import { IPosition, Position } from '../../../../../editor/common/core/position.js';
11
>
import { ITextModel } from '../../../../../editor/common/model.js';
12
>
import { NullLogService } from '../../../../../platform/log/common/log.js';
13
>
import { IStorageService } from '../../../../../platform/storage/common/storage.js';
14
>
import { IWorkspaceFolder } from '../../../../../platform/workspace/common/workspace.js';
15
>
import { AbstractDebugAdapter } from '../../common/abstractDebugAdapter.js';
16
>
import { AdapterEndEvent, IAdapterManager, IBreakpoint, IBreakpointData, IBreakpointUpdateData, IConfig, IConfigurationManager, IDataBreakpoint, IDataBreakpointInfoResponse, IDebugLocationReferenced, IDebugModel, IDebugService, IDebugSession, IDebugSessionOptions, IDebugger, IExceptionBreakpoint, IExceptionInfo, IFunctionBreakpoint, IInstructionBreakpoint, ILaunch, IMemoryRegion, INewReplElementData, IRawModelUpdate, IRawStoppedDetails, IReplElement, IStackFrame, IThread, IViewModel, LoadedSourceEvent, State } from '../../common/debug.js';
17
>
import { DebugCompoundRoot } from '../../common/debugCompoundRoot.js';
18
>
import { IInstructionBreakpointOptions } from '../../common/debugModel.js';
19
>
import { Source } from '../../common/debugSource.js';
20
>
import { DebugStorage } from '../../common/debugStorage.js';
21
>
22
>
export class MockDebugService implements IDebugService {
23
>
_serviceBrand: undefined;
24
>
25
>
get state(): State {
26
throw new Error('not implemented');
27
}
29
>
get onWillNewSession(): Event<IDebugSession> {
30
throw new Error('not implemented');
31
}
33
>
get onDidNewSession(): Event<IDebugSession> {
34
throw new Error('not implemented');
35
}
37
>
get onDidEndSession(): Event<{ session: IDebugSession; restart: boolean }> {
38
throw new Error('not implemented');
39
}
41
>
get onDidChangeState(): Event<State> {
42
throw new Error('not implemented');
43
}
45
>
getConfigurationManager(): IConfigurationManager {
46
throw new Error('not implemented');
47
}
49
>
getAdapterManager(): IAdapterManager {
50
throw new Error('Method not implemented.');
51
}
53
>
canSetBreakpointsIn(model: ITextModel): boolean {
54
throw new Error('Method not implemented.');
55
}
57
>
focusStackFrame(focusedStackFrame: IStackFrame): Promise<void> {
58
throw new Error('not implemented');
59
}
61
>
sendAllBreakpoints(session?: IDebugSession): Promise<any> {
62
throw new Error('not implemented');
63
}
65
>
sendBreakpoints(modelUri: uri, sourceModified?: boolean | undefined, session?: IDebugSession | undefined): Promise<any> {
66
throw new Error('not implemented');
67
}
69
>
addBreakpoints(uri: uri, rawBreakpoints: IBreakpointData[]): Promise<IBreakpoint[]> {
70
throw new Error('not implemented');
71
}
73
>
updateBreakpoints(uri: uri, data: Map<string, IBreakpointUpdateData>, sendOnResourceSaved: boolean): Promise<void> {
74
throw new Error('not implemented');
75
}
77
>
enableOrDisableBreakpoints(enabled: boolean): Promise<void> {
78
throw new Error('not implemented');
79
}
81
>
setBreakpointsActivated(): Promise<void> {
82
throw new Error('not implemented');
83
}
85
>
removeBreakpoints(): Promise<any> {
86
throw new Error('not implemented');
87
}
89
>
addInstructionBreakpoint(opts: IInstructionBreakpointOptions): Promise<void> {
90
throw new Error('Method not implemented.');
91
}
93
>
removeInstructionBreakpoints(address?: string): Promise<void> {
94
throw new Error('Method not implemented.');
95
}
97
>
setExceptionBreakpointCondition(breakpoint: IExceptionBreakpoint, condition: string): Promise<void> {
98
throw new Error('Method not implemented.');
99
}
101
>
setExceptionBreakpointsForSession(session: IDebugSession, data: DebugProtocol.ExceptionBreakpointsFilter[]): void {
102
throw new Error('Method not implemented.');
103
}
105
>
addFunctionBreakpoint(): void { }
106
>
107
>
moveWatchExpression(id: string, position: number): void { }
108
>
109
>
updateFunctionBreakpoint(id: string, update: { name?: string; hitCondition?: string; condition?: string }): Promise<void> {
110
throw new Error('not implemented');
111
}
113
>
removeFunctionBreakpoints(id?: string): Promise<void> {
114
throw new Error('not implemented');
115
}
117
>
addDataBreakpoint(): Promise<void> {
118
throw new Error('Method not implemented.');
119
}
121
>
updateDataBreakpoint(id: string, update: { hitCondition?: string; condition?: string }): Promise<void> {
122
throw new Error('not implemented');
123
}
125
>
removeDataBreakpoints(id?: string | undefined): Promise<void> {
126
throw new Error('Method not implemented.');
127
}
129
>
addReplExpression(name: string): Promise<void> {
130
throw new Error('not implemented');
131
}
133
>
removeReplExpressions(): void { }
134
>
135
>
addWatchExpression(name?: string): Promise<void> {
136
throw new Error('not implemented');
137
}
139
>
renameWatchExpression(id: string, newName: string): Promise<void> {
140
throw new Error('not implemented');
141
}
143
>
removeWatchExpressions(id?: string): void { }
144
>
145
>
startDebugging(launch: ILaunch, configOrName?: IConfig | string, options?: IDebugSessionOptions): Promise<boolean> {
146
return Promise.resolve(true);
147
}
149
>
restartSession(): Promise<any> {
150
throw new Error('not implemented');
151
}
153
>
stopSession(): Promise<any> {
154
throw new Error('not implemented');
155
}
157
>
getModel(): IDebugModel {
158
throw new Error('not implemented');
159
}
161
>
getViewModel(): IViewModel {
162
throw new Error('not implemented');
163
}
165
>
sourceIsNotAvailable(uri: uri): void { }
166
>
167
>
tryToAutoFocusStackFrame(thread: IThread): Promise<any> {
168
throw new Error('not implemented');
169
}
171
>
runTo(uri: uri, lineNumber: number, column?: number): Promise<void> {
172
throw new Error('Method not implemented.');
173
}
175
>
176
>
export class MockSession implements IDebugSession {
177
readonly suppressDebugToolbar = false;
178
readonly suppressDebugStatusbar = false;