2508: Code: don't check for ra_lsp_server on Windows r=matklad a=lnicola

Workaround for https://github.com/rust-analyzer/rust-analyzer/pull/2503#issuecomment-562980020.

~~(not yet tested on Windows)~~

We can't run `ra_lsp_server --version` right now because the server doesn't seem to handle arguments (so it hangs).

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
This commit is contained in:
bors[bot] 2019-12-08 19:32:24 +00:00 committed by GitHub
commit e3a9e806ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,5 @@
import { lookpath } from 'lookpath';
import { homedir } from 'os';
import { homedir, platform } from 'os';
import * as lc from 'vscode-languageclient';
import { window, workspace } from 'vscode';
@ -29,10 +29,14 @@ export class Server {
}
const command = expandPathResolving(this.config.raLspServerPath);
if (!(await lookpath(command))) {
throw new Error(
`Cannot find rust-analyzer server \`${command}\` in PATH.`
);
// FIXME: remove check when the following issue is fixed:
// https://github.com/otiai10/lookpath/issues/4
if (platform() !== 'win32') {
if (!(await lookpath(command))) {
throw new Error(
`Cannot find rust-analyzer server \`${command}\` in PATH.`
);
}
}
const run: lc.Executable = {
command,