Merged
Conversation
vinistock
commented
Feb 17, 2026
| let source = normalize_indentation(source); | ||
| let local_index = Self::index_source(uri, &source); | ||
| self.graph.update(local_index); | ||
| indexing::index_source(&mut self.graph, uri, &source, &LanguageId::Ruby); |
Member
Author
There was a problem hiding this comment.
For tests, I would rather expose an index_rbs_uri rather than modifying the signature to accept a new language_id parameter. Let me know if you disagree.
Contributor
There was a problem hiding this comment.
A separate helper for indexing rbs uris is fine for testing 👍
2be87f9 to
0f56225
Compare
amomchilov
reviewed
Feb 23, 2026
Comment on lines
+86
to
+87
| let language = self.path.extension().map_or(LanguageId::Ruby, LanguageId::from); | ||
| let local_graph = build_local_graph(url.to_string(), &source, &language); |
There was a problem hiding this comment.
Can these 2 lines be replaced with just a call to your new index_source function?
Member
Author
There was a problem hiding this comment.
Not quite. There are two subtle differences:
index_sourceexpects the language ID to be an enum since that gets passed by the editor to us. This is reading and transforming from the file's extensionindex_sourceimmediately updates the graph, but we don't want that to happen in the parallel indexing case. The threads send the indexing result through a channel and the main thread is responsible for the merge
alexcrocha
approved these changes
Feb 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This PR allows us to index documents that are stored in-memory (like unsaved files) rather than on disk.
I was starting the work on the Ruby LSP adoption and realized that all of our tests need to be able to index in-memory sources. Rather than re-writing the entire test suite, I figured we ought to add this API already since we need it for the regular LSP operations anyway.
My proposal is that we create a separate API for in-memory sources that is disconnected from indexing all files from disk. The reason is because we have these scenarios:
index_allAPI, which accepts an array and runs in parallel is the adequate choice