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

Lazily resolve method aliases #2201

Merged
merged 2 commits into from
Jun 18, 2024
Merged

Conversation

vinistock
Copy link
Member

Motivation

Closes #1940

This PR starts lazily resolving method aliases, so that we can show the correct information for aliases in definition, hover, completion and signature help.

Implementation

The idea is quite similar to constant aliases. If we encounter an unresolved entry, we try to resolve it recursively (since an alias can point to another alias). Then we store the resolved entry in the index so that we don't have to do it next time.

Automated Tests

Added tests for the index and for all of the features.

@vinistock vinistock added enhancement New feature or request server This pull request should be included in the server gem's release notes labels Jun 17, 2024
@vinistock vinistock self-assigned this Jun 17, 2024
@vinistock vinistock requested a review from a team as a code owner June 17, 2024 21:45
@vinistock vinistock requested review from andyw8 and st0012 June 17, 2024 21:45
lib/ruby_indexer/lib/ruby_indexer/index.rb Outdated Show resolved Hide resolved
@vinistock vinistock force-pushed the vs/lazily_resolve_method_aliases branch from e7a7f61 to 8c63345 Compare June 18, 2024 20:43
@vinistock vinistock force-pushed the vs/lazily_resolve_method_aliases branch from 8c63345 to f193ecb Compare June 18, 2024 20:44
@vinistock vinistock enabled auto-merge (squash) June 18, 2024 20:45
@vinistock vinistock added blocked This issue can't move forward until a blocker is resolved and removed blocked This issue can't move forward until a blocker is resolved labels Jun 18, 2024
@vinistock vinistock merged commit 93a6ffb into main Jun 18, 2024
34 checks passed
@vinistock vinistock deleted the vs/lazily_resolve_method_aliases branch June 18, 2024 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request server This pull request should be included in the server gem's release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support indexing alias, alias_method (potentially other missed declarations)
2 participants