Mercurial > dotfiles
comparison dot_config/nvim/init.lua @ 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 | 85832377f39e |
comparison
equal
deleted
inserted
replaced
412:ad54efacea8a | 413:32f1aecb9d01 |
---|---|
408 { texthl = 'LspDiagnosticsSignHint', linehl = '', numhl = '', text = '▎' } | 408 { texthl = 'LspDiagnosticsSignHint', linehl = '', numhl = '', text = '▎' } |
409 ) | 409 ) |
410 | 410 |
411 vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(vim.lsp.handlers.hover, { border = 'single' }) | 411 vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(vim.lsp.handlers.hover, { border = 'single' }) |
412 vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with(vim.lsp.handlers.hover, { border = 'single' }) | 412 vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with(vim.lsp.handlers.hover, { border = 'single' }) |
413 end | 413 vim.lsp.handlers['textDocument/publishDiagnostics'] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { |
414 | 414 underline = true, |
415 vim.lsp.handlers['textDocument/formatting'] = function(err, _, result, _, bufnr) | 415 update_in_insert = false, |
416 if err ~= nil or result == nil then | 416 virtual_text = { severity_limit = 'Warning' }, |
417 return | 417 }) |
418 end | |
419 if not vim.api.nvim_buf_get_option(bufnr, 'modified') then | |
420 local view = vim.fn.winsaveview() | |
421 vim.lsp.util.apply_text_edits(result, bufnr) | |
422 -- Fix to reload Treesitter | |
423 -- vim.api.nvim_command("edit") | |
424 vim.fn.winrestview(view) | |
425 end | |
426 end | |
427 | |
428 vim.lsp.handlers['textDocument/publishDiagnostics'] = function(...) | |
429 vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { underline = true, update_in_insert = false })(...) | |
430 end | 418 end |
431 | 419 |
432 local capabilities = vim.lsp.protocol.make_client_capabilities() | 420 local capabilities = vim.lsp.protocol.make_client_capabilities() |
433 capabilities.textDocument.completion.completionItem.snippetSupport = true | 421 capabilities.textDocument.completion.completionItem.snippetSupport = true |
434 capabilities.textDocument.completion.completionItem.resolveSupport = { | 422 capabilities.textDocument.completion.completionItem.resolveSupport = { |