-
Notifications
You must be signed in to change notification settings - Fork 327
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
Partially fix abstract Erlang types ({@type ...}
)
#1787
Partially fix abstract Erlang types ({@type ...}
)
#1787
Conversation
@type is deprecated but still documented Code out in the wild may contain references like the ones we include in the test This commit attempts at solving a basic case for those EDoc seems broken for some types of @type (or at least not generating useful) information, but at least this commit prevent a crash
I wouldn’t try to do anything smart. Can we just leave the HTML as is, making sure it does not crash? |
Wdym? Not putting |
Or simply avoiding the crash but not taking |
I'll do a new commit to simply avoid the crash and nothing else. |
This is what's visible with the updated code (01b6065) Links are not usable, because generated HTML (in doc) points to e.g. |
Using all and no crashes 👍 (except in the tests - if I try to create some for the examples, but I'm not sure if you want me to "fix" that too) Edit: specifically, crash is in {:docs_v1, _, _, "application/erlang+html", %{"en" => doc}, _, _} =
Code.fetch_docs(:erlang_foo) when matching (that |
I added this to the tests (locally - {:docs_v1, _, _, "application/erlang+html", %{}, _, extra} ->
[{_, _, _, %{"en" => doc}, _}] =
Enum.filter(extra, fn
{{:type, ^search, ^arity}, _, _, _, _} -> true
_ -> false
end) as well as more tests, but maybe it's not worth it (?) I can push if you wanna. |
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.
If @wojtekmach is happy, I am happy!
Thank you! I'd strip out the |
@type
is deprecated but still documented: you get a warning upon documentation generation.This surfaced at jelly-beam/rebar3_ex_doc#38.
Code out in the wild may contain references like the ones we include in the test.
This pull request attempts at solving a basic case for those.
EDoc seems broken for some types of
@type
(or at least not generating useful information), but at least this commit prevents a crash.While discussing the solution with @starbelly we didn't know where to put the normalisation code. It might be good here, or it might belong in the
doc_ast.ex
module.