-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[libSyntax] Incremental syntax tree transfer #18152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@swift-ci Please smoke test |
@@ -3,6 +3,8 @@ set(EXTRA_COMPILE_FLAGS "-I" "${SWIFT_SYNTAX_PATH}") | |||
set(EXTRA_LINKER_FLAGS "-Xlinker" "-rpath" "-Xlinker" "${SWIFT_SYNTAX_PATH}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also remove these above three lines. I've added them before however it seems they are not necessary.
printHelp() | ||
exit(0) | ||
} else { | ||
try performRoundTrip(args: args) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also define action kind like swift-ide-test. It's likely we'll use swift-swiftsyntax-test for other testing purposes.
326e23d
to
d926b74
Compare
@swift-ci Please smoke test |
@nkcsgexi I implemented the changes you requested in the comments and have refactored the swiftSyntax entry point API so that we no longer need to pass the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I've no other comments.
I couldn't find JSON output test cases for |
@rintaro It's implicitly tested when we do the round trip through swiftSyntax. But good point. I'll add a test case. |
Test failure seems unrelated. @swift-ci Please smoke test |
@swift-ci Please Python lint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This PR adds the ability to incrementally transfer a libSyntax tree from the C++ side to the Swift side of swiftSyntax.
The basic idea behind it is that we assign a unique ID to each node. If the node has been pulled from the SyntaxParsingCache during incremental syntax parsing, we know that the client already has that node. So, instead of serialising it again, we just add a stub node to the transferred tree that consists of only the node's ID. The client can then substitute the stub node with the node of that ID which is already present in its old syntax tree.