allow for user to toggle lsp_diag underline (#221)

Co-authored-by: Patrick Artounian <patrick.artounian@insomniac.com>
This commit is contained in:
Patrick Artounian 2022-09-27 15:28:05 -07:00 committed by GitHub
parent 24270e540b
commit 0e3a10f595
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 3 deletions

View File

@ -638,6 +638,7 @@ require('go').setup({
-- end -- end
-- to setup a table of codelens -- to setup a table of codelens
lsp_diag_hdlr = true, -- hook lsp diag handler lsp_diag_hdlr = true, -- hook lsp diag handler
lsp_diag_underline = true,
-- virtual text setup -- virtual text setup
lsp_diag_virtual_text = { space = 0, prefix = "" }, lsp_diag_virtual_text = { space = 0, prefix = "" },
lsp_diag_signs = true, lsp_diag_signs = true,

View File

@ -42,6 +42,7 @@ _GO_NVIM_CFG = {
lsp_keymaps = true, -- true: use default keymaps defined in go/lsp.lua lsp_keymaps = true, -- true: use default keymaps defined in go/lsp.lua
lsp_codelens = true, lsp_codelens = true,
lsp_diag_hdlr = true, -- hook lsp diag handler lsp_diag_hdlr = true, -- hook lsp diag handler
lsp_diag_underline = true,
-- virtual text setup -- virtual text setup
lsp_diag_virtual_text = { space = 0, prefix = "" }, lsp_diag_virtual_text = { space = 0, prefix = "" },
lsp_diag_signs = true, lsp_diag_signs = true,

View File

@ -52,9 +52,9 @@ if nvim_0_6 then
diag_hdlr = diag_hdlr_0_6 diag_hdlr = diag_hdlr_0_6
end end
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(diag_hdlr, { vim.lsp.handlers['textDocument/publishDiagnostics'] = vim.lsp.with(diag_hdlr, {
-- Enable underline, use default values -- Enable underline, use default values
underline = true, underline = _GO_NVIM_CFG.lsp_diag_underline,
-- Enable virtual text, override spacing to 0 -- Enable virtual text, override spacing to 0
virtual_text = _GO_NVIM_CFG.lsp_diag_virtual_text, virtual_text = _GO_NVIM_CFG.lsp_diag_virtual_text,
-- Use a function to dynamically turn signs off -- Use a function to dynamically turn signs off