-
Notifications
You must be signed in to change notification settings - Fork 57
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
Sending SyntaxNode
s to other threads?
#155
Comments
I don't work on Rowan, but my understanding is that |
It's dangerous because |
Send a pair of a GreenNode and SyntaxNodePtr: https://docs.rs/rowan/0.15.11/rowan/ast/struct.SyntaxNodePtr.html |
I have a need to send
SyntaxNode
s to other threads, howeverSyntaxNode
is notSend
. What is the recommended approach to such usecases? I know green nodes are both send and sync, but they dont provide the needed information (text offsets).SyntaxNode
is preferred, as it can be used in typed AST wrappers.One solution that comes to mind is sending the green node and turning it into a syntax node in the new thread. But this seems wasteful if I already have a syntax node (I would have to turn it into a green node just to rebuild the syntax node in a new thread). Is there a better solution?
The text was updated successfully, but these errors were encountered: