Skip to content

Commit 85f1c5e

Browse files
committed
[incrParse] Fix issue because of which the syntax tree always got serialized completely
1 parent 082a987 commit 85f1c5e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tools/SourceKit/lib/SwiftLang/SwiftEditor.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1796,12 +1796,6 @@ void SwiftEditorDocument::readSyntaxInfo(EditorConsumer &Consumer) {
17961796

17971797
Impl.ParserDiagnostics = Impl.SyntaxInfo->getDiagnostics();
17981798

1799-
if (Consumer.syntaxTreeEnabled()) {
1800-
std::unordered_set<unsigned> ReusedNodeIds;
1801-
Consumer.handleSyntaxTree(Impl.SyntaxInfo->getSourceFile().getSyntaxRoot(),
1802-
ReusedNodeIds);
1803-
}
1804-
18051799
SwiftSyntaxMap NewMap = SwiftSyntaxMap(Impl.SyntaxMap.Tokens.size() + 16);
18061800

18071801
if (Consumer.syntaxTreeEnabled()) {
@@ -2107,6 +2101,12 @@ void SwiftLangSupport::editorOpen(StringRef Name, llvm::MemoryBuffer *Buf,
21072101

21082102
EditorDoc->readSyntaxInfo(Consumer);
21092103
EditorDoc->readSemanticInfo(Snapshot, Consumer);
2104+
2105+
if (Consumer.syntaxTreeEnabled()) {
2106+
assert(EditorDoc->getSyntaxTree().hasValue());
2107+
Consumer.handleSyntaxTree(EditorDoc->getSyntaxTree().getValue(),
2108+
/*ReusedNodeIds=*/{});
2109+
}
21102110
}
21112111

21122112

0 commit comments

Comments
 (0)