Explorar o código

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

ChristianChiarulli %!s(int64=2) %!d(string=hai) anos
pai
achega
a9f544ca78
Modificáronse 1 ficheiros con 14 adicións e 1 borrados
  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" },