File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -211,18 +211,25 @@ local function prepare_client_config(overrides)
211211 M .startup_error = nil
212212
213213 local server_path = nil
214- local node_cmd = " "
215- if M .server .type == " nodejs" then
216- node_cmd = lsp_nodesj .node_command
217- server_path = lsp_nodesj .get_server_path ()
218- elseif M .server .type == " binary" then
219- server_path = lsp_binary .get_server_path ()
220- end
214+ local cmd = nil
221215
222216 if M .server .custom_server_filepath and vim .fn .filereadable (M .server .custom_server_filepath ) then
223217 server_path = M .server .custom_server_filepath
224218 end
225219
220+ if M .server .type == " nodejs" then
221+ cmd = {
222+ lsp_nodesj .node_command ,
223+ server_path or lsp_nodesj .get_server_path (),
224+ " --stdio" ,
225+ }
226+ elseif M .server .type == " binary" then
227+ cmd = {
228+ server_path or lsp_binary .get_server_path (),
229+ " --stdio" ,
230+ }
231+ end
232+
226233 local capabilities = vim .lsp .protocol .make_client_capabilities () --[[ @as copilot_capabilities]]
227234 capabilities .window .showDocument .support = true
228235
@@ -285,11 +292,7 @@ local function prepare_client_config(overrides)
285292
286293 -- LSP config, not to be confused with config.lua
287294 return vim .tbl_deep_extend (" force" , {
288- cmd = {
289- node_cmd ,
290- server_path ,
291- " --stdio" ,
292- },
295+ cmd = cmd ,
293296 root_dir = root_dir ,
294297 name = " copilot" ,
295298 capabilities = capabilities ,
You can’t perform that action at this time.
0 commit comments