-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Extend incremental reparsing to all braced blocks #66
Labels
Comments
Hi! I want to take it. |
Cool, if there's any question I can help with, don't hesitate to ask here, @darksv ! A good first start is perhaps to just add a single more block to the list of cases, for example, a |
Thank you. I have implemented reparsing for remaining blocks. Now I want to give |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The incremental reparsing model of libsyntax2 is curly-block based.
{
and}
, there's a syntax node for which curlys are the first and the last child.Currently only expr blocks and struct blocks participate in this algorithm, but it should be extended to any kind of braced block. Here's the relevant code:
https://github.com/matklad/libsyntax2/blob/4f647096665b2ca3725ba1f7415a21fbc46044bb/crates/libsyntax2/src/lib.rs#L145-L147
it should be extended to all braced blocks. The relevant tests are here:
https://github.com/matklad/libsyntax2/blob/4f647096665b2ca3725ba1f7415a21fbc46044bb/crates/libsyntax2/tests/test/main.rs#L42
It would be nice to use
proptest
or fuzzing to check incremental re parsing! (cc @killercup on the last one). Here's the top-level repasing API:https://github.com/matklad/libsyntax2/blob/4f647096665b2ca3725ba1f7415a21fbc46044bb/crates/libsyntax2/src/lib.rs#L81
The text was updated successfully, but these errors were encountered: