issue #156 Can't disable virutal text

serverCapcities
ray-x 2 years ago
parent 77dd031f8a
commit 7f22411b1f

@ -33,7 +33,7 @@ _NgConfigValues = {
transparency = 50, -- 0 ~ 100 blur the main window, 100: fully transparent, 0: opaque, set to nil to disable it
lsp_signature_help = true, -- if you would like to hook ray-x/lsp_signature plugin in navigator
-- setup here. if it is nil, navigator will not init signature help
signature_help_cfg = {debug=false}, -- if you would like to init ray-x/lsp_signature plugin in navigator, pass in signature help
signature_help_cfg = { debug = false }, -- if you would like to init ray-x/lsp_signature plugin in navigator, pass in signature help
lsp = {
code_action = {
enable = true,
@ -51,7 +51,7 @@ _NgConfigValues = {
},
diagnostic = {
underline = true,
virtual_text = { spacing = 3 }, -- show virtual for diagnostic message
virtual_text = { spacing = 3, source = true }, -- show virtual for diagnostic message
update_in_insert = false, -- update diagnostic message in insert mode
severity_sort = { reverse = true },
},

@ -36,11 +36,7 @@ end
local diagnostic_cfg = {
-- Enable underline, use default values
underline = _NgConfigValues.lsp.diagnostic.underline,
-- Enable virtual text, override spacing to 3 (prevent overlap)
virtual_text = {
spacing = _NgConfigValues.lsp.diagnostic.virtual_text.spacing,
prefix = _NgConfigValues.icons.diagnostic_virtual_text,
},
-- Enable virtual
-- Use a function to dynamically turn signs off
-- and on, using buffer local variables
signs = true,
@ -327,10 +323,11 @@ local diag_hdlr_async = function()
end
local M = {}
if _NgConfigValues.lsp.diagnostic.virtual_text == false then
diagnostic_cfg.virtual_text = false
end
diagnostic_cfg.virtual_text = _NgConfigValues.lsp.diagnostic.virtual_text
if type(_NgConfigValues.lsp.diagnostic.virtual_text) == 'table' then
diagnostic_cfg.virtual_text.prefix = _NgConfigValues.icons.diagnostic_virtual_text
end
-- vim.lsp.handlers["textDocument/publishDiagnostics"]
M.diagnostic_handler = vim.lsp.with(diag_hdlr, diagnostic_cfg)

Loading…
Cancel
Save