Improve parser error recovery for underscore-dot patterns - #20453
Conversation
|
The following failed test has appeared: ReSharper-FSharp handles this correctly, the failure in FSharp.Editor suggests a dependency on previous broken AST states in its completion logic |
Refactored `pars.fsy` to split `UNDERSCORE DOT pathOp` into granular rules, adding explicit error recovery for missing identifiers after a dot. Introduced `underscoreLongIdentPat` to centralize underscore-prefixed long identifier logic, updating related rules and replacing `access UNDERSCORE DOT pathOp` with `access underscoreLongIdentPat`. Updated `Member 11.fs.bsl` baseline: wildcard member patterns now parse as `Named` instead of `FromParseError (Wild, ...)`, and error messages are more precise ("Identifier expected", "Expecting member body").
Corrected the completion trigger string from "override _." to "override _.g" to match the code context.
8d369e6 to
ee2ecfe
Compare
❗ Release notes requiredYou can open this PR in browser to add release notes: open in github.dev Caution No release notes found for the changed paths (see table below). Please make sure to add an entry with an informative description of the change as well as link to this pull request, issue and language suggestion if applicable. Release notes for this repository are based on Keep A Changelog format. The following format is recommended for this repository: `* . (PR #XXXXX)`
If you believe that release notes are not necessary for this PR, please add NO_RELEASE_NOTES label to the pull request.
|
|
🔍 Tooling Safety Check — Affects-Bootstrap, Affects-Compiler-Output
|
|
Please note that the test erroneously passed as successful. Let's see what is happening: type G<'a> () =
override _.
override x.ToString () = ""
...
type B () =
inherit A ()
override A1 () = ()
override x.bIt doesn't take long to notice that |
Description
Refactored
pars.fsyto splitUNDERSCORE DOT pathOpinto granular rules, adding explicit error recovery for missing identifiers after a dot. IntroducedunderscoreLongIdentPatto centralize underscore-prefixed long identifier logic, updating related rules and replacingaccess UNDERSCORE DOT pathOpwithaccess underscoreLongIdentPat. UpdatedMember 11.fs.bslbaseline: wildcard member patterns now parse asNamedinstead ofFromParseError (Wild, ...), and error messages are more precise ("Identifier expected", "Expecting member body").