File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
lib/ruby_lsp/ruby_lsp_rails Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -47,13 +47,15 @@ def on_command(node)
47
47
message_value = node . message . value
48
48
if message_value == "test" && node . arguments . parts . any?
49
49
first_argument = node . arguments . parts . first
50
- method_name = first_argument . parts . first . value if first_argument . is_a? ( SyntaxTree ::StringLiteral )
50
+ return unless first_argument . is_a? ( SyntaxTree ::StringLiteral )
51
+
52
+ test_name = first_argument . parts . first . value
51
53
test_file_path = Pathname . new ( @path ) . relative_path_from ( RailsClient . instance . root ) . to_s
52
54
line_number = node . location . start_line
53
55
command = "#{ BASE_COMMAND } #{ test_file_path } :#{ line_number } "
54
56
55
- if method_name
56
- add_code_lens ( node , name : method_name , command : command )
57
+ if test_name
58
+ add_code_lens ( node , name : test_name , command : command )
57
59
end
58
60
end
59
61
end
You can’t perform that action at this time.
0 commit comments