Skip to content

Commit 2f833c5

Browse files
authored
Print abstract type parameters. (#105)
* Print abstract type parameters * Set version to 0.8.4
1 parent 94eb605 commit 2f833c5

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "DocStringExtensions"
22
uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
3-
version = "0.8.3"
3+
version = "0.8.4"
44

55
[deps]
66
LibGit2 = "76f85450-5226-5b5a-8eaa-529ad045b433"

src/abbreviations.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,7 @@ end
505505

506506
function print_abstract_type(buf, object)
507507
print(buf, "abstract type ", object.name.name)
508+
print_params(buf, object)
508509
print_supertype(buf, object)
509510
println(buf)
510511
end

test/TestModule/M.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ struct K
4444
K(; a = 1) = new()
4545
end
4646

47-
48-
abstract type AbstractType <: Integer end
47+
abstract type AbstractType1 <: Integer end
48+
abstract type AbstractType2{S, T <: Integer} <: Integer end
4949

5050
struct CustomType{S, T <: Integer} <: Integer
5151
end

test/tests.jl

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,13 +377,22 @@ end
377377

378378
@testset "type definitions" begin
379379
doc.data = Dict(
380-
:binding => Docs.Binding(M, :AbstractType),
380+
:binding => Docs.Binding(M, :AbstractType1),
381381
:typesig => Union{},
382382
:module => M,
383383
)
384384
DSE.format(TYPEDEF, buf, doc)
385385
str = String(take!(buf))
386-
@test str == "\n```julia\nabstract type AbstractType <: Integer\n```\n\n"
386+
@test str == "\n```julia\nabstract type AbstractType1 <: Integer\n```\n\n"
387+
388+
doc.data = Dict(
389+
:binding => Docs.Binding(M, :AbstractType2),
390+
:typesig => Union{},
391+
:module => M,
392+
)
393+
DSE.format(TYPEDEF, buf, doc)
394+
str = String(take!(buf))
395+
@test str == "\n```julia\nabstract type AbstractType2{S, T<:Integer} <: Integer\n```\n\n"
387396

388397
doc.data = Dict(
389398
:binding => Docs.Binding(M, :CustomType),

0 commit comments

Comments
 (0)