mirror of
https://github.com/neovim/neovim.git
synced 2026-04-22 07:15:34 +00:00
fix(treesitter): _trees may not be list-like
Problem: With incremental injection parsing, injected languages' parsers parse only the relevant regions and stores the result in _trees with the index of the corresponding region. Therefore, there can be holes in _trees. Solution: * Use generic table functions where appropriate. * Fix type annotations and docs.
This commit is contained in:
committed by
Lewis Russell
parent
f54677132b
commit
71d9b7d15c
@@ -50,7 +50,8 @@ function TSNode:_rawquery(query, captures, start, end_, opts) end
|
||||
---@alias TSLoggerCallback fun(logtype: 'parse'|'lex', msg: string)
|
||||
|
||||
---@class TSParser
|
||||
---@field parse fun(self: TSParser, tree: TSTree?, source: integer|string, include_bytes: boolean?): TSTree, integer[]
|
||||
---@field parse fun(self: TSParser, tree: TSTree?, source: integer|string, include_bytes: true): TSTree, Range6[]
|
||||
---@field parse fun(self: TSParser, tree: TSTree?, source: integer|string, include_bytes: false|nil): TSTree, Range4[]
|
||||
---@field reset fun(self: TSParser)
|
||||
---@field included_ranges fun(self: TSParser, include_bytes: boolean?): integer[]
|
||||
---@field set_included_ranges fun(self: TSParser, ranges: (Range6|TSNode)[])
|
||||
|
||||
Reference in New Issue
Block a user