diff options
author | Michael Lingelbach <m.j.lbach@gmail.com> | 2021-09-21 18:32:32 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-21 18:32:32 -0700 |
commit | e8fb0728e220bb378a8689415c3915fe5912e987 (patch) | |
tree | 0b43a64610da654a2de942a418a10e265ead5868 /runtime/lua/vim/lsp/diagnostic.lua | |
parent | 17b7968f02bca309bb2e7b00752667baa6b4d765 (diff) | |
parent | bc652f148f6bb03511e36a0d9c3e383bb22abcfa (diff) | |
download | rneovim-e8fb0728e220bb378a8689415c3915fe5912e987.tar.gz rneovim-e8fb0728e220bb378a8689415c3915fe5912e987.tar.bz2 rneovim-e8fb0728e220bb378a8689415c3915fe5912e987.zip |
Merge pull request #15717 from gpanders/diagnostic-include-source
feat(diagnostic): add option to include diagnostic source
Diffstat (limited to 'runtime/lua/vim/lsp/diagnostic.lua')
-rw-r--r-- | runtime/lua/vim/lsp/diagnostic.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/runtime/lua/vim/lsp/diagnostic.lua b/runtime/lua/vim/lsp/diagnostic.lua index a9d93ae65f..c6c08a15d3 100644 --- a/runtime/lua/vim/lsp/diagnostic.lua +++ b/runtime/lua/vim/lsp/diagnostic.lua @@ -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 @@ -527,7 +529,7 @@ end ---@return an array of [text, hl_group] arrays. This can be passed directly to --- the {virt_text} option of |nvim_buf_set_extmark()|. function M.get_virtual_text_chunks_for_line(bufnr, _, line_diags, opts) - return vim.diagnostic.get_virt_text_chunks(diagnostic_lsp_to_vim(line_diags, bufnr), opts) + return vim.diagnostic._get_virt_text_chunks(diagnostic_lsp_to_vim(line_diags, bufnr), opts) end --- Open a floating window with the diagnostics from {position} |