Add definition, hover and completion support for global variables #2644
Labels
enhancement
New feature or request
help-wanted
Extra attention is needed
pinned
This issue or pull request is pinned and won't be marked as stale
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: