aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/treesitter/query.lua
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2023-04-05 17:19:53 +0100
committerGitHub <noreply@github.com>2023-04-05 17:19:53 +0100
commit34ac75b32927328a0c691c5bda987c0fdb5ce9eb (patch)
treee627ce838ebc6d1670a2ed1c30fad237ca8c3e0c /runtime/lua/vim/treesitter/query.lua
parent56e4d79b280b2da1c8d9705d2f300cd93e955f53 (diff)
downloadrneovim-34ac75b32927328a0c691c5bda987c0fdb5ce9eb.tar.gz
rneovim-34ac75b32927328a0c691c5bda987c0fdb5ce9eb.tar.bz2
rneovim-34ac75b32927328a0c691c5bda987c0fdb5ce9eb.zip
refactor: rename local API alias from a to api
Problem: Codebase inconsistently binds vim.api onto a or api. Solution: Use api everywhere. a as an identifier is too short to have at the module level.
Diffstat (limited to 'runtime/lua/vim/treesitter/query.lua')
-rw-r--r--runtime/lua/vim/treesitter/query.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/runtime/lua/vim/treesitter/query.lua b/runtime/lua/vim/treesitter/query.lua
index 25623c1498..5b87e6ac31 100644
--- a/runtime/lua/vim/treesitter/query.lua
+++ b/runtime/lua/vim/treesitter/query.lua
@@ -1,4 +1,4 @@
-local a = vim.api
+local api = vim.api
local language = require('vim.treesitter.language')
---@class Query
@@ -74,7 +74,7 @@ end
---@return string[] query_files List of files to load for given query and language
function M.get_files(lang, query_name, is_included)
local query_path = string.format('queries/%s/%s.scm', lang, query_name)
- local lang_files = dedupe_files(a.nvim_get_runtime_file(query_path, true))
+ local lang_files = dedupe_files(api.nvim_get_runtime_file(query_path, true))
if #lang_files == 0 then
return {}
@@ -635,7 +635,7 @@ end
---@return (fun(): integer, TSNode, TSMetadata): capture id, capture node, metadata
function Query:iter_captures(node, source, start, stop)
if type(source) == 'number' and source == 0 then
- source = vim.api.nvim_get_current_buf()
+ source = api.nvim_get_current_buf()
end
start, stop = value_or_node_range(start, stop, node)
@@ -690,7 +690,7 @@ end
---@return (fun(): integer, table<integer,TSNode>, table): pattern id, match, metadata
function Query:iter_matches(node, source, start, stop)
if type(source) == 'number' and source == 0 then
- source = vim.api.nvim_get_current_buf()
+ source = api.nvim_get_current_buf()
end
start, stop = value_or_node_range(start, stop, node)