vim-lsp
vim-lsp copied to clipboard
Automatically update diagnostics location list
Is there a way to automatically update the diagnostics location list as I type? Currently it seems the behavior is that I've to manually invoke :LspDocumentDiagnostics
in order to update the location list with new diagnostics.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
ping on this, i was wondering the best way to do this as well.
I imagine this doesn't handle some edge cases correctly, but it's working well for me:
M.au_loclist = "BukzorLspLocList"
function M.update_loclist_if_visible()
local loclist = vim.fn.getloclist(0, { winid = 0 })
if loclist.winid ~= 0 then
vim.diagnostic.setloclist()
end
end
function M.setup_loclist_update()
vim.api.nvim_create_augroup(M.au_loclist, { clear = true })
vim.api.nvim_create_autocmd("DiagnosticChanged", {
group = M.au_loclist,
callback = M.update_loclist_if_visible,
})
end
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
+1 from me - I can get this from ALE (which I use alongside this), so it isn't a deal breaker, but it seems an obvious "win" for the "one true vim way" ;-)
Easily the feature I'd like to see the most from this package.
I'm curious, though: why do folks run both vim-lsp and ALE at the same time?