treesitter: add set_included_ranges to the parser

This is the first step towards language injection using treesitter.
This commit is contained in:
Thomas Vigouroux
2020-06-07 16:37:11 +02:00
parent 36d71e775a
commit 333f3f19db
2 changed files with 94 additions and 0 deletions

View File

@@ -30,6 +30,12 @@ function Parser:_on_lines(bufnr, _, start_row, old_stop_row, stop_row, old_byte_
self.valid = false
end
function Parser:set_included_ranges(ranges)
self._parser:set_included_ranges(self.bufnr, ranges)
-- The buffer will need to be parsed again later
self.valid = false
end
local M = {
parse_query = vim._ts_parse_query,
}