-
Notifications
You must be signed in to change notification settings - Fork 172
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 definition, hover and completion support for global variables #2644
Comments
Hello! I'm having a look to this, RBS declaration exists: global_variables.rbs. I'll try to push the indexer changes before EoW. 👍 |
Amazing! Please post here or on the DX Slack if you need any assistance. |
Just a quick question about the completion request: can we consider adding |
Makes sense to me. |
Yeah, we'll definitely need to add |
After #2749, I'll need to go on the definition request again, to address other types of global variable nodes as well. Sorry for initial missing, this should be done within the week. |
No need to apologize at all! Thank you for contributing this 🙏. |
Done! |
We should provide features for global variables.
Note: this issue includes instructions on how to add indexing capabilities for globals, definition support, hover support and completion support. If you wish to contribute this, please create 4 separate pull requests for each step.
Implementation
I think the most natural implementation is to add global variables as a new entry type in the index. Hopefully, RBS should have global declarations with documentation that we can simply index like we do core declarations.
If RBS does not have global declarations, please raise it in this issue and we can reach out to Soutaro and the team to ask for guidance.
Changes to the indexer
RBS::AST::Declarations::Global
in process_declaration, so that we can insert the global entries into the indexChanges to definition
Prism::GlobalVariableReadNode
) as a possible target hereon_global_variable_read_enter
event andon_global_variable_read_enter
Changes to hover
Essentially, the same exact steps as definition. Simply look for the
hover
request and listener and apply analogous changes.Changes to completion
The text was updated successfully, but these errors were encountered: