diff options
Diffstat (limited to 'runtime/lua/vim/treesitter/query.lua')
-rw-r--r-- | runtime/lua/vim/treesitter/query.lua | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/runtime/lua/vim/treesitter/query.lua b/runtime/lua/vim/treesitter/query.lua index 4e9871b59d..22f706585e 100644 --- a/runtime/lua/vim/treesitter/query.lua +++ b/runtime/lua/vim/treesitter/query.lua @@ -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) |