File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change 11import * as lc from "vscode-languageclient" ;
2- import * as fs from "fs" ;
32import * as vscode from "vscode" ;
43import { strict as nativeAssert } from "assert" ;
54import { spawnSync } from "child_process" ;
@@ -114,15 +113,12 @@ export function isRustEditor(editor: vscode.TextEditor): editor is RustEditor {
114113export function isValidExecutable ( path : string ) : boolean {
115114 log . debug ( "Checking availability of a binary at" , path ) ;
116115
117- if ( ! fs . existsSync ( path ) ) return false ;
118-
119116 const res = spawnSync ( path , [ "--version" ] , { encoding : 'utf8' } ) ;
120117
121- const isSuccess = res . status === 0 ;
122- const printOutput = isSuccess ? log . debug : log . warn ;
118+ const printOutput = res . error && ( res . error as any ) . code !== 'ENOENT' ? log . warn : log . debug ;
123119 printOutput ( path , "--version:" , res ) ;
124120
125- return isSuccess ;
121+ return res . status === 0 ;
126122}
127123
128124/** Sets ['when'](https://code.visualstudio.com/docs/getstarted/keybindings#_when-clause-contexts) clause contexts */
You can’t perform that action at this time.
0 commit comments