mirror of
https://github.com/neovim/neovim.git
synced 2026-04-20 06:20:53 +00:00
feat(diagnostic): add option to include diagnostic source
Add an option to virtual text display and floating window previews to include diagnostic source in the diagnostic message.
This commit is contained in:
@@ -103,6 +103,7 @@ local function diagnostic_lsp_to_vim(diagnostics, bufnr, client_id)
|
||||
end_col = line_byte_from_position(buf_lines, _end.line, _end.character, offset_encoding),
|
||||
severity = severity_lsp_to_vim(diagnostic.severity),
|
||||
message = diagnostic.message,
|
||||
source = diagnostic.source,
|
||||
user_data = {
|
||||
lsp = {
|
||||
code = diagnostic.code,
|
||||
@@ -132,6 +133,7 @@ local function diagnostic_vim_to_lsp(diagnostics)
|
||||
},
|
||||
severity = severity_vim_to_lsp(diagnostic.severity),
|
||||
message = diagnostic.message,
|
||||
source = diagnostic.source,
|
||||
}, diagnostic.user_data and (diagnostic.user_data.lsp or {}) or {})
|
||||
end, diagnostics)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user