-
Notifications
You must be signed in to change notification settings - Fork 41
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
Fix autocomplete for many_to_many associations #120
Conversation
Using ElixirLS with VS Code, I noticed that schemas with a many_to_many relationship weren't getting autocompletions as I composed ecto queries. The output was complaining about the `%ManyToMany{}` struct not having a `:related_key`, and I traced it back to here. I've confirmed that this change does fix the issue and allows you to get autocompletions for schemas with `many_to_many` relationships.
@damonvjanis can you add a test case? |
@lukaszsamson I got one added. I think the new fake schema is correct, but I'm not an expert on Ecto internals. The |
Thanks |
Fixes crash with ecto many to many completions elixir-lsp/elixir_sense#120
Using ElixirLS with VS Code, I noticed that schemas with a many_to_many relationship weren't getting autocompletions as I composed ecto queries.
The output was complaining about the
%ManyToMany{}
struct not having a:related_key
, and I traced it back to here. I've confirmed that this change does fix the issue and allows you to get autocompletions for schemas withmany_to_many
relationships.