Skip to content

Commit f84f4a6

Browse files
committed
Add test coverage for 'module' and 'next'
1 parent 383cd72 commit f84f4a6

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

lib/ruby_lsp/static_docs.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ module RubyLsp
2323
"ensure" => "Executes the code in the ensure block regardless of whether an exception is raised or not",
2424
"for" => "Iterates over a collection of elements",
2525
"module" => "Defines a module",
26-
"next" => "Skips to the next iteration of a loop",
26+
"next" => "Skips the rest of the current iteration and moves to the next iteration of a loop or block",
2727
"yield" => "Invokes the passed block with the given arguments",
2828
}.freeze #: Hash[String, String]
2929
end

test/requests/hover_expectations_test.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -979,6 +979,21 @@ def my_method
979979
RUBY
980980
position: { line: 0, character: 2 },
981981
},
982+
"module" => {
983+
source: <<~RUBY,
984+
module MyModule
985+
end
986+
RUBY
987+
position: { line: 0, character: 2 },
988+
},
989+
"next" => {
990+
source: <<~RUBY,
991+
for i in 1..10
992+
next
993+
end
994+
RUBY
995+
position: { line: 1, character: 2 },
996+
},
982997
}
983998

984999
test_cases.each do |keyword, config|

0 commit comments

Comments
 (0)