Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
deathbeam committed Jun 5, 2024
1 parent 51d4c72 commit e74921c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ You also probably want to enable `popup` in completeopt to show documentation pr
vim.o.completeopt = 'menuone,noinsert,popup'
```

And you also ideally want to set the capabilities so Neovim will fetch documentation and additional text edits
And you also ideally want to set the capabilities so Neovim will fetch documentation
when resolving completion items:

```lua
Expand Down
12 changes: 1 addition & 11 deletions lua/autocomplete/buffer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ local methods = vim.lsp.protocol.Methods
local M = {}

local state = {
skip_next = false,
entries = {
completion = nil,
info = nil,
Expand All @@ -14,8 +13,7 @@ local state = {

local function complete(prefix, cmp_start, items)
items = vim.tbl_filter(function(item)
return item.kind ~= 'Snippet'
and (#prefix == 0 or #vim.fn.matchfuzzy({ item.word }, prefix) > 0)
return #prefix == 0 or #vim.fn.matchfuzzy({ item.word }, prefix) > 0
end, items)

if M.config.entry_mapper then
Expand Down Expand Up @@ -90,13 +88,6 @@ local function complete_lsp(bufnr, prefix, cmp_start, client, char)
triggerKind = vim.lsp.protocol.CompletionTriggerKind.TriggerCharacter,
triggerCharacter = char,
}
else
-- We do not want to trigger completion again if we just accepted a completion
-- We check it here because trigger characters call complete done
if state.skip_next then
state.skip_next = false
return
end
end

local params =
Expand All @@ -111,7 +102,6 @@ end

local function text_changed(args)
if vim.fn.pumvisible() == 1 then
state.skip_next = false
return
end

Expand Down
1 change: 0 additions & 1 deletion lua/autocomplete/capabilities.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ return {
properties = {
'documentation',
'detail',
'additionalTextEdits',
},
},
},
Expand Down

0 comments on commit e74921c

Please sign in to comment.