-
Notifications
You must be signed in to change notification settings - Fork 28
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
Add methods generated through metaprogramming to the index #403
Comments
Gave this one a quick shot but I quickly realized that my simple suggestion above doesn't really cut it. Addons would have to duplicate a large chunk of what |
We want to allow addons to also contribute to the index by providing another extension point in the indexing mechanism, which is the way to move forward with support for stuff like this. We will be exploring it soon. Essentially, we will need to allow addons to register for handling DSLs during indexing and then invoke the addons exactly in that spot in |
Looking forward to that. Rails provides some methods where this would be very useful (like enum declarations) and with the index continuosly getting better the cases where it doesn't work start to feel weird (this is a compliment 😄) |
Yeah, definitely! The idea is that addons will have the ability to bake the logic for configurations style DSLs, improving the knowledge in the index. A good example is association methods. When we find a |
@vinistock are you thinking this would be a new kind of |
Ideally not because then everything else should work by default (resolution, completion candidates, etc). Do you see a reason for having a separate entry for it? |
delegate
to the index
I've repurposed the issue for general metaprogramming stuff. |
Add-ons can now contribute to the index: https://shopify.github.io/ruby-lsp/add-ons.html#enhancing-features |
I make occasional use of
delegate
in my code, which is rails specific: https://api.rubyonrails.org/classes/Module.html#method-i-delegateAre addons able to contribute to the index? I don't think this addon currently does that. From the code in
ruby-lsp
,DeclarationListener.on_call_node_enter
seems like the place where it handles buildin things like that.Perhaps addons should to be able to hook into
index_single
to register a dispatcher of their own and contribute to the index?Tasks
The text was updated successfully, but these errors were encountered: