Skip to content

Commit e710b50

Browse files
committed
[SourceKit] Remove cached AST by default on close
This isn't actually used for anything currently, future requests will always have mismatching stamps. As such, remove for now. rdar://127353509
1 parent 7da91bd commit e710b50

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tools/SourceKit/tools/sourcekitd/lib/Service/Requests.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -835,8 +835,13 @@ handleRequestEditorClose(const RequestDict &Req,
835835
int64_t CancelBuilds = true;
836836
Req.getInt64(KeyCancelBuilds, CancelBuilds, /*isOptional=*/true);
837837
838-
// Whether we remove the cached AST from libcache, by default, false.
839-
int64_t RemoveCache = false;
838+
// Whether to remove the cached AST from libcache. This is currently true by
839+
// default since future requests will never match matchesSourceState or
840+
// cursor info's canUseASTWithSnapshots since the newly opened document
841+
// will always have a mismatching stamp. Once we fix that
842+
// (rdar://127353608), we ought to be able to switch this back to false by
843+
// default.
844+
int64_t RemoveCache = true;
840845
Req.getInt64(KeyRemoveCache, RemoveCache, /*isOptional=*/true);
841846
return Rec(editorClose(*Name, CancelBuilds, RemoveCache));
842847
}

0 commit comments

Comments
 (0)