-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Improved parser recovery during typing #11817
Comments
The quoted snippets from @CyrusNajmabadi are
and
|
Well.. the example is the code you've provided :) THe improved parsing would have made is unnecessary to do the particular bit of error tolerance work in the binder that you're currently incurring :) The overall idea is basically that all features flow from the quality of the parse tree. The more the parse tree matches the user's expectations, the better all other features (classification, formatting, completion, etc. etc. etc.) will work. The more horked the parse tree becomes, the more flakey and odd features will behave around the problem point. So, in general, when we can cheaply see that something has gone wrong, and we have a reasonable heuristic to addressing it and producing a good tree, the better the entire rest of the experience is. |
Not so. See #557, where the "problem" occurs so much further in the input that it is not obvious how to "correct" it locally. There is a comma in the source in #557 (though unbeknownst to the parser intended for another enclosing construct). The improved error tolerance in the binder in #11807 is needed to handle those cases. |
Fixed with #15885 |
See #11807 (comment) and #11807 (comment)
In code such as
It would be helpful to the IDE if the parser would consider
var foo =
as the start of a separate statement.The text was updated successfully, but these errors were encountered: