Skip to content

Commit

Permalink
Raise minimum prism version and fix deprecations
Browse files Browse the repository at this point in the history
Prism 0.28.0 introduced a few breaking changes. In order to keep our code
simple, we've raised the minimum dependency version for prism.
  • Loading branch information
egiurleo committed May 14, 2024
1 parent b16c222 commit 3da5d9c
Show file tree
Hide file tree
Showing 5 changed files with 5,356 additions and 4,343 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ PATH
specs:
spoom (1.3.2)
erubi (>= 1.10.0)
prism (>= 0.19.0)
prism (>= 0.28.0)
sorbet-static-and-runtime (>= 0.5.10187)
thor (>= 0.19.2)

Expand Down
13 changes: 11 additions & 2 deletions lib/spoom/deadcode/indexer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,19 @@ def visit_constant_or_write_node(node)
visit(node.value)
end

sig { override.params(node: Prism::ConstantPathNode).void }
def visit_constant_path_node(node)
parent = node.parent

visit(parent) if parent
reference_constant(node.name.to_s, node)
end

sig { override.params(node: Prism::ConstantPathWriteNode).void }
def visit_constant_path_write_node(node)
parent = node.target.parent
name = node.target.child.slice
const_path_node = node.target
parent = const_path_node.parent
name = const_path_node.name.to_s

if parent
visit(parent)
Expand Down
Loading

0 comments on commit 3da5d9c

Please sign in to comment.