mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-16 10:20:11 -04:00
New stylua version (#1555)
This commit is contained in:
parent
6ebeac9f03
commit
4571d57251
2 changed files with 5 additions and 9 deletions
|
|
@ -467,9 +467,8 @@ end
|
||||||
-- A module should contain an attach and detach function.
|
-- A module should contain an attach and detach function.
|
||||||
-- @param mod the module table
|
-- @param mod the module table
|
||||||
function M.is_module(mod)
|
function M.is_module(mod)
|
||||||
return type(mod) == "table" and ((type(mod.attach) == "function" and type(mod.detach) == "function") or type(
|
return type(mod) == "table"
|
||||||
mod.module_path
|
and ((type(mod.attach) == "function" and type(mod.detach) == "function") or type(mod.module_path) == "string")
|
||||||
) == "string")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Initializes built-in modules and any queued modules
|
-- Initializes built-in modules and any queued modules
|
||||||
|
|
|
||||||
|
|
@ -51,12 +51,9 @@ end
|
||||||
function TSRange:parent()
|
function TSRange:parent()
|
||||||
local root = ts_utils.get_root_for_position(self[1], self[2])
|
local root = ts_utils.get_root_for_position(self[1], self[2])
|
||||||
|
|
||||||
return root and root:named_descendant_for_range(
|
return root
|
||||||
self.start_pos[1],
|
and root:named_descendant_for_range(self.start_pos[1], self.start_pos[2], self.end_pos[1], self.end_pos[2])
|
||||||
self.start_pos[2],
|
or nil
|
||||||
self.end_pos[1],
|
|
||||||
self.end_pos[2]
|
|
||||||
) or nil
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function TSRange:field() end
|
function TSRange:field() end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue