Skip to content

Conversation

@kerams
Copy link
Contributor

@kerams kerams commented Jun 30, 2023

Implements #1885.

Names are suggested in match clause, binding and lambda patterns of arbitrary nesting. Functions and values also no longer clutter the completions, since they are not legal in patterns.

devenv_91FH5ln3yQ

devenv_TMRYBSLGLH

devenv_2fAM815XfA

The initial high priority of these suggested names does get lost as you start typing though, because VS sorts the list on its own.

@kerams kerams requested a review from a team as a code owner June 30, 2023 16:57
@auduchinok
Copy link
Member

Do the following cases still work with this change?

Some, None, Nested, U, A, Id, Num should all still be available:

module Nested =
    type U =
        | A

    let (|Id|) x = x

    let [<Literal>] Num = 1

open Nested

match None with
| Some({caret})

The same, but without the parens:

match None with
| Some {caret}

@kerams
Copy link
Contributor Author

kerams commented Jun 30, 2023

All of those items are present.

@auduchinok
Copy link
Member

Functions and values also no longer clutter the completions, since they are not legal in patterns.

All of those items are present.

It's interesting, given that Num is a value. 🙂

@vzarytovskii vzarytovskii enabled auto-merge (squash) July 21, 2023 10:40
@vzarytovskii vzarytovskii merged commit 218206f into dotnet:main Jul 21, 2023
@kerams kerams deleted the sug branch July 21, 2023 12:57
@kerams kerams changed the title Suggest identifier names in patterns Suggest pattern names for union case fields Aug 16, 2023
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.

5 participants