fix(diag): show lsp-diag code in open_float (#2180)

This commit is contained in:
kylo252 2022-01-15 12:32:06 +01:00 committed by GitHub
parent 41838ff4f6
commit 19f0c8ccfa
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 4AEE18F83AFDEB23

View file

@ -23,8 +23,9 @@ return {
prefix = "",
format = function(d)
local t = vim.deepcopy(d)
if d.code then
t.message = string.format("%s [%s]", t.message, t.code):gsub("1. ", "")
local code = d.code or d.user_data.lsp.code
if code then
t.message = string.format("%s [%s]", t.message, code):gsub("1. ", "")
end
return t.message
end,