Skip to content

Commit

Permalink
Fix quoting bug (#6228)
Browse files Browse the repository at this point in the history
The server was not expecting paths to be quoted, but we were doing so on the client. I've also added a trace-level print of the actual arguments we will use to start the server, which helped me figure this out.
  • Loading branch information
333fred authored Aug 25, 2023
1 parent ea7aa46 commit eec3d3e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/lsptoolshost/roslynLanguageServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ export class RoslynLanguageServer {
}

for (const extensionPath of this.additionalExtensionPaths) {
args.push('--extension', `"${extensionPath}"`);
args.push('--extension', extensionPath);
}

// Get the brokered service pipe name from C# Dev Kit (if installed).
Expand Down Expand Up @@ -581,9 +581,18 @@ export class RoslynLanguageServer {
if (serverPath.endsWith('.dll')) {
// If we were given a path to a dll, launch that via dotnet.
const argsWithPath = [serverPath].concat(args);

if (logLevel && [Trace.Messages, Trace.Verbose].includes(this.GetTraceLevel(logLevel))) {
_channel.appendLine(`Server arguments ${argsWithPath.join(' ')}`);
}

childProcess = cp.spawn(dotnetExecutablePath, argsWithPath, cpOptions);
} else {
// Otherwise assume we were given a path to an executable.
if (logLevel && [Trace.Messages, Trace.Verbose].includes(this.GetTraceLevel(logLevel))) {
_channel.appendLine(`Server arguments ${args.join(' ')}`);
}

childProcess = cp.spawn(serverPath, args, cpOptions);
}

Expand Down

0 comments on commit eec3d3e

Please sign in to comment.