Skip to content

Commit 71015dc

Browse files
authored
Merge pull request swiftlang#12219 from benlangmuir/too-many-asts
[SourceKit] Disable automatic rebuilding of dependent-ASTs
2 parents d52a09e + 4e6831d commit 71015dc

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

tools/SourceKit/lib/SwiftLang/SwiftEditor.cpp

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1705,20 +1705,10 @@ ImmutableTextSnapshotRef SwiftEditorDocument::replaceText(
17051705
if (Length != 0 || Buf->getBufferSize() != 0) {
17061706
updateSemaInfo();
17071707

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

0 commit comments

Comments
 (0)