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

Build locations before creating entries #2698

Merged
merged 1 commit into from
Oct 10, 2024

Conversation

vinistock
Copy link
Member

Motivation

Currently, our index entries accept either a Prism::Location or a RubyIndexer::Location. This is causing some weird patterns, like the need to pass the encoding everywhere even after the initial indexing has been performed.

Prism is about to ship a new code units cache concept, which will hopefully solve the performance degradation we've been seeing, but it will also make our current design even more difficult to deal with.

This PR forces us to build locations outside of entries, which prevents the coupling with the encoding and makes the changes required much more straight forward.

Implementation

Every entry only accepts a RubyIndexer::Location now. I added a helper method to build them from a Prism::Location, so that the transition to use the code units cache is easier.

Automated Tests

Existing tests should cover it.

@vinistock vinistock added server This pull request should be included in the server gem's release notes other Changes that aren't bugfixes, enhancements or breaking changes labels Oct 9, 2024
@vinistock vinistock self-assigned this Oct 9, 2024
@vinistock vinistock requested a review from a team as a code owner October 9, 2024 20:47
@vinistock vinistock merged commit 98461f1 into main Oct 10, 2024
40 checks passed
@vinistock vinistock deleted the vs-build-locations-outside-entries branch October 10, 2024 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
other Changes that aren't bugfixes, enhancements or breaking changes 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.

2 participants