File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -67,16 +67,20 @@ type InstallStatus = {
67
67
// If not, offer to install one. If so, check for updates.
68
68
export async function prepare ( ui : UI ,
69
69
checkUpdate : boolean ) : Promise < InstallStatus > {
70
+ let clangdPath = ui . clangdPath ;
70
71
try {
71
- var absPath = await promisify ( which ) ( ui . clangdPath ) as string ;
72
+ if ( path . isAbsolute ( clangdPath ) ) {
73
+ await promisify ( fs . access ) ( clangdPath ) ;
74
+ } else {
75
+ clangdPath = await promisify ( which ) ( clangdPath ) as string ;
76
+ }
72
77
} catch ( e ) {
73
- // Couldn't find clangd - start recovery flow and stop extension
74
- // loading.
78
+ // Couldn't find clangd - start recovery flow and stop extension loading.
75
79
return { clangdPath : null , background : recover ( ui ) } ;
76
80
}
77
81
// Allow extension to load, asynchronously check for updates.
78
82
return {
79
- clangdPath : absPath ,
83
+ clangdPath,
80
84
background : checkUpdate ? checkUpdates ( /*requested=*/ false , ui )
81
85
: Promise . resolve ( )
82
86
} ;
You can’t perform that action at this time.
0 commit comments