@@ -150,7 +150,7 @@ defmodule ExDoc.Retriever do
150
150
function_docs ++
151
151
get_callbacks ( module_data , source , groups_for_docs , annotations_for_docs )
152
152
153
- types = get_types ( module_data , source , groups_for_docs )
153
+ types = get_types ( module_data , source , groups_for_docs , annotations_for_docs )
154
154
155
155
metadata = Map . put ( metadata , :__doc__ , module_data . type )
156
156
group = GroupMatcher . match_module ( config . groups_for_modules , module , module_data . id , metadata )
@@ -345,15 +345,15 @@ defmodule ExDoc.Retriever do
345
345
346
346
## Typespecs
347
347
348
- defp get_types ( module_data , source , groups_for_docs ) do
348
+ defp get_types ( module_data , source , groups_for_docs , annotations_for_docs ) do
349
349
{ :docs_v1 , _ , _ , _ , _ , _ , docs } = module_data . docs
350
350
351
351
for { { :type , _ , _ } , _ , _ , content , _ } = doc <- docs , content != :hidden do
352
- get_type ( doc , source , groups_for_docs , module_data )
352
+ get_type ( doc , source , groups_for_docs , module_data , annotations_for_docs )
353
353
end
354
354
end
355
355
356
- defp get_type ( type_entry , source , groups_for_docs , module_data ) do
356
+ defp get_type ( type_entry , source , groups_for_docs , module_data , annotations_for_docs ) do
357
357
{ :docs_v1 , _ , _ , content_type , _ , module_metadata , _ } = module_data . docs
358
358
{ { _ , name , arity } , anno , _signature , source_doc , metadata } = type_entry
359
359
doc_line = anno_line ( anno )
@@ -362,7 +362,11 @@ defmodule ExDoc.Retriever do
362
362
363
363
type_data = module_data . language . type_data ( type_entry , module_data )
364
364
signature = signature ( type_data . signature )
365
- annotations = if type_data . type == :opaque , do: [ "opaque" | annotations ] , else: annotations
365
+
366
+ annotations =
367
+ annotations_for_docs . ( metadata ) ++
368
+ if type_data . type == :opaque , do: [ "opaque" | annotations ] , else: annotations
369
+
366
370
doc_ast = doc_ast ( content_type , source_doc , file: source . path , line: doc_line + 1 )
367
371
metadata = Map . put ( metadata , :__doc__ , :type )
368
372
group = GroupMatcher . match_function ( groups_for_docs , metadata )
@@ -413,8 +417,9 @@ defmodule ExDoc.Retriever do
413
417
case :erl_anno . file ( anno ) do
414
418
:undefined ->
415
419
source
420
+
416
421
file ->
417
- % { url: source . url , path: Path . join ( Path . dirname ( source . path ) , file ) }
422
+ % { url: source . url , path: Path . join ( Path . dirname ( source . path ) , file ) }
418
423
end
419
424
end
420
425
0 commit comments