Skip to content
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

Improve message indicating Module.function_name/arity and positional argument #89

Open
eksperimental opened this issue May 30, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@eksperimental
Copy link
Contributor

When having multiple function calls and arguments, it is hard to tell which one is bringing up the issue.
As of now, i need to read the docs for both functions involved in that line to see which one is the one the message refers to
.

lib/ex_doc/language/elixir.ex: The function call on line 95 is expected to have type nonempty_list(A) but it has type string()
94   defp doc?({{_, name, _}, _, _, :none, _}, _type) do
95     hd(Atom.to_charlist(name)) != ?_
96   end

It will be nice if the message would say:
lib/ex_doc/language/elixir.ex: The function call Atom.to_charlist/1 line 95 is expected to have type nonempty_list(A) as its argument, but it has type string()

If the function has more than one argument it should read "as its 2nd argument"

@erszcz erszcz added the enhancement New feature or request label May 31, 2022
@erszcz
Copy link
Member

erszcz commented May 31, 2022

That would be a good enhancement, indeed 👍 Otherwise, I think the relevant part of the expression could be underlined/highlighted to make it unambiguous which part is expected to have the mentioned type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants