We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 2a6591e + c821e0c commit 66923b8Copy full SHA for 66923b8
lib/ruby_lsp/requests/code_lens.rb
@@ -80,11 +80,13 @@ def after_class(node)
80
81
sig { params(node: SyntaxTree::DefNode).void }
82
def on_def(node)
83
+ class_name = @class_stack.last
84
+ return unless class_name
85
+
86
visibility, _ = @visibility_stack.last
87
if visibility == "public"
88
method_name = node.name.value
89
if method_name.start_with?("test_")
- class_name = T.must(@class_stack.last)
90
add_test_code_lens(
91
node,
92
name: method_name,
test/fixtures/minitest_tests.rb
@@ -25,3 +25,7 @@ def test_with_q?; end
25
class AnotherTest < Minitest::Test
26
def test_public; end
27
end
28
29
+class Foo
30
+ def test_public; end
31
+end
0 commit comments