Skip to content

Commit 213fd94

Browse files
committed
fix: use treesitter.language.get_lang when choosing parser
closes #133
1 parent cfaf9fc commit 213fd94

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lua/blink/cmp/utils.lua

+2-1
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,10 @@ function utils.combine_markdown_lines(lines)
7979
return combined_lines
8080
end
8181

82-
function utils.highlight_with_treesitter(bufnr, root_lang, start_line, end_line)
82+
function utils.highlight_with_treesitter(bufnr, filetype, start_line, end_line)
8383
local Range = require('vim.treesitter._range')
8484

85+
local root_lang = vim.treesitter.language.get_lang(filetype)
8586
local trees = vim.treesitter.get_parser(bufnr, root_lang)
8687
trees:parse({ start_line, end_line })
8788
if not trees then return end

0 commit comments

Comments
 (0)