Skip to content

Filter completions for record fields in patterns#15903

Merged
vzarytovskii merged 6 commits into
dotnet:mainfrom
kerams:r
Sep 5, 2023
Merged

Filter completions for record fields in patterns#15903
vzarytovskii merged 6 commits into
dotnet:mainfrom
kerams:r

Conversation

@kerams

@kerams kerams commented Aug 30, 2023

Copy link
Copy Markdown
Contributor

Fixes #15889.

| { } and | { f = 1; g } do not recover gracefully and there is no match clause, let alone SynPat.Record. Didn't feel like fixing that here.

@kerams kerams requested a review from a team as a code owner August 30, 2023 16:53
Comment thread src/Compiler/Service/ServiceParsedInputOps.fs

@vzarytovskii vzarytovskii left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@auduchinok

Copy link
Copy Markdown
Member

| { } and | { f = 1; g } do not recover gracefully and there is no match clause, let alone SynPat.Record. Didn't feel like fixing that here.

I can work on it if you want to wait a bit here or help me fix the code completion later.

@kerams

kerams commented Aug 31, 2023

Copy link
Copy Markdown
Contributor Author

I reckon that if you manage to return SynPat.Record ([], m) and SynPat.Record ([ oneField ], m)/SynPat.Record ([ oneField; SynPat.FromParseError (...) ], m) for the 2 clauses, completions will work nicely without any changes.

@psfinaki

psfinaki commented Sep 4, 2023

Copy link
Copy Markdown
Contributor

So this can be simplified after #15921?

@vzarytovskii vzarytovskii enabled auto-merge (squash) September 4, 2023 13:27
@vzarytovskii

Copy link
Copy Markdown
Member

Should auto-merge when comments are resolved.

@auduchinok

Copy link
Copy Markdown
Member

@vzarytovskii If we decide to merge #15921 first, it would be better to double check that this PR doesn't need any updates.

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

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Record names are not suggested in the pattern matching

6 participants