8000 Remove workaround for now-fixed ComplexType.parse limitations by apiology · Pull Request #827 · castwide/solargraph · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Remove workaround for now-fixed ComplexType.parse limitations #827

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 25, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions lib/solargraph/rbs_map/conversions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -557,16 +557,7 @@ def generic_type(type_name, type_args)
params = type_args.map { |a| other_type_to_tag(a) }.reject { |t| t == 'undefined' }
params_str = params.empty? ? '' : "<#{params.join(', ')}>"
type_string = "#{base}#{params_str}"
begin
ComplexType.parse(type_string)
rescue
# @todo Tuples of tuples aren't yet handled by the parser, and that appears in a few
# minor cases in the core/stdlib rbs:
# [WARN] Internal error parsing Array<Array(Integer, Symbol, String, Array(Integer, Integer, Integer, Integer))> from RBS
# [WARN] Internal error parsing Array<Array(Array(Integer, Integer), Symbol, String, Ripper::Lexer::State)> from RBS
Solargraph.logger.info "Internal error parsing #{type_string} from RBS; treating as non-generic"
ComplexType.parse(base)
end
ComplexType.parse(type_string)
end

# @param type_name [RBS::TypeName]
Expand Down
0