dotnet / dotnet/fsharp

Intellisense for record fields not directly visible but can be inferref from parameter

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

Description

**Is your feature request related to a problem? Please describe.**
F# can infer record types from functions in other modules.
```fs
module M1 =
type R1 = { C1:int }
let f (_:R1) = ()
module M2 =
type R2 = { C2:int }
let _ = M1.f { C1 = 1 } // OK
let _ = { C1 = 1 } // FS0039 The record label 'C1' is not defined.
```
However, Intellisense does not list `C1` as a completable record field, and it only lists the invalid ones.
![image](https://user-images.githubusercontent.com/19922066/65814084-0e5f6e00-e210-11e9-8d21-5698b60d2ecb.png)

**Describe the solution you'd like**
![image](https://user-images.githubusercontent.com/19922066/65814162-df95c780-e210-11e9-9152-b9171f204f12.png)

**Describe alternatives you've considered**
Doing nothing and continue having a less usable experience.

**Additional context**
No.

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.