import * as React from '@theia/core/shared/react'; import { LabelProvider } from '@theia/core/lib/browser'; import { DebugProtocol } from '@vscode/debugprotocol'; import { Emitter, Event, DisposableCollection, Disposable, MessageClient, MessageType, ContributionProvider, CommandService } from '@theia/core/lib/common'; import { TerminalService } from '@theia/terminal/lib/browser/base/terminal-service'; import { EditorManager } from '@theia/editor/lib/browser'; import { CompositeTreeElement } from '@theia/core/lib/browser/source-tree'; import { DebugSessionConnection, DebugRequestTypes, DebugEventTypes } from './debug-session-connection'; import { DebugThread, StoppedDetails } from './model/debug-thread'; import { DebugScope, DebugVariable } from './console/debug-console-items'; import { DebugStackFrame } from './model/debug-stack-frame'; import { DebugSource } from './model/debug-source'; import { DebugBreakpoint } from './model/debug-breakpoint'; import URI from '@theia/core/lib/common/uri'; import { BreakpointManager } from './breakpoint/breakpoint-manager'; import { DebugConfigurationSessionOptions, TestRunReference } from './debug-session-options'; import { DebugConfiguration } from '../common/debug-common'; import { TerminalWidgetOptions, TerminalWidget } from '@theia/terminal/lib/browser/base/terminal-widget'; import { FileService } from '@theia/filesystem/lib/browser/file-service'; import { DebugContribution } from './debug-contribution'; import { Deferred } from '@theia/core/lib/common/promise-util'; import { WorkspaceService } from '@theia/workspace/lib/browser'; import { TestService } from '@theia/test/lib/browser/test-service'; import { DebugSessionManager } from './debug-session-manager'; import { DebugPreferences } from '../common/debug-preferences'; export declare enum DebugState { Inactive = 0, Initializing = 1, Running = 2, Stopped = 3 } /** * The mapped string values must not change as they are used for the `debugState` when context closure. * For more details see the `Debugger contexts` section of the [official doc](https://code.visualstudio.com/api/references/when-clause-contexts#available-contexts). */ export declare function debugStateContextValue(state: DebugState): string; /** * Returns a formatted message string. The format is compatible with {@link DebugProtocol.Message.format}. * @param format A format string for the message. Embedded variables have the form `{name}`. * @param variables An object used as a dictionary for looking up the variables in the format string. */ export declare function formatMessage(format: string, variables?: { [key: string]: string; }): string; export declare class DebugSession implements CompositeTreeElement { readonly id: string; readonly options: DebugConfigurationSessionOptions; readonly parentSession: DebugSession | undefined; protected readonly connection: DebugSessionConnection; protected readonly terminalServer: TerminalService; protected readonly editorManager: EditorManager; protected readonly breakpoints: BreakpointManager; protected readonly labelProvider: LabelProvider; protected readonly messages: MessageClient; protected readonly fileService: FileService; protected readonly debugContributionProvider: ContributionProvider; protected readonly workspaceService: WorkspaceService; protected readonly debugPreferences: DebugPreferences; protected readonly commandService: CommandService; /** * Number of millis after a `stop` request times out. It's 5 seconds by default. */ protected readonly stopTimeout: number; protected readonly deferredOnDidConfigureCapabilities: Deferred; protected readonly onDidChangeEmitter: Emitter; readonly onDidChange: Event; protected fireDidChange(): void; protected readonly onDidFocusStackFrameEmitter: Emitter; get onDidFocusStackFrame(): Event; protected readonly onDidFocusThreadEmitter: Emitter; get onDidFocusThread(): Event; protected readonly onDidResolveLazyVariableEmitter: Emitter; readonly onDidResolveLazyVariable: Event; protected readonly childSessions: Map; protected readonly toDispose: DisposableCollection; protected isStopping: boolean; /** Maximum time to wait for the shell integration prompt before proceeding. */ protected readonly PROMPT_READY_TIMEOUT_MS = 3000; constructor(id: string, options: DebugConfigurationSessionOptions, parentSession: DebugSession | undefined, testService: TestService, testRun: TestRunReference | undefined, sessionManager: DebugSessionManager, connection: DebugSessionConnection, terminalServer: TerminalService, editorManager: EditorManager, breakpoints: BreakpointManager, labelProvider: LabelProvider, messages: MessageClient, fileService: FileService, debugContributionProvider: ContributionProvider, workspaceService: WorkspaceService, debugPreferences: DebugPreferences, commandService: CommandService, /** * Number of millis after a `stop` request times out. It's 5 seconds by default. */ stopTimeout?: number); get onDispose(): Event; get configuration(): DebugConfiguration; protected _capabilities: DebugProtocol.Capabilities; get capabilities(): DebugProtocol.Capabilities; get autoExpandLazyVariables(): boolean; protected readonly sources: Map; getSource(raw: DebugProtocol.Source): DebugSource; getSourceForUri(uri: URI): DebugSource | undefined; toSource(uri: URI): Promise; toDebugSource(uri: URI): Promise; protected _threads: Map; get threads(): IterableIterator; get threadCount(): number; getThreads(filter: (thread: DebugThread) => boolean): IterableIterator; get runningThreads(): IterableIterator; get stoppedThreads(): IterableIterator; pauseAll(): Promise; continueAll(): Promise; get currentFrame(): DebugStackFrame | undefined; protected _currentThread: DebugThread | undefined; protected readonly toDisposeOnCurrentThread: DisposableCollection; get currentThread(): DebugThread | undefined; set currentThread(thread: DebugThread | undefined); get state(): DebugState; getScopes(): Promise; showMessage(messageType: MessageType, message: string): void; start(): Promise; protected initialize(): Promise; protected launchOrAttach(): Promise; /** * The `send('initialize')` request could resolve later than `on('initialized')` emits the event. * Hence, the `configure` would use the empty object `capabilities`. * Using the empty `capabilities` could result in missing exception breakpoint filters, as * always `capabilities.exceptionBreakpointFilters` is falsy. This deferred promise works * around this timing issue. https://github.com/eclipse-theia/theia/issues/11886 */ protected didReceiveCapabilities: Deferred; protected initialized: boolean; protected configure(): Promise; canTerminate(): boolean; canRestart(): boolean; restart(): Promise; stop(isRestart: boolean, callback: () => void): Promise; /** * Invoked when sending the `terminate` request to the debugger is rejected or timed out. */ protected handleTerminateError(err: unknown): void; /** * Invoked when sending the `disconnect` request to the debugger is rejected or timed out. */ protected handleDisconnectError(err: unknown): void; disconnect(isRestart: boolean, callback: () => void): Promise; completions(text: string, column: number, line: number): Promise; evaluate(expression: string, context?: string): Promise; sendRequest(command: K, args: DebugRequestTypes[K][0], timeout?: number): Promise; sendCustomRequest(command: string, args?: any): Promise; on(kind: K, listener: (e: DebugEventTypes[K]) => any): Disposable; waitFor(kind: K, ms: number): Promise; get onDidCustomEvent(): Event; protected runInTerminal({ arguments: { title, cwd, args, env } }: DebugProtocol.RunInTerminalRequest): Promise; protected doCreateTerminal(options: TerminalWidgetOptions): Promise; protected clearThreads(): void; protected clearThread(threadId: number): void; protected readonly scheduleUpdateThreads: () => Promise; protected pendingThreads: Promise; updateThreads(stoppedDetails: StoppedDetails | undefined): Promise; protected doUpdateThreads(threads: DebugProtocol.Thread[], stoppedDetails?: StoppedDetails): void; protected updateCurrentThread(stoppedDetails?: StoppedDetails): void; protected updateFrames(): Promise; protected updateCapabilities(capabilities: DebugProtocol.Capabilities): void; protected updatingBreakpoints: boolean; protected updateBreakpoint(body: DebugProtocol.BreakpointEvent['body']): void; protected findBreakpoint(match: (breakpoint: DebugBreakpoint) => boolean): DebugBreakpoint | undefined; protected updateBreakpoints(options: { uri?: URI; sourceModified: boolean; }): Promise; protected sendExceptionBreakpoints(): Promise; protected sendFunctionBreakpoints(affectedUri: URI): Promise; protected sendSourceBreakpoints(affectedUri: URI, sourceModified?: boolean): Promise; protected sendInstructionBreakpoints(): Promise; protected sendDataBreakpoints(): Promise; protected getAffectedUris(uri?: URI): IterableIterator; get label(): string; get visible(): boolean; render(): React.ReactNode; getElements(): IterableIterator; protected getSingleChildSession(): DebugSession | undefined; protected handleContinued({ body: { allThreadsContinued, threadId } }: DebugProtocol.ContinuedEvent): Promise; protected handleStopped({ body }: DebugProtocol.StoppedEvent): Promise; protected handleThread({ body: { reason, threadId } }: DebugProtocol.ThreadEvent): Promise; protected registerDebugContributions(configType: string, connection: DebugSessionConnection): void; /** * Returns the top-most parent session that is responsible for the console. If this session uses a {@link DebugConsoleMode.Separate separate console} * or does not have any parent session, undefined is returned. */ findConsoleParent(): DebugSession | undefined; } //# sourceMappingURL=debug-session.d.ts.map