File tree 1 file changed +10
-1
lines changed
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,15 @@ local RustaceanConfig
10
10
local rustaceanvim = vim .g .rustaceanvim or {}
11
11
local rustaceanvim_opts = type (rustaceanvim ) == ' function' and rustaceanvim () or rustaceanvim
12
12
13
+ --- Wrapper around |vim.fn.exepath()| that returns the binary if no path is found.
14
+ --- @param binary string
15
+ --- @return string the full path to the executable or ` binary` if no path is found.
16
+ --- @see vim.fn.exepath ()
17
+ local function exepath_or_binary (binary )
18
+ local exe_path = vim .fn .exepath (binary )
19
+ return # exe_path > 0 and exe_path or binary
20
+ end
21
+
13
22
--- @class rustaceanvim.internal.RAInitializedStatus : rustaceanvim.RAInitializedStatus
14
23
--- @field health rustaceanvim.lsp_server_health_status
15
24
--- @field quiescent boolean inactive ?
@@ -283,7 +292,7 @@ local RustaceanDefaultConfig = {
283
292
end ,
284
293
--- @type string[] | fun ():( string[] | fun ( dispatchers : vim.lsp.rpc.Dispatchers ): vim.lsp.rpc.PublicClient )
285
294
cmd = function ()
286
- return { ' rust-analyzer' , ' --log-file' , RustaceanConfig .server .logfile }
295
+ return { exepath_or_binary ( ' rust-analyzer' ) , ' --log-file' , RustaceanConfig .server .logfile }
287
296
end ,
288
297
289
298
--- @type string | fun ( filename : string , default : fun ( filename : string ): string | nil ): string | nil
You can’t perform that action at this time.
0 commit comments