[glass] Optionally return full file content - #638
Closed
simonmar wants to merge 1 commit into
Closed
Conversation
Clients may want to update symbol positions to account for local changes to the source file, and for this they need the original file content as it was indexed. Currently the way to do that is to use the `revision` returned by Glass and retrieve the file from source control, but that might not be possible in general: * the indexed file might not be checked in (consider interactively indexing code in the background when using an IDE), or * the files might not be in source control at all (consider indexing packages you downloaded from a package manager). This provides a way for the Glass client to ask Glass for the original file content that was indexed. The content might not be available - it relies on the indexer having produced the appropriate `src.FileContent` facts, and only the Haskell indexer does this right now, but it could become more widely supported in the future. We could also have Glass try to get the content from the SCM; I haven't implemented that.
✅ Deploy Preview for fb-oss-glean canceled.
|
simonmar
marked this pull request as ready for review
December 16, 2025 09:00
Contributor
|
@kbojarczuk has imported this pull request. If you are a Meta employee, you can view this in D89959476. |
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.
Clients may want to update symbol positions to account for local changes to the source file, and for this they need the original file content as it was indexed. Currently the way to do that is to use the
revisionreturned by Glass and retrieve the file from source control, but that might not be possible in general:This provides a way for the Glass client to ask Glass for the original file content that was indexed. The content might not be available - it relies on the indexer having produced the appropriate
src.FileContentfacts, and only the Haskell indexer does this right now, but it could become more widely supported in the future.We could also have Glass try to get the content from the SCM; I haven't implemented that.