mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-12 11:23:12 +00:00
Code: don't check for ra_lsp_server on Windows
This commit is contained in:
parent
6b1c2ee168
commit
ee2bc73d2a
1 changed files with 9 additions and 5 deletions
|
@ -1,5 +1,5 @@
|
||||||
import { lookpath } from 'lookpath';
|
import { lookpath } from 'lookpath';
|
||||||
import { homedir } from 'os';
|
import { homedir, platform } from 'os';
|
||||||
import * as lc from 'vscode-languageclient';
|
import * as lc from 'vscode-languageclient';
|
||||||
|
|
||||||
import { window, workspace } from 'vscode';
|
import { window, workspace } from 'vscode';
|
||||||
|
@ -29,11 +29,15 @@ export class Server {
|
||||||
}
|
}
|
||||||
|
|
||||||
const command = expandPathResolving(this.config.raLspServerPath);
|
const command = expandPathResolving(this.config.raLspServerPath);
|
||||||
|
// FIXME: remove check when the following issue is fixed:
|
||||||
|
// https://github.com/otiai10/lookpath/issues/4
|
||||||
|
if (platform() !== 'win32') {
|
||||||
if (!(await lookpath(command))) {
|
if (!(await lookpath(command))) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Cannot find rust-analyzer server \`${command}\` in PATH.`
|
`Cannot find rust-analyzer server \`${command}\` in PATH.`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
const run: lc.Executable = {
|
const run: lc.Executable = {
|
||||||
command,
|
command,
|
||||||
options: { cwd: folder }
|
options: { cwd: folder }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue