dotnet / dotnet/fsharp

Outlining: collapsing the first union case collapses all cases

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

Description

There seems to be a bug in outlining for union types, where collapsing the first case collapses all cases, instead of only the first. This works properly for the second case onwards. See the repro below for an example.

**Repro steps**

```
type Test =
| A of
id:string
* name:string
| B of
id:string
* name:string
| C of
id:string
* name:string
```

1. Paste the above code into VS2019.
2. Collapse the first union case.

![FS_Outlining_Unions](https://user-images.githubusercontent.com/50958617/61885154-61910980-aecb-11e9-9f07-4d26ed082b5b.gif)

**Expected behavior**

Collapsing the first union case should collapse ONLY the first case.

**Actual behavior**

Collapsing the first union case collapses ALL cases.

**Known workarounds**

N/A

**Related information**
Windows 10 Enterprise (10.0.17763)
.NET Core 2.1.7021
Visual Studio 2019 (16.1.3) (but same on 2017)
Visual F# Tools 10.4 for F# 4.6 (16.1.0-beta.19253.3+42526fe359672a05fd562dc16a91a43d0fe047a7)

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.