Skip to content

Commit

Permalink
Merge pull request #10 from 3rd/master
Browse files Browse the repository at this point in the history
feat: pass kind to cmp
  • Loading branch information
ray-x committed Apr 6, 2023
2 parents c8e3a74 + cebe05b commit 389eadd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/cmp_treesitter/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ source.complete = function(self, params, callback)
if #w > 25 then
w = string.sub(w, 1, 25) .. ''
end
table.insert(items, { label = w, insertText = word.word, dup = 0 })
local camel_cased_kind = word.kind:gsub("%.", " "):gsub("(%w)(%w*)", function(first, rest) return first:upper() .. rest:lower() end):gsub(" ", "")
table.insert(items, { label = w, insertText = word.word, dup = 0, cmp = { kind_text = camel_cased_kind }})
end
end
end
Expand Down

0 comments on commit 389eadd

Please sign in to comment.