diff --git a/src/lsptoolshost/roslynLanguageServer.ts b/src/lsptoolshost/roslynLanguageServer.ts index 8ea26d99e1..01cbc50bb2 100644 --- a/src/lsptoolshost/roslynLanguageServer.ts +++ b/src/lsptoolshost/roslynLanguageServer.ts @@ -110,11 +110,6 @@ export class RoslynLanguageServer { */ private _solutionFile: vscode.Uri | undefined; - /** - * The path to the server executable that is being run, or undefined if none was. - */ - private _serverExecutablePath: string | undefined; - constructor( private platformInfo: PlatformInformation, private hostExecutableResolver: IHostExecutableResolver, @@ -366,7 +361,7 @@ export class RoslynLanguageServer { private async startServer(logLevel: string | undefined): Promise { const options = this.optionProvider.GetLatestOptions(); - this._serverExecutablePath = getServerPath(options, this.platformInfo); + const serverPath = getServerPath(options, this.platformInfo); const dotnetInfo = await this.hostExecutableResolver.getHostExecutableInfo(options); const dotnetRuntimePath = path.dirname(dotnetInfo.path); @@ -429,7 +424,7 @@ export class RoslynLanguageServer { } if (logLevel && [Trace.Messages, Trace.Verbose].includes(this.GetTraceLevel(logLevel))) { - _channel.appendLine(`Starting server at ${this._serverExecutablePath}`); + _channel.appendLine(`Starting server at ${serverPath}`); } // shouldn't this arg only be set if it's running with CSDevKit? @@ -442,13 +437,13 @@ export class RoslynLanguageServer { env: env, }; - if (this._serverExecutablePath.endsWith('.dll')) { + if (serverPath.endsWith('.dll')) { // If we were given a path to a dll, launch that via dotnet. - const argsWithPath = [this._serverExecutablePath].concat(args); + const argsWithPath = [serverPath].concat(args); childProcess = cp.spawn(dotnetExecutablePath, argsWithPath, cpOptions); } else { // Otherwise assume we were given a path to an executable. - childProcess = cp.spawn(this._serverExecutablePath, args, cpOptions); + childProcess = cp.spawn(serverPath, args, cpOptions); } return childProcess;