Skip to content

Commit 3e1c79a

Browse files
committed
Ensure not completing finished string
Becaus of ruby/ruby#15979, closing_loc is going to be `nil` going forward when there is not a closing delimiter. So this predicate has to change slightly. This new predicate will work for all prism versions.
1 parent c3d8940 commit 3e1c79a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/repl_type_completor.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def analyze_code(code, binding = Object::TOPLEVEL_BINDING)
6969

7070
case target_node
7171
when Prism::StringNode
72-
return unless target_node.closing&.empty?
72+
return if target_node.opening == "?" || (target_node.closing_loc && !target_node.closing.empty?)
7373

7474
call_node, args_node = parents.last(2)
7575
return unless call_node.is_a?(Prism::CallNode) && call_node.receiver.nil?

0 commit comments

Comments
 (0)