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

Phoenix Router with auto-alias #1013

Open
sodapopcan opened this issue Oct 29, 2023 · 3 comments
Open

Phoenix Router with auto-alias #1013

sodapopcan opened this issue Oct 29, 2023 · 3 comments

Comments

@sodapopcan
Copy link

Precheck

Do a quick search and make sure the issue has not yet been reported

I did do a quick search for "router" and "route" in both open and closed issues.

Environment

N/A since this is an observed behaviour based off of forum feedback.

Current behavior

Hello ElixirLS team! ❤️

You are probably well aware of this but I couldn't find a logged issue so I'm opening one up.

See here for the latest example. If required, I can dig up two other recent discussions I was involved in where newcommers had the same issue (I did a search to find them but apparently I talk too much on that site).

Expected behavior

I don't particularly think this is ElixirLS' fault but I still wanted to log it.

The expected behaviour would be to expand a macro to see what it does before inserting an alias. I can't say if that is unreasonable or not as I know nothing about language servers. I don't even know if anything can be done, I just wanted to log it!

Thank you for all your work! ❤️

@lukaszsamson
Copy link
Collaborator

For reference here’s another issue with router macros messing up aliases #618. I’m more inclined to say this is phoenix design issue that manifest in ElixirLS. So far we only try to expand use macro and even doing so we do not execute any logic, simply insert code from using. I’m affraid expanding router macros would equal to compiling the file. That’s going beyond what AST can. This issue tracks elixir progres on the topic elixir-lang/elixir#12645.

BTW all completions that insert alias are marked with alias string.

BTW2 we need a dedicated phoenix LS

@sodapopcan
Copy link
Author

sodapopcan commented Nov 2, 2023

Makes sense! Sorry for the dup (and late response), I likely bypassed it after reading "go to definition."

@lukaszsamson
Copy link
Collaborator

@sodapopcan is it still an issue in the current version? Improvements to complete and definition providers in Phoenix.Router landed in 0.19 and 0.20

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

No branches or pull requests

2 participants