Skip to content

Commit

Permalink
Print named generic type arguments in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
HertzDevil committed Feb 18, 2021
1 parent 7f1eace commit e5c63d2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/compiler/crystal/tools/doc/type.cr
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,18 @@ class Crystal::Doc::Type
node.type_vars.join(io, ", ") do |type_var|
node_to_html type_var, io, links: links
end
if (named_args = node.named_args) && !named_args.empty?
io << ", " unless node.type_vars.empty?
named_args.join(io, ", ") do |entry|
if Symbol.needs_quotes_for_named_argument?(entry.name)
entry.name.inspect(io)
else
io << entry.name
end
io << ": "
node_to_html entry.value, io, links: links
end
end
io << ')'
end

Expand Down

0 comments on commit e5c63d2

Please sign in to comment.