diff options
author | Abouzar Parvan <[email protected]> | 2021-09-08 16:38:57 +0430 |
---|---|---|
committer | GitHub <[email protected]> | 2021-09-08 16:38:57 +0430 |
commit | f338f3577ce0b842f6592cde544ffac37c17c75d (patch) | |
tree | ab60352746697eb497ae81c0b69c736a1a9f4d4f | |
parent | 8c83b403ef833101a93b53cc232368424b3dff9b (diff) |
show correct inline diagnostics in neovim 0.6 (#1502)
-rw-r--r-- | lua/lsp/handlers.lua | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/lua/lsp/handlers.lua b/lua/lsp/handlers.lua index 2efa8d10..84811581 100644 --- a/lua/lsp/handlers.lua +++ b/lua/lsp/handlers.lua @@ -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 |