elixir-ls
elixir-ls copied to clipboard
"Go to definition" does not work within the scope of a Phoenix router
This is in the README.
https://github.com/elixir-lsp/elixir-ls/blob/9becfba6b5cf15676fd78b9b14d47d3611bd85da/README.md?plain=1#L232
Is there a GH issue for this already?
Any clue why it doesn't work?
Go To Definition also does not work for elixir source code. Ref: https://github.com/elixir-lsp/elixir_sense/issues/44
Any clue why it doesn't work?
@Sleepful Phoenix Router macros mess with modules in scopes. e.g. in
scope "/", Foo.Bar do
pipe_through :browser
scope "/some" do
get "/:id", MyController, :index
end
end
MyController is transformed to Foo.Bar.MyController. To make it work someone would need to write a phoenix plugin to elixir_sense or add some hacks to ElixirSense.MetadataBuilder to make it understand how those macros work.
If you use a full module name (or properly alias it), then go to definition should work (not sure if router would still work though)
Tracked in https://github.com/elixir-lsp/elixir_sense/pull/281