From 3e1c79af80f9f821b27a2f5ee368978d287a354d Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 27 Jan 2026 09:27:44 -0500 Subject: [PATCH] Ensure not completing finished string Becaus of https://github.com/ruby/ruby/pull/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. --- lib/repl_type_completor.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/repl_type_completor.rb b/lib/repl_type_completor.rb index 10751eb..e725ee9 100644 --- a/lib/repl_type_completor.rb +++ b/lib/repl_type_completor.rb @@ -69,7 +69,7 @@ def analyze_code(code, binding = Object::TOPLEVEL_BINDING) case target_node when Prism::StringNode - return unless target_node.closing&.empty? + return if target_node.opening == "?" || (target_node.closing_loc && !target_node.closing.empty?) call_node, args_node = parents.last(2) return unless call_node.is_a?(Prism::CallNode) && call_node.receiver.nil?