@@ -240,31 +240,24 @@ defmodule ExDoc.Retriever do
240
240
241
241
defp get_callbacks ( % { type: :behaviour } = module_data , source , groups_for_functions ) do
242
242
{ :docs_v1 , _ , _ , _ , _ , _ , docs } = module_data . docs
243
- optional_callbacks = module_data . module . behaviour_info ( :optional_callbacks )
244
243
245
244
for { { kind , _ , _ } , _ , _ , _ , _ } = doc <- docs , kind in module_data . callback_types do
246
- get_callback ( doc , source , optional_callbacks , groups_for_functions , module_data )
245
+ get_callback ( doc , source , groups_for_functions , module_data )
247
246
end
248
247
end
249
248
250
249
defp get_callbacks ( _ , _ , _ ) , do: [ ]
251
250
252
- defp get_callback ( callback , source , optional_callbacks , groups_for_functions , module_data ) do
251
+ defp get_callback ( callback , source , groups_for_functions , module_data ) do
253
252
callback_data = module_data . language . callback_data ( callback , module_data )
254
253
255
254
{ :docs_v1 , _ , _ , content_type , _ , _ , _ } = module_data . docs
256
255
{ { kind , name , arity } , anno , _signature , doc , metadata } = callback
257
- actual_def = callback_data . actual_def
258
256
doc_line = anno_line ( anno )
259
257
260
258
signature = signature ( callback_data . signature )
261
259
specs = callback_data . specs
262
- annotations = annotations_from_metadata ( metadata )
263
-
264
- # actual_def is Elixir specific, but remember optional_callbacks are generic.
265
- annotations =
266
- if actual_def in optional_callbacks , do: [ "optional" | annotations ] , else: annotations
267
-
260
+ annotations = callback_data . extra_annotations ++ annotations_from_metadata ( metadata )
268
261
doc_ast = doc_ast ( content_type , doc , file: source . path , line: doc_line + 1 )
269
262
270
263
group =
0 commit comments