瀏覽代碼

feat: reduce noise from LSP text comes from buffer source anyway

ChristianChiarulli 2 年之前
父節點
當前提交
a9f544ca78
共有 1 個文件被更改,包括 14 次插入1 次删除
  1. 14 1
      lua/lvim/core/cmp.lua

+ 14 - 1
lua/lvim/core/cmp.lua

@@ -247,7 +247,20 @@ M.config = function()
           },
         },
       },
-      { name = "nvim_lsp" },
+      {
+        name = "nvim_lsp",
+        entry_filter = function(entry, ctx)
+          local kind = require("cmp.types").lsp.CompletionItemKind[entry:get_kind()]
+          if kind == "Snippet" and ctx.prev_context.filetype == "java" then
+            return false
+          end
+          if kind == "Text" then
+            return false
+          end
+          return true
+        end,
+      },
+
       { name = "path" },
       { name = "luasnip" },
       { name = "cmp_tabnine" },