Skip to content

Commit

Permalink
Fix for missing nominal case in autolink_spec
Browse files Browse the repository at this point in the history
Small fix for missing nominal case in autolink_spec.
  • Loading branch information
lucioleKi committed Nov 20, 2024
1 parent ef99f3e commit 3553b26
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 17 deletions.
17 changes: 0 additions & 17 deletions bin/ex_doc

This file was deleted.

4 changes: 4 additions & 0 deletions lib/ex_doc/language/erlang.ex
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,10 @@ defmodule ExDoc.Language.Erlang do
{:attribute, anno, :type, ast} ->
{name, _, _} = ast
{name, anno, Code.Typespec.type_to_quoted(ast)}

{:attribute, anno, :nominal, ast} ->
{name, _, _} = ast
{name, anno, Code.Typespec.type_to_quoted(ast)}
end

formatted = format_spec(ast)
Expand Down
7 changes: 7 additions & 0 deletions test/ex_doc/language/erlang_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,13 @@ defmodule ExDoc.Language.ErlangTest do
~s|<a href="https://www.erlang.org/doc/apps/stdlib/array.html#t:array/0"><code class="inline">array:array/0</code></a>|
end

if System.otp_release() >= "28" do
test "OTP nominal", c do
assert autolink_extra("`t:erl_anno:location/0`", c) ==
~s|<a href="https://www.erlang.org/doc/apps/stdlib/erl_anno.html#t:location/0"><code class="inline">erl_anno:location/0</code></a>|
end
end

test "module", c do
assert autolink_extra("`m:erlang_bar`", c) ==
~s|<a href="erlang_bar.html"><code class="inline">erlang_bar</code></a>|
Expand Down

0 comments on commit 3553b26

Please sign in to comment.