dotnet / dotnet/fsharp

Suggestion: Auto-generate record fields when creating a record value

Open
#3,748 5 comments 0 reactions 0 assignees View on GitHub
Area-LangService-CodeFixes Feature Request
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 11h
Merged PRs (30d)
131

Description

It would be great if the IDE could generate record field labels when you create a record value.

Given this type:

```f#
type MyType =
{Field1: string
Field2: int
Field3: bool}
```

When I write:

```f#
let value =
{Field1 =
```

I want to be able to execute a quick action or similar so that I end up with the following:

```f#
let value =
{Field1 =
Field2 =
Field3 = }
```

I realize of course that this might assume one particular style of writing structs, which complicates this a bit.

On the topmost level, what I want is to not have to remember (or look up the definition) and manually type all field names all the time (nor do I want to type those I remember and wait for the IDE to tell me the rest when static analysis fails).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.