Pārlūkot izejas kodu

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

kylo252 3 gadi atpakaļ
vecāks
revīzija
19f0c8ccfa
1 mainītis faili ar 3 papildinājumiem un 2 dzēšanām
  1. 3 2
      lua/lvim/lsp/config.lua

+ 3 - 2
lua/lvim/lsp/config.lua

@@ -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,