docs(treesitter): number → integer (#22513)

This commit is contained in:
Jaehwang Jung
2023-03-04 22:04:05 +09:00
committed by GitHub
parent 6cab36e5b7
commit 128b82103b
3 changed files with 22 additions and 22 deletions

View File

@@ -56,7 +56,7 @@ local function add_included_lang(base_langs, lang, ilang)
end
---@private
---@param buf (number)
---@param buf (integer)
---@param range (table)
---@param concat (boolean)
---@returns (string[]|string|nil)
@@ -269,7 +269,7 @@ end
--- Gets the text corresponding to a given node
---
---@param node TSNode
---@param source (number|string) Buffer or string from which the {node} is extracted
---@param source (integer|string) Buffer or string from which the {node} is extracted
---@param opts (table|nil) Optional parameters.
--- - concat: (boolean) Concatenate result in a string (default true)
--- - metadata (table) Metadata of a specific capture. This would be
@@ -484,7 +484,7 @@ local directive_handlers = {
--- Adds a new predicate to be used in queries
---
---@param name string Name of the predicate, without leading #
---@param handler function(match:table<string,TSNode>, pattern:string, bufnr:number, predicate:string[])
---@param handler function(match:table<string,TSNode>, pattern:string, bufnr:integer, predicate:string[])
--- - see |vim.treesitter.add_directive()| for argument meanings
---@param force boolean|nil
function M.add_predicate(name, handler, force)
@@ -503,7 +503,7 @@ end
--- metadata table `metadata[capture_id].key = value`
---
---@param name string Name of the directive, without leading #
---@param handler function(match:table<string,TSNode>, pattern:string, bufnr:number, predicate:string[], metadata:table)
---@param handler function(match:table<string,TSNode>, pattern:string, bufnr:integer, predicate:string[], metadata:table)
--- - match: see |treesitter-query|
--- - node-level data are accessible via `match[capture_id]`
--- - pattern: see |treesitter-query|
@@ -644,8 +644,8 @@ end
---
---@param node TSNode under which the search will occur
---@param source (integer|string) Source buffer or string to extract text from
---@param start number Starting line for the search
---@param stop number Stopping line for the search (end-exclusive)
---@param start integer Starting line for the search
---@param stop integer Stopping line for the search (end-exclusive)
---
---@return (fun(): integer, TSNode, TSMetadata): capture id, capture node, metadata
function Query:iter_captures(node, source, start, stop)