fix: lsp should work now
This commit is contained in:
parent
deaec8094b
commit
e032be0118
1 changed files with 4 additions and 6 deletions
|
|
@ -105,6 +105,7 @@ local function send_did_change(bufnr, client_id)
|
|||
})
|
||||
end
|
||||
|
||||
-- Use vim.wait to allow the event loop to process LSP diagnostics
|
||||
local function wait_for_diagnostics(bufnr, timeout_ms)
|
||||
local done = false
|
||||
local result_diags = {}
|
||||
|
|
@ -121,12 +122,9 @@ local function wait_for_diagnostics(bufnr, timeout_ms)
|
|||
end
|
||||
})
|
||||
|
||||
local waited = 0
|
||||
local interval = 50
|
||||
while not done and waited < timeout_ms do
|
||||
vim.cmd(("sleep %d m"):format(interval))
|
||||
waited = waited + interval
|
||||
end
|
||||
vim.wait(timeout_ms, function()
|
||||
return done
|
||||
end, 50)
|
||||
|
||||
pcall(api.nvim_del_augroup_by_id, augrp)
|
||||
return result_diags
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue