diff --git a/src/vs/workbench/api/common/extHost.api.impl.ts b/src/vs/workbench/api/common/extHost.api.impl.ts index f24d9b2880e..5987ac5d21e 100644 --- a/src/vs/workbench/api/common/extHost.api.impl.ts +++ b/src/vs/workbench/api/common/extHost.api.impl.ts @@ -21,7 +21,7 @@ import {ExtHostMessageService} from 'vs/workbench/api/common/extHostMessageServi import {ExtHostEditors} from 'vs/workbench/api/common/extHostEditors'; import {ExtHostLanguages} from 'vs/workbench/api/common/extHostLanguages'; import {ExtHostLanguageFeatures} from 'vs/workbench/api/common/extHostLanguageFeatures'; -import {ExtHostApiCommands} from 'vs/workbench/api/common/extHostApiCommands'; +import {registerApiCommands} from 'vs/workbench/api/common/extHostApiCommands'; import * as extHostTypes from 'vs/workbench/api/common/extHostTypes'; import 'vs/workbench/api/common/extHostTypes.marshalling'; import Modes = require('vs/editor/common/modes'); @@ -257,11 +257,13 @@ export class ExtHostAPIImplementation { } }); + // + registerApiCommands(threadService); + // const languages = new ExtHostLanguages(this._threadService); const pluginHostDiagnostics = new ExtHostDiagnostics(this._threadService); const languageFeatures = threadService.getRemotable(ExtHostLanguageFeatures); - const languageFeatureCommand = new ExtHostApiCommands(threadService.getRemotable(ExtHostCommands)); this.languages = { createDiagnosticCollection(name?: string): vscode.DiagnosticCollection { diff --git a/src/vs/workbench/api/common/extHostApiCommands.ts b/src/vs/workbench/api/common/extHostApiCommands.ts index 2846caac3ab..2e642b245b5 100644 --- a/src/vs/workbench/api/common/extHostApiCommands.ts +++ b/src/vs/workbench/api/common/extHostApiCommands.ts @@ -18,8 +18,14 @@ import {IQuickFix2} from 'vs/editor/contrib/quickFix/common/quickFix'; import {IOutline} from 'vs/editor/contrib/quickOpen/common/quickOpen'; import {ITypeBearing} from 'vs/workbench/parts/search/common/search'; import {ICodeLensData} from 'vs/editor/contrib/codelens/common/codelens'; +import {IThreadService} from 'vs/platform/thread/common/thread'; -export class ExtHostApiCommands { +export function registerApiCommands(threadService: IThreadService) { + const commands = threadService.getRemotable(ExtHostCommands); + new ExtHostApiCommands(commands); +} + +class ExtHostApiCommands { private _commands: ExtHostCommands; private _disposables: IDisposable[] = []; diff --git a/src/vs/workbench/test/common/api/extHostApiCommands.test.ts b/src/vs/workbench/test/common/api/extHostApiCommands.test.ts index f676c069dc3..04719896770 100644 --- a/src/vs/workbench/test/common/api/extHostApiCommands.test.ts +++ b/src/vs/workbench/test/common/api/extHostApiCommands.test.ts @@ -23,11 +23,10 @@ import {IKeybindingService} from 'vs/platform/keybinding/common/keybindingServic import {KeybindingsRegistry} from 'vs/platform/keybinding/common/keybindingsRegistry'; import {IModelService} from 'vs/editor/common/services/modelService'; import {ExtHostLanguageFeatures, MainThreadLanguageFeatures} from 'vs/workbench/api/common/extHostLanguageFeatures'; -import {ExtHostApiCommands} from 'vs/workbench/api/common/extHostApiCommands'; +import {registerApiCommands} from 'vs/workbench/api/common/extHostApiCommands'; import {ExtHostCommands, MainThreadCommands} from 'vs/workbench/api/common/extHostCommands'; import {ExtHostModelService} from 'vs/workbench/api/common/extHostDocuments'; -const defaultSelector = { scheme: 'far' }; const model: EditorCommon.IModel = new EditorModel( [ 'This is the first line', @@ -86,7 +85,7 @@ suite('ExtHostLanguageFeatureCommands', function() { threadService.getRemotable(MainThreadCommands); commands = threadService.getRemotable(ExtHostCommands); - new ExtHostApiCommands(commands); + registerApiCommands(threadService); mainThread = threadService.getRemotable(MainThreadLanguageFeatures); extHost = threadService.getRemotable(ExtHostLanguageFeatures); });