feat(diagnostics): clean up virtual text formatting
This commit is contained in:
parent
b389390db5
commit
3fd2ede233
2 changed files with 17 additions and 7 deletions
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"Comment.nvim": { "branch": "master", "commit": "e89df176e8b38e931b7e71a470f923a317976d86" },
|
||||
"LuaSnip": { "branch": "master", "commit": "5d57303efde86fcb0959c52b1a6d40f923940f34" },
|
||||
"SchemaStore.nvim": { "branch": "main", "commit": "c55c35929dd4e670af7ab6e2e197a4687baa2076" },
|
||||
"SchemaStore.nvim": { "branch": "main", "commit": "3c255ca48c019fb4c947ace820f3ebf06e4e8b64" },
|
||||
"auto-session": { "branch": "main", "commit": "c8b2f4048f846387361bd04cc185bf1aa7d2e3d1" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||
"cmp-cmdline": { "branch": "main", "commit": "23c51b2a3c00f6abc4e922dbd7c3b9aca6992063" },
|
||||
|
@ -16,8 +16,8 @@
|
|||
"lsp_lines.nvim": { "branch": "main", "commit": "ec98b45c8280e5ef8c84028d4f38aa447276c002" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "d8c392dd75778d6258da4e7c55522e94ac389732" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "3751eb5c56c67b51e68a1f4a0da28ae74ab771c1" },
|
||||
"mason.nvim": { "branch": "main", "commit": "ca8afdf6f44e70461c113d89e7718154c65d2e97" },
|
||||
"noice.nvim": { "branch": "main", "commit": "567ad5b7cb0b96af89c6b7a8184284db48375aa3" },
|
||||
"mason.nvim": { "branch": "main", "commit": "c609775d1fc5ae18aadc92b8b65be9c9b1980004" },
|
||||
"noice.nvim": { "branch": "main", "commit": "2613a16b5009acbf2adabb34b029b1c4c57101e3" },
|
||||
"nui.nvim": { "branch": "main", "commit": "257da38029d3859ed111804f9d4e95b0fa993a31" },
|
||||
"null-ls.nvim": { "branch": "main", "commit": "915558963709ea17c5aa246ca1c9786bfee6ddb4" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "f00eb3b766c370cb34fdabc29c760338ba9e4c6c" },
|
||||
|
@ -27,7 +27,7 @@
|
|||
"nvim-lspconfig": { "branch": "master", "commit": "7b98aadc6e85db4fc3af6c1ec22c4774d965506e" },
|
||||
"nvim-notify": { "branch": "master", "commit": "b005821516f1f37801a73067afd1cef2dbc4dfe8" },
|
||||
"nvim-tree.lua": { "branch": "master", "commit": "3ce0a8e770f70a135ef969e0a640bd8d05baf42c" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "5b1299868302184f2e15819a719df698ad1aa251" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "be0b3ba1b90b2aa5c78ff7a5798d477a744e5cbe" },
|
||||
"nvim-treesitter-refactor": { "branch": "master", "commit": "75f5895cc662d61eb919da8050b7a0124400d589" },
|
||||
"nvim-ts-autotag": { "branch": "main", "commit": "fdefe46c6807441460f11f11a167a2baf8e4534b" },
|
||||
"nvim-ts-context-commentstring": { "branch": "main", "commit": "4a42b30376c1bd625ab5016c2079631d531d797a" },
|
||||
|
|
|
@ -8,12 +8,22 @@ local function format_diagnostic(diagnostic)
|
|||
icon = icons.warn
|
||||
end
|
||||
|
||||
if diagnostic.severity == vim.diagnostic.severity.INFO then
|
||||
icon = icons.info
|
||||
end
|
||||
|
||||
if diagnostic.severity == vim.diagnostic.severity.HINT then
|
||||
icon = icons.hint
|
||||
end
|
||||
|
||||
local message = string.format(' %s [%s][%s] %s', icon, diagnostic.code, diagnostic.source, diagnostic.message)
|
||||
return message
|
||||
local message = string.format('%s %s', icon, diagnostic.message)
|
||||
if diagnostic.code and diagnostic.source then
|
||||
message = string.format('%s [%s][%s] %s', icon, diagnostic.source, diagnostic.code, diagnostic.message)
|
||||
elseif diagnostic.code or diagnostic.source then
|
||||
message = string.format('%s [%s] %s', icon, diagnostic.source or diagnostic.code, diagnostic.message)
|
||||
end
|
||||
|
||||
return message .. ' '
|
||||
end
|
||||
|
||||
local config = u.merge({
|
||||
|
@ -30,7 +40,7 @@ local config = u.merge({
|
|||
format = format_diagnostic,
|
||||
},
|
||||
virtual_text = {
|
||||
prefix = '•',
|
||||
prefix = '',
|
||||
spacing = 2,
|
||||
source = false,
|
||||
severity = {
|
||||
|
|
Loading…
Add table
Reference in a new issue