Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit ad54228

Browse files
committed
Go back to searchingfor treesitter
Signed-off-by: Tomas Slusny <[email protected]>
1 parent 04e01d6 commit ad54228

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lua/autocomplete/buffer.lua

+7-2
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,19 @@ local function complete_treesitter(bufnr, prefix, cmp_start)
3737
local defs = locals.get_definitions_lookup_table(bufnr)
3838
local ft = vim.bo[bufnr].filetype
3939
local items = {}
40-
local kind_map = vim.tbl_map(string.lower, vim.tbl_keys(vim.lsp.protocol.CompletionItemKind))
4140

4241
for id, entry in pairs(defs) do
4342
local name = id:match('k_(.+)_%d+_%d+_%d+_%d+$')
4443
local node = entry.node
4544
local kind = entry.kind
4645
if node and kind then
47-
kind = kind_map[kind:lower()] or kind
46+
for _, k in ipairs(vim.lsp.protocol.CompletionItemKind) do
47+
if string.find(k:lower(), kind:lower()) then
48+
kind = k
49+
break
50+
end
51+
end
52+
4853
local start_line_node, _, _ = node:start()
4954
local end_line_node, _, _ = node:end_()
5055

0 commit comments

Comments
 (0)