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

Implement incremental reparsing for remaining braced blocks #68

Merged
merged 2 commits into from Sep 11, 2018

Conversation

Projects
None yet
3 participants
@darksv
Copy link
Contributor

darksv commented Sep 10, 2018

Fixes #66

MATCH_ARM_LIST => grammar::match_arm_list,
USE_TREE_LIST => grammar::use_tree_list,
EXTERN_ITEM_LIST => grammar::extern_item_list,
TOKEN_TREE => grammar::token_tree,

This comment has been minimized.

@matklad

matklad Sep 10, 2018

Collaborator

I think this is slightly wrong. Token tree might use () or [], and not {}. We maintain {}structure carefully, but that's not true for()and[]. I think we should make an additional check here that first child is {`.

The test for it probbaly would be like

fn foo() {
    vec![<|><|>]
}

current implementation I think will try to reparse [] and will faile the is_balanced check. The correct impl should reparse the fn body.

@matklad

This comment has been minimized.

Copy link
Collaborator

matklad commented Sep 10, 2018

bors r+

Thanks!

bors bot added a commit that referenced this pull request Sep 10, 2018

Merge #68
68: Implement incremental reparsing for remaining braced blocks r=matklad a=darksv

Fixes #66

Co-authored-by: darksv <darek969-12@o2.pl>
@matklad

This comment has been minimized.

Copy link
Collaborator

matklad commented Sep 10, 2018

A next step is probably to implement another useful re parsing heuristic: if a change affects only a single token (comment, whitespace, string literal or identifiere), there's a change that we need only to replace this single token.

@darksv

This comment has been minimized.

Copy link
Contributor

darksv commented Sep 10, 2018

OK, I will look into it later.

@bors

This comment has been minimized.

Copy link
Contributor

bors bot commented Sep 10, 2018

Timed out

@CAD97

This comment has been minimized.

Copy link
Collaborator

CAD97 commented Sep 10, 2018

CI was green...
https://travis-ci.org/matklad/libsyntax2/builds/426894269
https://ci.appveyor.com/project/matklad/libsyntax2/build/1.0.466

I forgot if I got permission to do this but I'm going to try
bors retry

bors bot added a commit that referenced this pull request Sep 10, 2018

Merge #68
68: Implement incremental reparsing for remaining braced blocks r=matklad a=darksv

Fixes #66

Co-authored-by: darksv <darek969-12@o2.pl>
@bors

This comment has been minimized.

Copy link
Contributor

bors bot commented Sep 11, 2018

Timed out

@CAD97

This comment has been minimized.

Copy link
Collaborator

CAD97 commented Sep 11, 2018

OK, no idea why bors is timing out.

AppVeyor: https://ci.appveyor.com/project/matklad/libsyntax2/build/1.0.467
2 hours ago in 6 min 19 sec

Travis: https://travis-ci.org/matklad/libsyntax2/builds/426955378
Ran for 5 min 39 sec
about 2 hours ago

(bors[bot] commented an hour ago)

EDIT: Asked on the forums for clarification of the reason for timeout

@matklad

This comment has been minimized.

Copy link
Collaborator

matklad commented Sep 11, 2018

bors retry

@matklad

This comment has been minimized.

Copy link
Collaborator

matklad commented Sep 11, 2018

bors r+

bors bot added a commit that referenced this pull request Sep 11, 2018

Merge #68
68: Implement incremental reparsing for remaining braced blocks r=matklad a=darksv

Fixes #66

Co-authored-by: darksv <darek969-12@o2.pl>
@bors

This comment has been minimized.

Copy link
Contributor

bors bot commented Sep 11, 2018

@bors bors bot merged commit d0cfeb4 into rust-analyzer:master Sep 11, 2018

3 checks passed

bors Build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment