Problem X you are solving:
vim.diagnostic.config allows for diagnostics customization (with, for example, float.format or format.suffix). However, right now is not possible to acomodate the diagnostic.code value as it's not available with the current plugin implementation.
Problems encountered under the status quo:
Right now diagnostic.code is merged into the message (
|
local function formulate_msg(msg, code) |
), allowing less message customization.
Suggested feature Y:
Add the code field into diag_fmt instead of in the message. vim.Diagnostic does have a code key (as it extends vim.Diagnostic.Set)
How to solve X now:
Not possible without manually parsing the code from the message with string manipulation.
How can X be solved after feature Y is implmented:
vim.diagnostic.config({
float = {
suffix = function(d)
return string.format('[%s: %s]', d.source, d.code), '' -- d.code is `nil` now
end,
},
})
Problem X you are solving:
vim.diagnostic.configallows for diagnostics customization (with, for example,float.formatorformat.suffix). However, right now is not possible to acomodate thediagnostic.codevalue as it's not available with the current plugin implementation.Problems encountered under the status quo:
Right now
diagnostic.codeis merged into the message (guard.nvim/lua/guard/lint.lua
Line 191 in c1d2b66
Suggested feature Y:
Add the
codefield intodiag_fmtinstead of in the message.vim.Diagnosticdoes have acodekey (as it extendsvim.Diagnostic.Set)How to solve X now:
Not possible without manually parsing the code from the message with string manipulation.
How can X be solved after feature Y is implmented: