You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maybe i encountered an issue while generating documentation using the YARD gem with pattern matching syntax like "foo" => String. A RangeError is thrown regarding a 'beginless range'. This error specifically arises in the ast_node.rb:348 file as part of the documentation generation process.
Error Message:
.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/yard-0.9.34/lib/yard/parser/ruby/ast_node.rb:348:in `first': cannot get the first element of beginless range (RangeError)
Steps to reproduce
Include pattern matching in the style of "foo" => String in a method documented with YARD.
Run the command yard doc .
Observe the above-mentioned RangeError.
Expected Result:
Documentation is generated without any errors.
Actual Result:
The documentation generation process fails with a RangeError when trying to interpret pattern matching with string literals.
Environment:
Operating System: Linux
Ruby Version: 3.2.2
YARD Gem Version: 0.9.34
Code Example:
# @api private## @param type [String] the response content type# @param charset [Hash] the response charset## @return [void]defput_content_type(type,charset: nil)type=> ::Stringcasecharsetin ::Stringthenheader!('Content-Type',"#{type}; charset=#{charset}")elseheader!('Content-Type',type)endrescue ::NoMatchingPatternErrorraise ::ArgumentError,'type must be a string'end
tapioca uses YARD for parsing, and YARD is currently unable to parse these
expressions, so I couldn't generate RBI files for sorbet using tapioca.
lsegal/yard#1521
Description
Maybe i encountered an issue while generating documentation using the YARD gem with pattern matching syntax like "foo" => String. A
RangeError
is thrown regarding a 'beginless range'. This error specifically arises in theast_node.rb:348
file as part of the documentation generation process.Error Message:
.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/yard-0.9.34/lib/yard/parser/ruby/ast_node.rb:348:in `first': cannot get the first element of beginless range (RangeError)
Steps to reproduce
"foo" => String
in a method documented with YARD.yard doc
.Expected Result:
Documentation is generated without any errors.
Actual Result:
The documentation generation process fails with a RangeError when trying to interpret pattern matching with string literals.
Environment:
Code Example:
Repository reference link
The text was updated successfully, but these errors were encountered: