Skip to content

[SourceKit] Disable automatic rebuilding of dependent-ASTs #12220

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
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
18 changes: 4 additions & 14 deletions tools/SourceKit/lib/SwiftLang/SwiftEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1590,20 +1590,10 @@ ImmutableTextSnapshotRef SwiftEditorDocument::replaceText(
if (Length != 0 || Buf->getBufferSize() != 0) {
updateSemaInfo();

if (auto Invok = Impl.SemanticInfo->getInvocation()) {
// Update semantic info for open editor documents of the same module.
// FIXME: Detect edits that don't affect other files, e.g. whitespace,
// comments, inside a function body, etc.
CompilerInvocation CI;
Invok->applyTo(CI);
auto &EditorDocs = Impl.LangSupport.getEditorDocuments();
for (auto &Input : CI.getInputFilenames()) {
if (auto EditorDoc = EditorDocs.findByPath(Input)) {
if (EditorDoc.get() != this)
EditorDoc->updateSemaInfo();
}
}
}
// FIXME: we should also update any "interesting" ASTs that depend on this
// document here, e.g. any ASTs for files visible in an editor. However,
// because our API conflates this with any file with unsaved changes we do
// not update all open documents, since there could be too many of them.
}
}

Expand Down