From 3e548ccd6a245cbd2969ded82c161a04dc4246bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Backstr=C3=B6m?= Date: Tue, 28 Jan 2025 13:07:35 +0100 Subject: [PATCH 1/3] Bump Elixir version in CI --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f98009e7a..a63d199f7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -81,9 +81,11 @@ jobs: # Test Erlang without -doc attribute support - elixir: "1.16" otp: "26" - # Test Erlang with -doc attribute support + # Test with initial Erlang doc attribute support - elixir: "1.17" otp: "27" + - elixir: "1.18" + otp: "27" lint: true steps: - uses: actions/checkout@v3 From 7b9fcb73961f7671540c5971b3bd1bcb2e6910d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Backstr=C3=B6m?= Date: Tue, 28 Jan 2025 13:08:48 +0100 Subject: [PATCH 2/3] fun() is syntax in Erlang and should not be treated as a type --- lib/ex_doc/language/erlang.ex | 2 +- test/ex_doc/language/erlang_test.exs | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/ex_doc/language/erlang.ex b/lib/ex_doc/language/erlang.ex index 5ed3ded85..13cb21800 100644 --- a/lib/ex_doc/language/erlang.ex +++ b/lib/ex_doc/language/erlang.ex @@ -571,7 +571,7 @@ defmodule ExDoc.Language.Erlang do name == :record and acc != [] -> {ast, acc} - name in [:"::", :when, :%{}, :{}, :|, :->, :...] -> + name in [:"::", :when, :%{}, :{}, :|, :->, :..., :fun] -> {ast, acc} # %{required(...) => ..., optional(...) => ...} diff --git a/test/ex_doc/language/erlang_test.exs b/test/ex_doc/language/erlang_test.exs index 9c5ffcd8a..b3f95396f 100644 --- a/test/ex_doc/language/erlang_test.exs +++ b/test/ex_doc/language/erlang_test.exs @@ -814,6 +814,14 @@ defmodule ExDoc.Language.ErlangTest do end end + test "function - specific arity", c do + assert autolink_spec(~s"-spec foo() -> fun((t()) -> t()) | erlang_bar:t().", c) == + ~s[foo() -> fun((t()) -> t()) | erlang_bar:t().] + + assert autolink_spec(~s"-spec foo() -> fun((t(), t()) -> t()) | erlang_bar:t().", c) == + ~s[foo() -> fun((t(), t()) -> t()) | erlang_bar:t().] + end + test "local type", c do assert autolink_spec(~S"-spec foo() -> t().", c) == ~s|foo() -> t().| From f11abc376163c9a5bf6fd5b0654671623d0cfc8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Backstr=C3=B6m?= Date: Tue, 28 Jan 2025 13:12:27 +0100 Subject: [PATCH 3/3] mix format --- lib/ex_doc/language/elixir.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ex_doc/language/elixir.ex b/lib/ex_doc/language/elixir.ex index 2600849cc..636cfa1a4 100644 --- a/lib/ex_doc/language/elixir.ex +++ b/lib/ex_doc/language/elixir.ex @@ -289,7 +289,7 @@ defmodule ExDoc.Language.Elixir do {:local, :..} ["//", "", ""] -> - {:local, :"..//"} + {:local, :..//} ["", ""] -> {:local, :.}