add proposed debug API; fixes #28234

This commit is contained in:
Andre Weinand
2017-06-22 18:37:05 +02:00
parent 55a46397ac
commit fbcdb4c6a7
6 changed files with 240 additions and 0 deletions

View File

@@ -34,6 +34,7 @@ import { ExtHostLanguages } from 'vs/workbench/api/node/extHostLanguages';
import { ExtHostLanguageFeatures } from 'vs/workbench/api/node/extHostLanguageFeatures';
import { ExtHostApiCommands } from 'vs/workbench/api/node/extHostApiCommands';
import { ExtHostTask } from 'vs/workbench/api/node/extHostTask';
import { ExtHostDebugService } from 'vs/workbench/api/node/extHostDebugService';
import * as extHostTypes from 'vs/workbench/api/node/extHostTypes';
import URI from 'vs/base/common/uri';
import Severity from 'vs/base/common/severity';
@@ -83,6 +84,7 @@ export function createApiFactory(
// Addressable instances
const col = new InstanceCollection();
const extHostHeapService = col.define(ExtHostContext.ExtHostHeapService).set<ExtHostHeapService>(new ExtHostHeapService());
const extHostDebugService = col.define(ExtHostContext.ExtHostDebugService).set<ExtHostDebugService>(new ExtHostDebugService(threadService));
const extHostDocumentsAndEditors = col.define(ExtHostContext.ExtHostDocumentsAndEditors).set<ExtHostDocumentsAndEditors>(new ExtHostDocumentsAndEditors(threadService));
const extHostDocuments = col.define(ExtHostContext.ExtHostDocuments).set<ExtHostDocuments>(new ExtHostDocuments(threadService, extHostDocumentsAndEditors));
const extHostDocumentSaveParticipant = col.define(ExtHostContext.ExtHostDocumentSaveParticipant).set<ExtHostDocumentSaveParticipant>(new ExtHostDocumentSaveParticipant(extHostDocuments, threadService.get(MainContext.MainThreadWorkspace)));
@@ -448,6 +450,17 @@ export function createApiFactory(
}
};
// namespace: debug
const debug: typeof vscode.debug = {
createDebugSession: proposedApiFunction(extension, (config: vscode.DebugConfiguration) => {
return extHostDebugService.createDebugSession(config);
}),
onDidTerminateDebugSession: proposedApiFunction(extension, (listener, thisArg?, disposables?) => {
return extHostDebugService.onDidTerminateDebugSession(listener, thisArg, disposables);
})
};
return {
version: pkg.version,
// namespaces
@@ -458,6 +471,7 @@ export function createApiFactory(
window,
workspace,
scm,
debug,
// types
CancellationTokenSource: CancellationTokenSource,
CodeLens: extHostTypes.CodeLens,