Skip to content

Commit

Permalink
fix(lsp): ERROR diagnostics should have higher priority than INFO
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangyinzuo committed Apr 11, 2024
1 parent 5cd1c50 commit 3554e13
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion root/.config/nvim/lua/lsp/diagnostic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ local function create_floating_window_autocmd()
})
end

vim.g.nvim_lsp_diagnostic_enable_auto_floating_window = vim.fn.get(vim.g, 'nvim_lsp_diagnostic_enable_auto_floating_window', false)
if vim.g.nvim_lsp_diagnostic_enable_auto_floating_window == nil then
vim.g.nvim_lsp_diagnostic_enable_auto_floating_window = true
end
local function toggle_auto_floating_window()
if vim.g.nvim_lsp_diagnostic_enable_auto_floating_window then
vim.api.nvim_del_augroup_by_name("nvim_lsp_floating_window")
Expand Down
2 changes: 2 additions & 0 deletions root/.config/nvim/lua/lsp/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ function M.lspconfig()
vim.diagnostic.config({
-- virtual text is too noisy!
virtual_text = false,
-- ERROR 比 INFO优先级更高显示
severity_sort = true,
})
end,
})
Expand Down

0 comments on commit 3554e13

Please sign in to comment.