[libSyntax][SourceKit] Integrating libSyntax representation of a source file with several SourceKitd syntax requests (#14000)

The enhanced SourceKitd requests are EditorOpen and EdtiorReplaceText. In these two requests, the clients can specify a flag "key. enablesyntaxtree = 1" to get a serialize libSyntax tree with the response.

To help this integration, we added a function in SyntaxParsingContext to explicitly finalize the creation of a SourceFileSyntax to incorporate the fact that SourceKit needs the tree before its destroying the parser instance.

To test this integration, we diff the syntax tree serialized from the frontend action and the tree serialized from a SourceKitd response. They should be identical.
This commit is contained in:
Xi Ge
2018-01-17 21:13:22 -08:00
committed by GitHub
parent 6c8025b492
commit 4c172037e8
13 changed files with 127 additions and 21 deletions

View File

@@ -97,6 +97,8 @@ private:
}
bool handleSourceText(StringRef Text) override { return false; }
bool handleSerializedSyntaxTree(StringRef Text) override { return false; }
bool syntaxTreeEnabled() override { return false; }
};
struct DocUpdateMutexState {