[api] Give standalone created files a tracked identity and incorporate with the parse cache - #64434
Merged
Andrew Branch (andrewbranch) merged 2 commits intoSep 24, 2026
Conversation
Copilot started reviewing on behalf of
Andrew Branch (andrewbranch)
September 24, 2026 21:41
View session
Copilot started reviewing on behalf of
Andrew Branch (andrewbranch)
September 24, 2026 21:56
View session
Andrew Branch (andrewbranch)
requested review from
Jake Bailey (jakebailey) and
John Favret (johnfav03)
September 24, 2026 22:03
Member
|
What if you just want a throwaway AST and don't care about equality or reuse? |
Member
Author
|
Then |
Member
Author
|
The problem is the binder symbol follow-up. With server identities, you can do things like sourceFile.getSymbol(); // fetches if not already cached
api.bindSourceFile(sourceFile); // fetches and assigns all binder symbolsYou can't do that with an untracked, throwaway SourceFile, which makes for a confusing bifurcation of types/capabilities. |
Jake Bailey (jakebailey)
approved these changes
Sep 24, 2026
Andrew Branch (andrewbranch)
deleted the
create-source-file-uses-cache
branch
September 24, 2026 22:39
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.

Changes
api.createSourceFileandapi.createSourceFileFromFileto acquire from the global parse cache (on both client and server) and return a disposable lease:This does few things: