mirror of
https://github.com/LunarVim/LunarVim.git
synced 2025-08-31 07:09:23 +02:00
show correct inline diagnostics in neovim 0.6 (#1502)
This commit is contained in:
parent
8c83b403ef
commit
f338f3577c
1 changed files with 2 additions and 8 deletions
|
@ -3,12 +3,6 @@
|
|||
local M = {}
|
||||
|
||||
function M.setup()
|
||||
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {
|
||||
virtual_text = lvim.lsp.diagnostics.virtual_text,
|
||||
signs = lvim.lsp.diagnostics.signs.active,
|
||||
underline = lvim.lsp.document_highlight,
|
||||
})
|
||||
|
||||
local config = { -- your config
|
||||
virtual_text = lvim.lsp.diagnostics.virtual_text,
|
||||
signs = lvim.lsp.diagnostics.signs,
|
||||
|
@ -19,13 +13,13 @@ function M.setup()
|
|||
if vim.fn.has "nvim-0.5.1" > 0 then
|
||||
vim.lsp.handlers["textDocument/publishDiagnostics"] = function(_, result, ctx, _)
|
||||
local uri = result.uri
|
||||
local bufnr = ctx.bufnr
|
||||
local bufnr = vim.uri_to_bufnr(uri)
|
||||
if not bufnr then
|
||||
return
|
||||
end
|
||||
|
||||
local diagnostics = result.diagnostics
|
||||
vim.lsp.diagnostic.save(diagnostics, ctx.bufnr, ctx.client_id)
|
||||
vim.lsp.diagnostic.save(diagnostics, bufnr, ctx.client_id)
|
||||
if not vim.api.nvim_buf_is_loaded(bufnr) then
|
||||
return
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue