-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add source and behaviour information to docs chunk metadata #13914
Conversation
get_ann([{generated, true} | T], _, Line) -> get_ann(T, true, Line); | ||
get_ann([{line, Line} | T], Gen, _) when is_integer(Line) -> get_ann(T, Gen, Line); | ||
get_ann([_ | T], Gen, Line) -> get_ann(T, Gen, Line); | ||
get_ann([], Gen, Line) -> erl_anno:set_generated(Gen, erl_anno:new(Line)). | ||
get_ann([{generated, true} | T], _, Line, Column) -> get_ann(T, true, Line, Column); | ||
get_ann([{line, Line} | T], Gen, _, Column) when is_integer(Line) -> get_ann(T, Gen, Line, Column); | ||
get_ann([{column, Column} | T], Gen, Line, _) when is_integer(Column) -> get_ann(T, Gen, Line, Column); | ||
get_ann([_ | T], Gen, Line, Column) -> get_ann(T, Gen, Line, Column); | ||
get_ann([], Gen, Line, undefined) -> erl_anno:set_generated(Gen, erl_anno:new(Line)); | ||
get_ann([], Gen, Line, Column) -> erl_anno:set_generated(Gen, erl_anno:new({Line, Column})). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously this ignored column from meta, that's why the assertions in warning_test.exs now include a column as well :)
lib/elixir/src/elixir_erl.erl
Outdated
|
||
UniqFun = fun({Def, _Meta}) -> Def end, | ||
|
||
lists:uniq(UniqFun, lists:sort(LineComparator, Entries)). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we actually need uniqueness here. We only need sorting but lists:usort
is faster than lists:sort
, which is why we called usort
before. I don't think we actually expect duplicate tuples in there!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There can be duplicates for callbacks with multiple clauses. Looks like that's not the case for definitions though!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated!
Just some small nitpicks. Once the Erlang/OTP PRs have been merged (erlang/otp#8945), I will merge this one. :) |
I will merge this, since the Erlang/OTP PR for the Docs reference has been merged, although we are waiting on updates on how we should deal with ranges, based on erlang/otp#8966 and erlang/otp#8975. |
💚 💙 💜 💛 ❤️ |
Implements suggestions from erlang/otp#8945.