2023-02-04 07:58:38 -07:00
|
|
|
---@meta
|
|
|
|
|
|
|
|
---@class TSNode
|
|
|
|
---@field id fun(self: TSNode): integer
|
2023-02-26 09:53:33 -07:00
|
|
|
---@field tree fun(self: TSNode): TSTree
|
2023-03-23 04:23:51 -07:00
|
|
|
---@field range fun(self: TSNode, include_bytes: false?): integer, integer, integer, integer
|
|
|
|
---@field range fun(self: TSNode, include_bytes: true): integer, integer, integer, integer, integer, integer
|
2023-02-04 07:58:38 -07:00
|
|
|
---@field start fun(self: TSNode): integer, integer, integer
|
|
|
|
---@field end_ fun(self: TSNode): integer, integer, integer
|
|
|
|
---@field type fun(self: TSNode): string
|
|
|
|
---@field symbol fun(self: TSNode): integer
|
|
|
|
---@field named fun(self: TSNode): boolean
|
|
|
|
---@field missing fun(self: TSNode): boolean
|
2023-02-26 09:53:33 -07:00
|
|
|
---@field extra fun(self: TSNode): boolean
|
2023-02-04 07:58:38 -07:00
|
|
|
---@field child_count fun(self: TSNode): integer
|
|
|
|
---@field named_child_count fun(self: TSNode): integer
|
|
|
|
---@field child fun(self: TSNode, integer): TSNode
|
2023-03-08 04:03:11 -07:00
|
|
|
---@field named_child fun(self: TSNode, integer): TSNode
|
2023-02-04 07:58:38 -07:00
|
|
|
---@field descendant_for_range fun(self: TSNode, integer, integer, integer, integer): TSNode
|
|
|
|
---@field named_descendant_for_range fun(self: TSNode, integer, integer, integer, integer): TSNode
|
|
|
|
---@field parent fun(self: TSNode): TSNode
|
|
|
|
---@field next_sibling fun(self: TSNode): TSNode
|
|
|
|
---@field prev_sibling fun(self: TSNode): TSNode
|
|
|
|
---@field next_named_sibling fun(self: TSNode): TSNode
|
|
|
|
---@field prev_named_sibling fun(self: TSNode): TSNode
|
|
|
|
---@field named_children fun(self: TSNode): TSNode[]
|
2023-02-26 09:53:33 -07:00
|
|
|
---@field has_changes fun(self: TSNode): boolean
|
|
|
|
---@field equal fun(self: TSNode, other: TSNode): boolean
|
2023-02-04 07:58:38 -07:00
|
|
|
---@field iter_children fun(self: TSNode): fun(): TSNode, string
|
|
|
|
local TSNode = {}
|
|
|
|
|
|
|
|
---@param query userdata
|
|
|
|
---@param captures true
|
|
|
|
---@param start integer
|
|
|
|
---@param end_ integer
|
|
|
|
---@return fun(): integer, TSNode, any
|
|
|
|
function TSNode:_rawquery(query, captures, start, end_) end
|
|
|
|
|
|
|
|
---@param query userdata
|
|
|
|
---@param captures false
|
|
|
|
---@param start integer
|
|
|
|
---@param end_ integer
|
|
|
|
---@return fun(): string, any
|
|
|
|
function TSNode:_rawquery(query, captures, start, end_) end
|
|
|
|
|
|
|
|
---@class TSParser
|
2023-03-09 09:09:39 -07:00
|
|
|
---@field parse fun(self: TSParser, tree: TSTree?, source: integer|string, include_bytes: boolean?): TSTree, integer[]
|
2023-02-26 09:53:33 -07:00
|
|
|
---@field reset fun(self: TSParser)
|
2023-03-09 09:09:39 -07:00
|
|
|
---@field included_ranges fun(self: TSParser, include_bytes: boolean?): integer[]
|
2023-03-08 04:03:11 -07:00
|
|
|
---@field set_included_ranges fun(self: TSParser, ranges: Range6[])
|
2023-02-26 09:53:33 -07:00
|
|
|
---@field set_timeout fun(self: TSParser, timeout: integer)
|
|
|
|
---@field timeout fun(self: TSParser): integer
|
2023-02-04 07:58:38 -07:00
|
|
|
|
|
|
|
---@class TSTree
|
|
|
|
---@field root fun(self: TSTree): TSNode
|
|
|
|
---@field edit fun(self: TSTree, _: integer, _: integer, _: integer, _: integer, _: integer, _: integer, _: integer, _: integer, _:integer)
|
|
|
|
---@field copy fun(self: TSTree): TSTree
|
2023-03-09 09:09:39 -07:00
|
|
|
---@field included_ranges fun(self: TSTree, include_bytes: boolean?): integer[]
|
2023-02-04 07:58:38 -07:00
|
|
|
|
|
|
|
---@return integer
|
|
|
|
vim._ts_get_language_version = function() end
|
|
|
|
|
|
|
|
---@return integer
|
|
|
|
vim._ts_get_minimum_language_version = function() end
|
|
|
|
|
|
|
|
---@param lang string
|
|
|
|
---@return TSParser
|
|
|
|
vim._create_ts_parser = function(lang) end
|