Skip to content

Conversation

@baronfel
Copy link
Member

When working on a new codefix I discovered that syntax tree walks of match clauses don't seem to be triggering calls to VisitMatchClause. This seems to be because the range passed into the dive is the range of the guard expression + right hand side of the clause, when I believe it should be the overall range of the match clause. Because of this inconsistency, I think no range matches the range checks in pick, and so the VisitMatchClause member is never called.

@kerams
Copy link
Contributor

kerams commented Apr 5, 2022

Yup, came to the same conclusion in #12930

@baronfel
Copy link
Member Author

baronfel commented Apr 5, 2022

Aha! Thank you both for the inspiration. I thought I saw something similar in FsAutoComplete around the walker not walking some nodes, and I thought I was going batty.

@kerams
Copy link
Contributor

kerams commented Apr 13, 2022

Ping, can we get this in? I reckon this will open the door to some improvements to completions in match clauses.

@baronfel
Copy link
Member Author

baronfel commented Apr 13, 2022

As an additional sanity check, I looked at the implementation of traverseSynMatchClause, which we would start calling more often if this PR is merged. That function does in fact dive into every part of the match clause: pattern, guard and right-hand-side, and so it is already expecting to be called in this way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants