Mercurial > dotfiles
changeset 413:32f1aecb9d01
Only show virtual_text diagnostics for Warnings or worse
author | zegervdv <zegervdv@me.com> |
---|---|
date | Sun, 18 Jul 2021 09:49:12 +0200 |
parents | ad54efacea8a |
children | 7004867c436c |
files | dot_config/nvim/init.lua |
diffstat | 1 files changed, 5 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/dot_config/nvim/init.lua Sun Jul 18 09:31:34 2021 +0200 +++ b/dot_config/nvim/init.lua Sun Jul 18 09:49:12 2021 +0200 @@ -410,23 +410,11 @@ vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(vim.lsp.handlers.hover, { border = 'single' }) vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with(vim.lsp.handlers.hover, { border = 'single' }) -end - -vim.lsp.handlers['textDocument/formatting'] = function(err, _, result, _, bufnr) - if err ~= nil or result == nil then - return - end - if not vim.api.nvim_buf_get_option(bufnr, 'modified') then - local view = vim.fn.winsaveview() - vim.lsp.util.apply_text_edits(result, bufnr) - -- Fix to reload Treesitter - -- vim.api.nvim_command("edit") - vim.fn.winrestview(view) - end -end - -vim.lsp.handlers['textDocument/publishDiagnostics'] = function(...) - vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { underline = true, update_in_insert = false })(...) + vim.lsp.handlers['textDocument/publishDiagnostics'] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { + underline = true, + update_in_insert = false, + virtual_text = { severity_limit = 'Warning' }, + }) end local capabilities = vim.lsp.protocol.make_client_capabilities()