diff options
Diffstat (limited to 'editors/code')
-rw-r--r-- | editors/code/src/main.ts | 2 | ||||
-rw-r--r-- | editors/code/src/util.ts | 8 | ||||
-rw-r--r-- | editors/code/tests/unit/index.ts | 4 | ||||
-rw-r--r-- | editors/code/tsconfig.json | 2 |
4 files changed, 5 insertions, 11 deletions
diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts index 5877be8b2..4b990afa1 100644 --- a/editors/code/src/main.ts +++ b/editors/code/src/main.ts | |||
@@ -54,7 +54,7 @@ async function tryActivate(context: vscode.ExtensionContext) { | |||
54 | const serverPath = await bootstrap(config, state).catch(err => { | 54 | const serverPath = await bootstrap(config, state).catch(err => { |
55 | let message = "bootstrap error. "; | 55 | let message = "bootstrap error. "; |
56 | 56 | ||
57 | if (err.code === "EBUSY" || err.code === "ETXTBSY") { | 57 | if (err.code === "EBUSY" || err.code === "ETXTBSY" || err.code === "EPERM") { |
58 | message += "Other vscode windows might be using rust-analyzer, "; | 58 | message += "Other vscode windows might be using rust-analyzer, "; |
59 | message += "you should close them and reload this window to retry. "; | 59 | message += "you should close them and reload this window to retry. "; |
60 | } | 60 | } |
diff --git a/editors/code/src/util.ts b/editors/code/src/util.ts index 78fe6f5da..970fedb37 100644 --- a/editors/code/src/util.ts +++ b/editors/code/src/util.ts | |||
@@ -1,5 +1,4 @@ | |||
1 | import * as lc from "vscode-languageclient"; | 1 | import * as lc from "vscode-languageclient"; |
2 | import * as fs from "fs"; | ||
3 | import * as vscode from "vscode"; | 2 | import * as vscode from "vscode"; |
4 | import { strict as nativeAssert } from "assert"; | 3 | import { strict as nativeAssert } from "assert"; |
5 | import { spawnSync } from "child_process"; | 4 | import { spawnSync } from "child_process"; |
@@ -114,15 +113,12 @@ export function isRustEditor(editor: vscode.TextEditor): editor is RustEditor { | |||
114 | export function isValidExecutable(path: string): boolean { | 113 | export function isValidExecutable(path: string): boolean { |
115 | log.debug("Checking availability of a binary at", path); | 114 | log.debug("Checking availability of a binary at", path); |
116 | 115 | ||
117 | if (!fs.existsSync(path)) return false; | ||
118 | |||
119 | const res = spawnSync(path, ["--version"], { encoding: 'utf8' }); | 116 | const res = spawnSync(path, ["--version"], { encoding: 'utf8' }); |
120 | 117 | ||
121 | const isSuccess = res.status === 0; | 118 | const printOutput = res.error && (res.error as any).code !== 'ENOENT' ? log.warn : log.debug; |
122 | const printOutput = isSuccess ? log.debug : log.warn; | ||
123 | printOutput(path, "--version:", res); | 119 | printOutput(path, "--version:", res); |
124 | 120 | ||
125 | return isSuccess; | 121 | return res.status === 0; |
126 | } | 122 | } |
127 | 123 | ||
128 | /** Sets ['when'](https://code.visualstudio.com/docs/getstarted/keybindings#_when-clause-contexts) clause contexts */ | 124 | /** Sets ['when'](https://code.visualstudio.com/docs/getstarted/keybindings#_when-clause-contexts) clause contexts */ |
diff --git a/editors/code/tests/unit/index.ts b/editors/code/tests/unit/index.ts index 5165720b4..b7d8d2144 100644 --- a/editors/code/tests/unit/index.ts +++ b/editors/code/tests/unit/index.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import * as path from 'path'; | 1 | import * as path from 'path'; |
2 | import Mocha from 'mocha'; | 2 | import * as Mocha from 'mocha'; |
3 | import glob from 'glob'; | 3 | import * as glob from 'glob'; |
4 | 4 | ||
5 | export function run(): Promise<void> { | 5 | export function run(): Promise<void> { |
6 | // Create the mocha test | 6 | // Create the mocha test |
diff --git a/editors/code/tsconfig.json b/editors/code/tsconfig.json index 32d1a865f..c9f348241 100644 --- a/editors/code/tsconfig.json +++ b/editors/code/tsconfig.json | |||
@@ -6,8 +6,6 @@ | |||
6 | "lib": [ | 6 | "lib": [ |
7 | "es2019" | 7 | "es2019" |
8 | ], | 8 | ], |
9 | "esModuleInterop": true, | ||
10 | "allowSyntheticDefaultImports": true, | ||
11 | "sourceMap": true, | 9 | "sourceMap": true, |
12 | "rootDir": ".", | 10 | "rootDir": ".", |
13 | "strict": true, | 11 | "strict": true, |