summaryrefslogtreecommitdiff
path: root/lua/nvim-treesitter/ts_utils.lua
diff options
context:
space:
mode:
authorStephan Seitz <stephan.seitz@fau.de>2020-07-04 18:28:17 +0200
committerThomas Vigouroux <39092278+vigoux@users.noreply.github.com>2020-07-05 19:21:06 +0200
commit5642507f6a35d2e25b1588a36d8ddfc525f1464d (patch)
treed95ae24b0220deb9ce8674fea83fa6aba0747240 /lua/nvim-treesitter/ts_utils.lua
parent1ce1c73249cf5620726f9b00fd58cac1747b1e70 (diff)
Make luacheck happy
Diffstat (limited to 'lua/nvim-treesitter/ts_utils.lua')
-rw-r--r--lua/nvim-treesitter/ts_utils.lua13
1 files changed, 6 insertions, 7 deletions
diff --git a/lua/nvim-treesitter/ts_utils.lua b/lua/nvim-treesitter/ts_utils.lua
index 06f92c88..7d5e97cd 100644
--- a/lua/nvim-treesitter/ts_utils.lua
+++ b/lua/nvim-treesitter/ts_utils.lua
@@ -219,10 +219,9 @@ end
-- @param bufnr buffer
-- @returns the definition node and the definition nodes scope node
function M.find_definition(node, bufnr)
- local bufnr = bufnr or api.nvim_get_current_buf()
+ local bufnr = bufnr or api.nvim_get_current_buf()
local node_text = M.get_node_text(node)[1]
local current_scope = M.containing_scope(node)
- local _, _, node_start = node:start()
local matching_def_nodes = {}
-- If a scope wasn't found then use the root node
@@ -234,7 +233,7 @@ function M.find_definition(node, bufnr)
for _, def in ipairs(locals.get_definitions(bufnr)) do
for _, def_node in ipairs(M.get_local_nodes(def)) do
if M.get_node_text(def_node)[1] == node_text then
- table.insert(matching_def_nodes, def_node)
+ table.insert(matching_def_nodes, def_node)
end
end
end
@@ -258,7 +257,7 @@ end
function M.get_local_nodes(local_def)
local result = {}
- M.recurse_local_nodes(local_def, function(_, node)
+ M.recurse_local_nodes(local_def, function(_, node)
table.insert(result, node)
end)
@@ -281,9 +280,9 @@ function M.recurse_local_nodes(local_def, accumulator, full_match, last_match)
else
for match_key, def in pairs(local_def) do
M.recurse_local_nodes(
- def,
- accumulator,
- full_match and (full_match..'.'..match_key) or match_key,
+ def,
+ accumulator,
+ full_match and (full_match..'.'..match_key) or match_key,
match_key)
end
end