Skip to content

Commit

Permalink
Revert the rest of the serverPath changes
Browse files Browse the repository at this point in the history
  • Loading branch information
333fred committed Jul 19, 2023
1 parent 24c9082 commit cd9f9f3
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/lsptoolshost/roslynLanguageServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -366,7 +361,7 @@ export class RoslynLanguageServer {

private async startServer(logLevel: string | undefined): Promise<cp.ChildProcess> {
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);
Expand Down Expand Up @@ -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?
Expand All @@ -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;
Expand Down

0 comments on commit cd9f9f3

Please sign in to comment.