Skip to content
This repository has been archived by the owner on May 25, 2023. It is now read-only.

Commit

Permalink
Merge pull request ayamir#706 from ayamir/feat/inline-diagnostic
Browse files Browse the repository at this point in the history
feat: add setting option for inline_diagnostic_virtual_text.
  • Loading branch information
ayamir authored May 4, 2023
2 parents 3be4c9b + 8e46555 commit 925613d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
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

0 comments on commit 925613d

Please sign in to comment.