Skip to content

Commit

Permalink
Small Lib changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nobodywasishere committed Jul 17, 2024
1 parent e2ec28d commit aa33f34
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/compiler/crystal/tools/doc/method.cr
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,9 @@ class Crystal::Doc::Method
def id
String.build do |io|
io << to_s.delete(' ')
if @class_method
if @type.lib?
io << "-function"
elsif @class_method
io << "-class-method"
else
io << "-instance-method"
Expand Down Expand Up @@ -342,7 +344,7 @@ class Crystal::Doc::Method
builder.field "args_string", args_to_s unless args.empty?
builder.field "args_html", args_to_html unless args.empty?
builder.field "location", location unless location.nil?
builder.field "def", self.def
builder.field @type.lib? ? "fun" : "def", self.def
end
end

Expand Down
2 changes: 1 addition & 1 deletion src/compiler/crystal/tools/doc/type.cr
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ class Crystal::Doc::Type
def instance_methods
@instance_methods ||= begin
case @type
when Program
when Program, LibType
[] of Method
else
defs = [] of Method
Expand Down

0 comments on commit aa33f34

Please sign in to comment.