Skip to content

Commit 2e154e3

Browse files
committed
fix issue with wrapped strings and symbol nodes
1 parent 6509ec5 commit 2e154e3

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

lib/problematic_variable_finder/formatters/display_cli_problem.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,12 @@ def snippet
5454
name
5555
when Symbol
5656
name.to_s
57-
when Parser::AST::Node
57+
when Parser::AST::Node, ProblematicVariableFinder::Parsing::SexpWrapper
58+
if name.respond_to?(:loc)
5859
file_contents[name.loc.expression.begin_pos..name.loc.expression.end_pos]
60+
else
61+
name.to_s
62+
end
5963
end
6064
end
6165

0 commit comments

Comments
 (0)