Skip to content

Commit

Permalink
Remove vestigial code
Browse files Browse the repository at this point in the history
So I got excited and missed some stuff, sue me ;)
  • Loading branch information
aaronik committed Dec 16, 2024
1 parent 3af10f9 commit dbd4f6b
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions lua/treewalker/nodes.lua
Original file line number Diff line number Diff line change
@@ -1,38 +1,23 @@
local util = require "treewalker.util"
local lines= require "treewalker.lines"

local NON_TARGET_NODE_MATCHERS = {
-- "chunk", -- lua
local TARGET_TYPE_BLACKLIST = {
"^.*comment.*$",
}

local TARGET_DESCENDANT_TYPES = {
"body_statement", -- lua, rb
"block", -- lua
"statement_block", -- lua

-- "then", -- helps rb, hurts lua
"do_block", -- rb
}

local M = {}

---@param node TSNode
---@return boolean
function M.is_jump_target(node)
for _, matcher in ipairs(NON_TARGET_NODE_MATCHERS) do
-- If it's a banned type
for _, matcher in ipairs(TARGET_TYPE_BLACKLIST) do
if node:type():match(matcher) then
return false
end
end
return true
end

function M.is_descendant_jump_target(node)
return util.contains(TARGET_DESCENDANT_TYPES, node:type())
end

---Do the nodes have the same starting point
---@param node1 TSNode
---@param node2 TSNode
Expand Down

0 comments on commit dbd4f6b

Please sign in to comment.