-
Notifications
You must be signed in to change notification settings - Fork 190
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
Feature: Navigate from defdelegate to the function delegated to #126
Comments
It will require changes in elixir sense. I was planning to do this anyway though. |
That sounds good, I created an issue in the elixir_sense repo as well: elixir-lsp/elixir_sense#89 |
So is it possible now to navigate to the delegated function? Currently, it seems like I can only see peek definition (which is displayed correctly). Sorry if am missing smth obvious :) |
@IvanShpotenko use go to implementation instead of go to definition |
Thanks, it works! Sorry for the confusion! |
It seems if I'm at the Also, it seems that listing references doesn't work from the function implementation (i.e. the target of the delegation). I'd expect that it would list the |
You can use go to implementations on the defdelegate site, no need to jump back to call site (I've just verified it and it works for me)
That's a separate issue. Please fill it in elixir_sense repo |
Ah! OK, I've traced my issue here to an issue with alias resolution: # lib/test.ex
defmodule Test do
alias __MODULE__, as: Self
alias Self.Private
defdelegate my_function(), to: Private
end
# lib/test/private.ex
defmodule Test.Private do
def my_function() do
IO.puts("Hello")
end
end It seems that the double-alias involving |
Yes. If you would like to try adding support for it, the relevant code is in https://github.com/elixir-lsp/elixir_sense/blob/219b4d0fcb27c46dd4dad915ece01ec2b92d0249/lib/elixir_sense/core/metadata_builder.ex#L705 |
May require changes to elixir_sense
The text was updated successfully, but these errors were encountered: