Skip to content

[SourceKit] Remove cached AST by default on close #73361

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

Merged
merged 1 commit into from
May 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions tools/SourceKit/tools/sourcekitd/lib/Service/Requests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -835,8 +835,13 @@ handleRequestEditorClose(const RequestDict &Req,
int64_t CancelBuilds = true;
Req.getInt64(KeyCancelBuilds, CancelBuilds, /*isOptional=*/true);

// Whether we remove the cached AST from libcache, by default, false.
int64_t RemoveCache = false;
// Whether to remove the cached AST from libcache. This is currently true by
// default since future requests will never match matchesSourceState or
// cursor info's canUseASTWithSnapshots since the newly opened document
// will always have a mismatching stamp. Once we fix that
// (rdar://127353608), we ought to be able to switch this back to false by
// default.
int64_t RemoveCache = true;
Req.getInt64(KeyRemoveCache, RemoveCache, /*isOptional=*/true);
return Rec(editorClose(*Name, CancelBuilds, RemoveCache));
}
Expand Down