mirror of
https://github.com/neovim/neovim
synced 2025-07-16 01:01:49 +00:00
fix: type fixes
Type fixes caught by emmylua
This commit is contained in:
committed by
Lewis Russell
parent
4c333fdbb7
commit
3b6084ddf4
@ -193,7 +193,7 @@ function M.get_files(lang, query_name, is_included)
|
||||
local langlist = modeline:match(MODELINE_FORMAT)
|
||||
if langlist then
|
||||
---@diagnostic disable-next-line:param-type-mismatch
|
||||
for _, incllang in ipairs(vim.split(langlist, ',', true)) do
|
||||
for _, incllang in ipairs(vim.split(langlist, ',')) do
|
||||
local is_optional = incllang:match('%(.*%)')
|
||||
|
||||
if is_optional then
|
||||
@ -778,7 +778,7 @@ local directive_handlers = {
|
||||
--- Adds a new predicate to be used in queries
|
||||
---
|
||||
---@param name string Name of the predicate, without leading #
|
||||
---@param handler fun(match: table<integer,TSNode[]>, pattern: integer, source: integer|string, predicate: any[], metadata: vim.treesitter.query.TSMetadata): boolean?
|
||||
---@param handler fun(match: table<integer,TSNode[]>, pattern: integer, source: integer|string, predicate: any[], metadata: vim.treesitter.query.TSMetadata): boolean? #
|
||||
--- - see |vim.treesitter.query.add_directive()| for argument meanings
|
||||
---@param opts? vim.treesitter.query.add_predicate.Opts
|
||||
function M.add_predicate(name, handler, opts)
|
||||
@ -818,7 +818,7 @@ end
|
||||
--- metadata table `metadata[capture_id].key = value`
|
||||
---
|
||||
---@param name string Name of the directive, without leading #
|
||||
---@param handler fun(match: table<integer,TSNode[]>, pattern: integer, source: integer|string, predicate: any[], metadata: vim.treesitter.query.TSMetadata)
|
||||
---@param handler fun(match: table<integer,TSNode[]>, pattern: integer, source: integer|string, predicate: any[], metadata: vim.treesitter.query.TSMetadata) #
|
||||
--- - match: A table mapping capture IDs to a list of captured nodes
|
||||
--- - pattern: the index of the matching pattern in the query file
|
||||
--- - predicate: list of strings containing the full directive being called, e.g.
|
||||
|
Reference in New Issue
Block a user