Skip to content

Commit

Permalink
feat: filter out LSP text items by default
Browse files Browse the repository at this point in the history
  • Loading branch information
Saghen committed Dec 18, 2024
1 parent 046a2af commit 814392a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,13 @@ MiniDeps.add({
lsp = {
name = 'LSP',
module = 'blink.cmp.sources.lsp',
-- Filter out text items from the LSP provider, since we have the buffer provider for that
transform_items = function(_, items)
return vim.tbl_filter(
function(item) return item.kind ~= require('blink.cmp.types').CompletionItemKind.Text end,
items
)
end,

--- *All* providers have the following options available
--- NOTE: All of these options may be functions to get dynamic behavior
Expand Down
6 changes: 6 additions & 0 deletions lua/blink/cmp/config/sources.lua
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ local sources = {
name = 'LSP',
module = 'blink.cmp.sources.lsp',
fallbacks = { 'buffer' },
transform_items = function(_, items)
return vim.tbl_filter(
function(item) return item.kind ~= require('blink.cmp.types').CompletionItemKind.Text end,
items
)
end,
},
path = {
name = 'Path',
Expand Down

0 comments on commit 814392a

Please sign in to comment.