]> git.lizzy.rs Git - rust.git/commitdiff
Code: don't check for ra_lsp_server on Windows
authorLaurențiu Nicola <lnicola@dend.ro>
Sun, 8 Dec 2019 19:08:46 +0000 (21:08 +0200)
committerLaurențiu Nicola <lnicola@dend.ro>
Sun, 8 Dec 2019 19:14:18 +0000 (21:14 +0200)
editors/code/src/server.ts

index e717ab294d7f355e25c9d4e8f1b6e16be631897b..b346c08288d51a731a0d20fdf04d0e8ccd23b36a 100644 (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,