Skip to content

Commit e5cb77f

Browse files
committed
Fix elixir ref
1 parent 06ce28a commit e5cb77f

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

lib/ex_doc/language/elixir.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ defmodule ExDoc.Language.Elixir do
748748
ref = {:module, module}
749749

750750
case {mode, Refs.get_visibility(ref)} do
751-
{_link_type, :public} ->
751+
{_link_type, visibility} when visibility in [:public, :limited] ->
752752
Autolink.app_module_url(Autolink.tool(module, config), module, config)
753753

754754
{:regular_link, :undefined} ->

test/ex_doc/refs_test.exs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ defmodule ExDoc.RefsTest do
3838
assert Refs.get_visibility({:function, WithModuleDoc, :_no_doc, 0}) == :hidden
3939
assert Refs.get_visibility({:function, WithModuleDoc, :_doc_false, 0}) == :hidden
4040

41-
assert Refs.get_visibility({:function, InMemory, :no_doc, 0}) == :public
4241
# unable to read documentation, visibility is set to :public
42+
assert Refs.get_visibility({:function, InMemory, :no_doc, 0}) == :public
4343
assert Refs.get_visibility({:function, InMemory, :doc_false, 0}) == :public
4444
assert Refs.get_visibility({:function, InMemory, :with_doc, 0}) == :public
4545
assert Refs.get_visibility({:function, InMemory, :non_existant, 0}) == :undefined
@@ -54,6 +54,9 @@ defmodule ExDoc.RefsTest do
5454
assert Refs.get_visibility({:type, :sets, :set, 9}) == :undefined
5555
assert Refs.get_visibility({:type, WithoutModuleDoc, :a_type, 0}) == :public
5656

57+
# types cannot be read for inmemory modules
58+
assert Refs.get_visibility({:type, InMemory, :a_type, 0}) == :undefined
59+
5760
assert Refs.get_visibility({:callback, GenServer, :handle_call, 3}) == :public
5861
assert Refs.get_visibility({:callback, GenServer, :handle_call, 9}) == :undefined
5962
assert Refs.get_visibility({:callback, :gen_server, :handle_call, 3}) == :public

0 commit comments

Comments
 (0)