Skip to content

Commit

Permalink
Fix language callback specs
Browse files Browse the repository at this point in the history
  • Loading branch information
garazdawi committed Dec 21, 2023
1 parent edfdcf2 commit d0c9a2d
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions lib/ex_doc/language.ex
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ defmodule ExDoc.Language do
title: String.t(),
type: atom() | nil,
source_basedir: String.t(),
source_file: String.t(),
source_file: String.t() | nil,
source_line: non_neg_integer(),
callback_types: [atom()],
nesting_info: {String.t(), String.t()} | nil,
Expand All @@ -57,9 +57,9 @@ defmodule ExDoc.Language do
The map has the following keys:
* `:line` - the line where the code is located, def/defp in Elixir, foo(...) in Erlang
* `:source_line` - the line where the code is located, def/defp in Elixir, foo(...) in Erlang
* `:source` - the source file where the code in located
* `:source_file` - the source file where the code in located
* `:specs` - a list of specs that will be later formatted by `c:typespec/2`
Expand All @@ -71,8 +71,8 @@ defmodule ExDoc.Language do
"""
@callback function_data(entry :: tuple(), module_data()) ::
%{
line: non_neg_integer() | nil,
source: String.t(),
source_line: non_neg_integer() | nil,
source_file: String.t() | nil,
specs: [spec_ast()],
# TODO: change to following on Elixir 1.15. It trips mix formatter between 1.14 and 1.15
# doc_fallback: (-> ExDoc.DocAST.t()) | nil,
Expand All @@ -86,9 +86,9 @@ defmodule ExDoc.Language do
The map has the following keys:
* `:line` - the line where the code is located
* `:source_line` - the line where the code is located
* `:source` - the source file where the code is located
* `:source_file` - the source file where the code in located
* `:signature` - the signature
Expand All @@ -99,8 +99,8 @@ defmodule ExDoc.Language do
"""
@callback callback_data(entry :: tuple(), module_data()) ::
%{
line: non_neg_integer() | nil,
source: String.t(),
source_line: non_neg_integer() | nil,
source_file: String.t() | nil,
signature: [binary()],
specs: [spec_ast()],
extra_annotations: [String.t()]
Expand All @@ -113,9 +113,9 @@ defmodule ExDoc.Language do
* `:type` - `:type` or `:opaque`
* `:line` - the line where the code is located
* `:source_line` - the line where the code is located
* `:source` - the source file where the code is located
* `:source_file` - the source file where the code in located
* `:signature` - the signature
Expand All @@ -124,7 +124,8 @@ defmodule ExDoc.Language do
@callback type_data(entry :: tuple(), spec :: term()) ::
%{
type: :type | :opaque,
line: non_neg_integer(),
source_line: non_neg_integer(),
source_file: String.t() | nil,
signature: [binary()],
spec: spec_ast()
}
Expand Down

0 comments on commit d0c9a2d

Please sign in to comment.