Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add setting option for inline_diagnostic_virtual_text. #706

Merged
merged 1 commit into from
May 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lua/core/settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,8 @@ settings["null_ls_deps"] = {
"vint",
}

-- Set the inline_diagnostic_virtual_text to false if they are annoying for you
---@type boolean
settings["inline_diagnostic_virtual_text"] = true

return settings
8 changes: 8 additions & 0 deletions lua/modules/configs/completion/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ return function()
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities)

vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {
signs = true,
underline = true,
virtual_text = require("core.settings").inline_diagnostic_virtual_text,
-- set update_in_insert to false bacause it was enabled by lspsaga
update_in_insert = false,
})

local opts = {
on_attach = function()
require("lsp_signature").on_attach({
Expand Down