mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user