mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-07 14:00:00 -04:00
feat(refactor): highlight usages module
This commit is contained in:
parent
180ad9a1a8
commit
058e8d2296
8 changed files with 275 additions and 37 deletions
|
|
@ -11,7 +11,7 @@ local M = {
|
|||
locals = {}
|
||||
}
|
||||
|
||||
function M.collect_locals(bufnr)
|
||||
function M.collect_locals(bufnr, root)
|
||||
local lang = parsers.ft_to_lang(api.nvim_buf_get_option(bufnr, "ft"))
|
||||
if not lang then return end
|
||||
|
||||
|
|
@ -21,7 +21,7 @@ function M.collect_locals(bufnr)
|
|||
local parser = parsers.get_parser(bufnr, lang)
|
||||
if not parser then return end
|
||||
|
||||
local root = parser:parse():root()
|
||||
local root = root or parser:parse():root()
|
||||
local start_row, _, end_row, _ = root:range()
|
||||
|
||||
local locals = {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue