mirror of
https://github.com/neovim/neovim.git
synced 2025-10-06 09:56:31 +00:00
refactor(treesitter): use scratch buffer for string parser #35988
This commit changes `languagetree.lua` so that it creates a scratch buffer under the hood when dealing with string parsers. This will make it much easier to just use extmarks whenever we need to track injection trees in `languagetree.lua`. This also allows us to remove the `treesitter.c` code for parsing a string directly. Note that the string parser's scratch buffer has `set noeol nofixeol` so that the parsed source exactly matches the passed in string.
This commit is contained in:
@@ -5,7 +5,7 @@ error('Cannot require a meta file')
|
||||
---@alias TSLoggerCallback fun(logtype: 'parse'|'lex', msg: string)
|
||||
|
||||
---@class TSParser: userdata
|
||||
---@field parse fun(self: TSParser, tree: TSTree?, source: integer|string, include_bytes: boolean, timeout_ns: integer?): TSTree?, (Range4|Range6)[]
|
||||
---@field parse fun(self: TSParser, tree: TSTree?, source: integer, include_bytes: boolean, timeout_ns: integer?): TSTree?, (Range4|Range6)[]
|
||||
---@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