File tree 1 file changed +13
-2
lines changed
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -199,8 +199,19 @@ M.start = function(bufnr)
199
199
end
200
200
201
201
local rust_analyzer_cmd = types .evaluate (client_config .cmd )
202
- if # rust_analyzer_cmd == 0 or vim .fn .executable (rust_analyzer_cmd [1 ]) ~= 1 then
203
- vim .notify (' rust-analyzer binary not found.' , vim .log .levels .ERROR )
202
+ -- special case: rust-analyzer has a `rust-analyzer.server.path` config option
203
+ -- that allows you to override the path via .vscode/settings.json
204
+ local server_path = vim .tbl_get (lsp_start_config .settings , ' rust-analyzer' , ' server' , ' path' )
205
+ if type (server_path ) == ' string' then
206
+ rust_analyzer_cmd [1 ] = server_path
207
+ --
208
+ end
209
+ if # rust_analyzer_cmd == 0 then
210
+ vim .notify (' rust-analyzer command is not set!' , vim .log .levels .ERROR )
211
+ return
212
+ end
213
+ if vim .fn .executable (rust_analyzer_cmd [1 ]) ~= 1 then
214
+ vim .notify ((' %s is not executable' ):format (rust_analyzer_cmd [1 ]), vim .log .levels .ERROR )
204
215
return
205
216
end
206
217
--- @cast rust_analyzer_cmd string[]
You can’t perform that action at this time.
0 commit comments