-
Notifications
You must be signed in to change notification settings - Fork 57
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
Code completion: named union case fields rule #500
Code completion: named union case fields rule #500
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nojaf Let's simplify it back to the first field case and support the subsequent fields case separately, when the parser recovery is improved? The getFieldsAfterSemicolon
logic is a bit too brittle.
Fine by me. That sounds very reasonable. |
Looking at all these nested matches... I wonder if you guys (@auduchinok and @nojaf) could somehow breath life into fsharp/fslang-suggestions#968 once again? |
6d8f1d9
to
7ff1349
Compare
@En3Tho I have no desire to pursue that suggestion. |
7ff1349
to
5d6e4a3
Compare
@auduchinok as dotnet/fsharp#14985 is now available in JFCS, I was able to enable subsequent fields case quite easily. Any thoughts on what to do next in this PR? |
It would be really cool to:
|
ReSharper.FSharp/test/data/features/completion/NamedUnionCaseFieldsPat - 01.fs.gold
Outdated
Show resolved
Hide resolved
5d6e4a3
to
c34ef08
Compare
Hi @auduchinok, I think I got the suggestions working.
|
@auduchinok thanks for all the pointers earlier today. |
I think the updates to the existing tests are valid if you consider |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nojaf nice work! I found a pair of interesting cases, could you look into them?
...arper.FSharp/src/FSharp.Psi.Features/src/CodeCompletion/Rules/NamedUnionCaseFieldsPatRule.fs
Outdated
Show resolved
Hide resolved
...arper.FSharp/src/FSharp.Psi.Features/src/CodeCompletion/Rules/NamedUnionCaseFieldsPatRule.fs
Outdated
Show resolved
Hide resolved
I think I got it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nojaf All looks really nice! I think there's just one thing left.
ReSharper.FSharp/test/data/features/completion/filtered/NamedUnionCaseFieldsPat - 07.fs.gold
Outdated
Show resolved
Hide resolved
...arper.FSharp/src/FSharp.Psi.Features/src/CodeCompletion/Rules/NamedUnionCaseFieldsPatRule.fs
Outdated
Show resolved
Hide resolved
@nojaf Could you also add a case in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really nice, thanks @nojaf!
This is a clean-up version of https://amplifying-fsharp.github.io/sessions/2023/03/17/.
Thank you again @auduchinok for all the help!