Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[plug-in] Add debug.onDidChangeActiveDebugSession and debug.onDidTerminateDebugSession API mocks #3369

Merged
merged 1 commit into from
Nov 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions packages/plugin-ext/src/plugin/plugin-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,14 @@ export function createAPIFactory(
};

const debug: typeof theia.debug = {
onDidChangeActiveDebugSession(listener, thisArg?, disposables?) {
// FIXME: to implement
return new Disposable(() => { });
},
onDidTerminateDebugSession(listener, thisArg?, disposables?) {
// FIXME: to implement
return new Disposable(() => { });
},
registerDebugConfigurationProvider(debugType: string, provider: theia.DebugConfigurationProvider): theia.Disposable {
// FIXME: to implement
return new Disposable(() => { });
Expand Down
40 changes: 40 additions & 0 deletions packages/plugin/src/theia.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5172,7 +5172,34 @@ declare module '@theia/plugin' {
* Additional debug type specific properties.
*/
[key: string]: any;
}

/**
* A debug session.
*/
export interface DebugSession {

/**
* The unique ID of this debug session.
*/
readonly id: string;

/**
* The debug session's type from the [debug configuration](#DebugConfiguration).
*/
readonly type: string;

/**
* The debug session's name from the [debug configuration](#DebugConfiguration).
*/
readonly name: string;

/**
* Send a custom request to the debug adapter.
*/
customRequest(command: string, args?: any): PromiseLike<any>;
}

/**
* A debug configuration provider allows to add the initial debug configurations to a newly created launch.json
* and to resolve a launch configuration before it is used to start a new debug session.
Expand Down Expand Up @@ -5207,6 +5234,19 @@ declare module '@theia/plugin' {
* Namespace for debug functionality.
*/
export namespace debug {

/**
* An [event](#Event) which fires when the [active debug session](#debug.activeDebugSession)
* has changed. *Note* that the event also fires when the active debug session changes
* to `undefined`.
*/
export const onDidChangeActiveDebugSession: Event<DebugSession | undefined>;

/**
* An [event](#Event) which fires when a [debug session](#DebugSession) has terminated.
*/
export const onDidTerminateDebugSession: Event<DebugSession>;

/**
* Register a [debug configuration provider](#DebugConfigurationProvider) for a specific debug type.
* More than one provider can be registered for the same type.
Expand Down