move cli server and download command registrations out of api.impl

This commit is contained in:
Johannes Rieken
2019-08-08 11:12:10 +02:00
parent 6e9e6e912a
commit 44f176c745
4 changed files with 41 additions and 39 deletions

View File

@@ -6,7 +6,7 @@
import { generateRandomPipeName } from 'vs/base/parts/ipc/node/ipc.net';
import * as http from 'http';
import * as fs from 'fs';
import { ExtHostCommands } from 'vs/workbench/api/common/extHostCommands';
import { IExtHostCommands } from 'vs/workbench/api/common/extHostCommands';
import { IURIToOpen, IOpenSettings } from 'vs/platform/windows/common/windows';
import { URI } from 'vs/base/common/uri';
import { hasWorkspaceFileExtension } from 'vs/platform/workspaces/common/workspaces';
@@ -38,7 +38,7 @@ export class CLIServer {
private _server: http.Server;
private _ipcHandlePath: string | undefined;
constructor(private _commands: ExtHostCommands) {
constructor(@IExtHostCommands private _commands: IExtHostCommands) {
this._server = http.createServer((req, res) => this.onRequest(req, res));
this.setup().catch(err => {
console.error(err);
@@ -179,4 +179,4 @@ export class CLIServer {
fs.unlinkSync(this._ipcHandlePath);
}
}
}
}