Skip to content

Commit de008f3

Browse files
authored
Merge pull request #9 from ruby/fix_symbol_completion_exception
Fix exception in symbol completion
2 parents da82da4 + 9a204fd commit de008f3

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

lib/repl_type_completor.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def analyze_code(code, binding = Object::TOPLEVEL_BINDING)
7979
[call_node.name, target_node.content]
8080
end
8181
when Prism::SymbolNode
82-
return unless !target_node.closing || target_node.empty?
82+
return unless !target_node.closing || target_node.closing.empty?
8383

8484
name = target_node.value.to_s
8585
if parents.last.is_a? Prism::BlockArgumentNode # method(&:target)

test/repl_type_completor/test_repl_type_completor.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ def setup
99
ReplTypeCompletor.load_rbs unless ReplTypeCompletor.rbs_loaded?
1010
end
1111

12+
def teardown
13+
if ReplTypeCompletor.last_completion_error
14+
raise ReplTypeCompletor.last_completion_error
15+
ReplTypeCompletor.instance_variable_set(:@last_completion_error, nil)
16+
end
17+
end
18+
1219
def empty_binding
1320
binding
1421
end

0 commit comments

Comments
 (0)