mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[incrParse] Fix issue because of which the syntax tree always got serialized completely
This commit is contained in:
@@ -1796,12 +1796,6 @@ void SwiftEditorDocument::readSyntaxInfo(EditorConsumer &Consumer) {
|
||||
|
||||
Impl.ParserDiagnostics = Impl.SyntaxInfo->getDiagnostics();
|
||||
|
||||
if (Consumer.syntaxTreeEnabled()) {
|
||||
std::unordered_set<unsigned> ReusedNodeIds;
|
||||
Consumer.handleSyntaxTree(Impl.SyntaxInfo->getSourceFile().getSyntaxRoot(),
|
||||
ReusedNodeIds);
|
||||
}
|
||||
|
||||
SwiftSyntaxMap NewMap = SwiftSyntaxMap(Impl.SyntaxMap.Tokens.size() + 16);
|
||||
|
||||
if (Consumer.syntaxTreeEnabled()) {
|
||||
@@ -2107,6 +2101,12 @@ void SwiftLangSupport::editorOpen(StringRef Name, llvm::MemoryBuffer *Buf,
|
||||
|
||||
EditorDoc->readSyntaxInfo(Consumer);
|
||||
EditorDoc->readSemanticInfo(Snapshot, Consumer);
|
||||
|
||||
if (Consumer.syntaxTreeEnabled()) {
|
||||
assert(EditorDoc->getSyntaxTree().hasValue());
|
||||
Consumer.handleSyntaxTree(EditorDoc->getSyntaxTree().getValue(),
|
||||
/*ReusedNodeIds=*/{});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user