瀏覽代碼

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

kylo252 3 年之前
父節點
當前提交
19f0c8ccfa
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      lua/lvim/lsp/config.lua

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

@@ -23,8 +23,9 @@ return {
       prefix = "",
       prefix = "",
       format = function(d)
       format = function(d)
         local t = vim.deepcopy(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
         end
         return t.message
         return t.message
       end,
       end,