mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-10 15:14:32 +00:00
Merge #2714
2714: Sanity check for missing server binary r=matklad a=matklad Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
commit
1953ac17fd
1 changed files with 4 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
|||
import { homedir } from 'os';
|
||||
import * as lc from 'vscode-languageclient';
|
||||
import { spawnSync } from 'child_process';
|
||||
|
||||
import { window, workspace } from 'vscode';
|
||||
import { Config } from './config';
|
||||
|
@ -13,6 +14,9 @@ export function createClient(config: Config): lc.LanguageClient {
|
|||
}
|
||||
|
||||
const command = expandPathResolving(config.raLspServerPath);
|
||||
if (spawnSync(command, ["--version"]).status !== 0) {
|
||||
window.showErrorMessage(`Unable to execute '${command} --version'`);
|
||||
}
|
||||
const run: lc.Executable = {
|
||||
command,
|
||||
options: { cwd: folder },
|
||||
|
|
Loading…
Reference in a new issue