lsp: Force re-display of diagnostics when opening a file

This commit is contained in:
TJ DeVries 2021-03-22 10:21:56 -04:00
parent 070e084a64
commit 880fb0d146

View File

@ -293,6 +293,19 @@ local function text_document_did_open_handler(bufnr, client)
}
client.notify('textDocument/didOpen', params)
util.buf_versions[bufnr] = params.textDocument.version
-- Next chance we get, we should re-do the diagnostics
vim.schedule(function()
vim.lsp.handlers["textDocument/publishDiagnostics"](
nil,
"textDocument/publishDiagnostics",
{
diagnostics = vim.lsp.diagnostic.get(bufnr, client.id),
uri = vim.uri_from_bufnr(bufnr),
},
client.id
)
end)
end
-- FIXME: DOC: Shouldn't need to use a dummy function