Closed upwindtec closed 3 weeks ago
For the same reasons NodeJS doesn't execute batch files by default anymore I can't pass shell: true
by default. You need to set this yourself using this: https://github.com/microsoft/vscode-languageserver-node/blob/main/client/src/node/main.ts#L60
Java-based language servers are launched using a batch file under Windows. Example the Kotlin language server (https://github.com/fwcd/kotlin-language-server) is launched using a batch file that launches the Java runtime using specific parameters. For security reasons, spawning a batch file under Windows is not allowed unless the shell option is used. In the file node/main.js, the shell option can be added around line 422 to resolve the issue: const options = Object.assign({}, command.options); options.shell = true; options.cwd = options.cwd || serverWorkingDir; if (transport === undefined || transport === TransportKind.stdio) { const serverProcess = cp.spawn(command.command, args, options);
and line 275: const execOptions = Object.create(null); execOptions.cwd = serverWorkingDir; execOptions.env = getEnvironment(options.env, false); execOptions.shell = true; const runtime = this._getRuntimePath(node.runtime, serverWorkingDir);
Unless there is another way to add this option without changing the source-code?
Regards,
Robert