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
|
end
|
||||||
|
|
||||||
|
-- Use vim.wait to allow the event loop to process LSP diagnostics
|
||||||
local function wait_for_diagnostics(bufnr, timeout_ms)
|
local function wait_for_diagnostics(bufnr, timeout_ms)
|
||||||
local done = false
|
local done = false
|
||||||
local result_diags = {}
|
local result_diags = {}
|
||||||
|
|
@ -121,12 +122,9 @@ local function wait_for_diagnostics(bufnr, timeout_ms)
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
local waited = 0
|
vim.wait(timeout_ms, function()
|
||||||
local interval = 50
|
return done
|
||||||
while not done and waited < timeout_ms do
|
end, 50)
|
||||||
vim.cmd(("sleep %d m"):format(interval))
|
|
||||||
waited = waited + interval
|
|
||||||
end
|
|
||||||
|
|
||||||
pcall(api.nvim_del_augroup_by_id, augrp)
|
pcall(api.nvim_del_augroup_by_id, augrp)
|
||||||
return result_diags
|
return result_diags
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue