diff --git a/extension/src/Extension.ts b/extension/src/Extension.ts index 1a90b71e5..6144f6002 100644 --- a/extension/src/Extension.ts +++ b/extension/src/Extension.ts @@ -38,10 +38,8 @@ import { instrumentOperation, sendInfo } from "vscode-extension-telemetry-wrappe import { GradleBuildContentProvider } from "./client/GradleBuildContentProvider"; import { BuildServerController } from "./bs/BuildServerController"; import { GradleTestRunner } from "./bs/GradleTestRunner"; -import { BspProxy } from "./bs/BspProxy"; export class Extension { - private readonly bspProxy: BspProxy; private readonly taskServerClient: TaskServerClient; private readonly server: GradleServer; private readonly pinnedTasksStore: PinnedTasksStore; @@ -81,16 +79,12 @@ export class Extension { const serverLogger = new Logger("gradle-server"); serverLogger.setLoggingChannel(loggingChannel); - const bspLogger = new Logger("bspProxy"); - bspLogger.setLoggingChannel(loggingChannel); - if (getConfigIsDebugEnabled()) { Logger.setLogVerbosity(LogVerbosity.DEBUG); } const statusBarItem = vscode.window.createStatusBarItem(); - this.bspProxy = new BspProxy(this.context, bspLogger); - this.server = new GradleServer({ host: "localhost" }, context, serverLogger, this.bspProxy); + this.server = new GradleServer({ host: "localhost" }, context, serverLogger); this.taskServerClient = new TaskServerClient(this.server, statusBarItem, clientLogger); this.pinnedTasksStore = new PinnedTasksStore(context); this.recentTasksStore = new RecentTasksStore(); @@ -265,7 +259,6 @@ export class Extension { } await vscode.commands.executeCommand("setContext", "gradle:activated", activated); await vscode.commands.executeCommand("setContext", "gradle:defaultView", true); - await this.bspProxy.start(); } private registerCommands(): void { diff --git a/extension/src/server/GradleServer.ts b/extension/src/server/GradleServer.ts index 432969815..4dfe9dd1a 100644 --- a/extension/src/server/GradleServer.ts +++ b/extension/src/server/GradleServer.ts @@ -28,14 +28,15 @@ export class GradleServer { public readonly onDidStop: vscode.Event = this._onDidStop.event; private process?: cp.ChildProcessWithoutNullStreams; private languageServerPipePath: string; + private bspProxy: BspProxy; constructor( private readonly opts: ServerOptions, private readonly context: vscode.ExtensionContext, - private readonly logger: Logger, - private bspProxy: BspProxy + private readonly logger: Logger ) { this.setLanguageServerPipePath(); + this.bspProxy = new BspProxy(this.context, logger); } private setLanguageServerPipePath(): void { @@ -59,7 +60,7 @@ export class GradleServer { } } this.bspProxy.setBuildServerStarted(startBuildServer); - + this.bspProxy.start(); this.taskServerPort = await getPort(); const cwd = this.context.asAbsolutePath("lib"); const cmd = path.join(cwd, getGradleServerCommand());