diff options
author | Maria José Solano <majosolano99@gmail.com> | 2024-08-26 08:35:43 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-26 17:35:43 +0200 |
commit | 0e394f136fcb030358dbc1e94a0a38a03b4b7dbf (patch) | |
tree | 7804ee129b4e34de4ddd445aa39b42cabe74ae78 /runtime/lua/vim | |
parent | 983953858e5610b104d35725c7da1e9025f60421 (diff) | |
download | rneovim-0e394f136fcb030358dbc1e94a0a38a03b4b7dbf.tar.gz rneovim-0e394f136fcb030358dbc1e94a0a38a03b4b7dbf.tar.bz2 rneovim-0e394f136fcb030358dbc1e94a0a38a03b4b7dbf.zip |
fix(lsp): log when receiving markup messages (#30065)
Diffstat (limited to 'runtime/lua/vim')
-rw-r--r-- | runtime/lua/vim/lsp/diagnostic.lua | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/runtime/lua/vim/lsp/diagnostic.lua b/runtime/lua/vim/lsp/diagnostic.lua index 5ed42700e3..ff52b40d60 100644 --- a/runtime/lua/vim/lsp/diagnostic.lua +++ b/runtime/lua/vim/lsp/diagnostic.lua @@ -110,6 +110,14 @@ local function diagnostic_lsp_to_vim(diagnostics, bufnr, client_id) return vim.tbl_map(function(diagnostic) local start = diagnostic.range.start local _end = diagnostic.range['end'] + local message = diagnostic.message + if type(message) ~= 'string' then + vim.notify_once( + string.format('Unsupported Markup message from LSP client %d', client_id), + vim.lsp.log_levels.ERROR + ) + message = diagnostic.message.value + end --- @type vim.Diagnostic return { lnum = start.line, @@ -117,7 +125,7 @@ local function diagnostic_lsp_to_vim(diagnostics, bufnr, client_id) end_lnum = _end.line, end_col = line_byte_from_position(buf_lines, _end.line, _end.character, offset_encoding), severity = severity_lsp_to_vim(diagnostic.severity), - message = diagnostic.message, + message = message, source = diagnostic.source, code = diagnostic.code, _tags = tags_lsp_to_vim(diagnostic, client_id), |