@@ -167,7 +167,7 @@ local function maybe_implicit_save()
167
167
end
168
168
169
169
170
- --- @return string ?, lsp.Client ?
170
+ --- @return string ?, vim. lsp.Client?
171
171
local function extract_data_dir (bufnr )
172
172
-- Prefer client from current buffer, in case there are multiple jdtls clients (multiple projects)
173
173
local client = get_clients ({ name = " jdtls" , bufnr = bufnr })[1 ]
264
264
---
265
265
--- @param config table<string , any> configuration. See | vim.lsp.start_client |
266
266
--- @param opts ? jdtls.start.opts
267
- --- @param start_opts ? lsp.StartOpts options passed to vim.lsp.start
267
+ --- @param start_opts ? vim. lsp.start.Opts ? options passed to vim.lsp.start
268
268
--- @return integer ? client_id
269
269
function M .start_or_attach (config , opts , start_opts )
270
270
opts = opts or {}
@@ -370,7 +370,12 @@ function M.wipe_data_and_restart()
370
370
return vim .lsp .get_client_by_id (client .id ) == nil
371
371
end )
372
372
vim .fn .delete (data_dir , ' rf' )
373
- local client_id = lsp .start_client (client .config )
373
+ local client_id
374
+ if vim .bo .filetype == " java" then
375
+ client_id = lsp .start (client .config )
376
+ else
377
+ client_id = vim .lsp .start_client (client .config )
378
+ end
374
379
if client_id then
375
380
for _ , buf in ipairs (bufs ) do
376
381
lsp .buf_attach_client (buf , client_id )
0 commit comments