Skip to content

[glass] Optionally return full file content - #638

Closed
simonmar wants to merge 1 commit into
facebookincubator:mainfrom
simonmar:glass-file-content
Closed

[glass] Optionally return full file content#638
simonmar wants to merge 1 commit into
facebookincubator:mainfrom
simonmar:glass-file-content

Conversation

@simonmar

Copy link
Copy Markdown
Collaborator

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.

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.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 15, 2025
@netlify

netlify Bot commented Dec 15, 2025

Copy link
Copy Markdown

Deploy Preview for fb-oss-glean canceled.

Name Link
🔨 Latest commit af7e3d2
🔍 Latest deploy log https://app.netlify.com/projects/fb-oss-glean/deploys/6940136b6ce24d0008238ec6

@simonmar
simonmar marked this pull request as ready for review December 16, 2025 09:00
@meta-codesync

meta-codesync Bot commented Dec 31, 2025

Copy link
Copy Markdown
Contributor

@kbojarczuk has imported this pull request. If you are a Meta employee, you can view this in D89959476.

@meta-codesync meta-codesync Bot closed this in 1fa3892 Dec 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant