Skip to content

Commit 8ed5ab3

Browse files
authored
Merge pull request #12220 from benlangmuir/too-many-asts-4.0
[SourceKit] Disable automatic rebuilding of dependent-ASTs
2 parents 71c3a2f + ceee35a commit 8ed5ab3

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
@@ -1590,20 +1590,10 @@ ImmutableTextSnapshotRef SwiftEditorDocument::replaceText(
15901590
if (Length != 0 || Buf->getBufferSize() != 0) {
15911591
updateSemaInfo();
15921592

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

0 commit comments

Comments
 (0)