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

Find all references doesn't work with argument defaults. #150

Closed
hworld opened this issue Mar 10, 2020 · 3 comments · Fixed by #159
Closed

Find all references doesn't work with argument defaults. #150

hworld opened this issue Mar 10, 2020 · 3 comments · Fixed by #159

Comments

@hworld
Copy link
Contributor

hworld commented Mar 10, 2020

Environment

  • Elixir & Erlang versions (elixir --version):
    Erlang/OTP 22 [erts-10.6.4] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [hipe]
    Elixir 1.10.2 (compiled with Erlang/OTP 22)

  • Operating system: Fedora 31

  • Editor or IDE name (e.g. Emacs/VSCode): VSCode

  • LSP Client name: ??

  • If using VSCode, are you using "ElixirLS Fork: Elixir support and debugger" (note that it has "Fork" in the name)? Yes

Reproduction

I have a function like so in one module:

def check(resource, models, user, opts \\ [])

And in another I call it:

Subscription.check("User", users, user)

Find all references in VSCode doesn't show the Subscription.check/3 call as a reference. If it's changed to

Subscription.check("User", users, user, [])

or similar, the reference is found.

@axelson
Copy link
Member

axelson commented Mar 12, 2020

This is probably a bug in https://github.com/elixir-lsp/elixir_sense/
Specifically you should look in https://github.com/elixir-lsp/elixir_sense/blob/master/lib/elixir_sense/providers/references.ex

Is is also possible that it is a bug in Elixir's Xref.calls/0, in which case we probably won't fix it directly and instead switch over to compiler tracing which should be more accurate (WIP PR is at elixir-lsp/elixir_sense#80)

A test that reproduces the error (ideally in ElixirSense) would be very helpful in tracking this down.

lukaszsamson added a commit to elixir-lsp/elixir_sense that referenced this issue Mar 18, 2020
@lukaszsamson
Copy link
Collaborator

It turned out to be an elixir_sense issue. I managed to reproduce and fix it there.

@hworld
Copy link
Contributor Author

hworld commented Mar 20, 2020

Thanks @lukaszsamson! I'm going to close this since you already committed it over there to master. I'm not sure how the issue process normally works over here, but feel free to open it back up if I did something wrong.

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

Successfully merging a pull request may close this issue.

3 participants