-
-
Notifications
You must be signed in to change notification settings - Fork 27
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
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 (
Line 191 in c1d2b66
| local function formulate_msg(msg, code) |
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,
},
})
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request