From dbd4f6bab44043685baa9e227b26d90ebb6bcb49 Mon Sep 17 00:00:00 2001 From: Aaron Sullivan Date: Sun, 15 Dec 2024 20:22:59 -0800 Subject: [PATCH] Remove vestigial code So I got excited and missed some stuff, sue me ;) --- lua/treewalker/nodes.lua | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/lua/treewalker/nodes.lua b/lua/treewalker/nodes.lua index eea05c2..7652065 100644 --- a/lua/treewalker/nodes.lua +++ b/lua/treewalker/nodes.lua @@ -1,27 +1,16 @@ 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 @@ -29,10 +18,6 @@ function M.is_jump_target(node) 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