aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/treesitter/_query_linter.lua
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2024-03-06 12:15:25 +0000
committerLewis Russell <me@lewisr.dev>2024-03-06 16:03:33 +0000
commit85b13751a5fc28fadbe74d72982325ca27b4c775 (patch)
tree0690fe4c552acfd03a69466b85bd7eda50509474 /runtime/lua/vim/treesitter/_query_linter.lua
parent3c572a31a3bb7009b4ad8eac56da1458acae3b75 (diff)
downloadrneovim-85b13751a5fc28fadbe74d72982325ca27b4c775.tar.gz
rneovim-85b13751a5fc28fadbe74d72982325ca27b4c775.tar.bz2
rneovim-85b13751a5fc28fadbe74d72982325ca27b4c775.zip
refactor(types): more fixes (2)
Diffstat (limited to 'runtime/lua/vim/treesitter/_query_linter.lua')
-rw-r--r--runtime/lua/vim/treesitter/_query_linter.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/runtime/lua/vim/treesitter/_query_linter.lua b/runtime/lua/vim/treesitter/_query_linter.lua
index b91e8ac38d..6216d4e891 100644
--- a/runtime/lua/vim/treesitter/_query_linter.lua
+++ b/runtime/lua/vim/treesitter/_query_linter.lua
@@ -17,7 +17,7 @@ local M = {}
--- @field is_first_lang boolean Whether this is the first language of a linter run checking queries for multiple `langs`
--- Adds a diagnostic for node in the query buffer
---- @param diagnostics Diagnostic[]
+--- @param diagnostics vim.Diagnostic[]
--- @param range Range4
--- @param lint string
--- @param lang string?
@@ -114,7 +114,7 @@ end
--- @return vim.treesitter.ParseError?
local parse = vim.func._memoize(hash_parse, function(node, buf, lang)
local query_text = vim.treesitter.get_node_text(node, buf)
- local ok, err = pcall(vim.treesitter.query.parse, lang, query_text) ---@type boolean|vim.treesitter.ParseError, string|Query
+ local ok, err = pcall(vim.treesitter.query.parse, lang, query_text) ---@type boolean|vim.treesitter.ParseError, string|vim.treesitter.Query
if not ok and type(err) == 'string' then
return get_error_entry(err, node)
@@ -123,9 +123,9 @@ end)
--- @param buf integer
--- @param match vim.treesitter.query.TSMatch
---- @param query Query
+--- @param query vim.treesitter.Query
--- @param lang_context QueryLinterLanguageContext
---- @param diagnostics Diagnostic[]
+--- @param diagnostics vim.Diagnostic[]
local function lint_match(buf, match, query, lang_context, diagnostics)
local lang = lang_context.lang
local parser_info = lang_context.parser_info