parser: only use parse to get a tree

This will avoid using internal data.
This commit is contained in:
Thomas Vigouroux 2020-11-03 21:08:36 +01:00
parent f999dc4113
commit 6eca8d2f38
4 changed files with 4 additions and 4 deletions

View file

@ -57,7 +57,7 @@ end
function TSRange:parent(range)
local parser = parsers.get_parser(self.buf, parsers.get_buf_lang(range))
local root = parser.tree:root()
local root = parser:parse():root()
return root:named_descendant_for_range(self.start_pos[1], self.start_pos[2], self.end_pos[1], self.end_pos[2])
end