dotnet / dotnet/fsharp

visualstudio open namespace codefix has wrong indentation in some cases

Open
#10,521 5 comments 0 reactions 0 assignees View on GitHub
AI-thinks-windows-only Area-FCS Area-LangService-CodeFixes Bug Impact-Low
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 11h
Merged PRs (30d)
131

Description

In indented context, the open namespace code fix puts the declaration at wrong indentation level.

It doesn't always affect the code, but when there are type extensions, it breaks it.

```fsharp
module Foo =
open System

type DateTime with
member x.X() = ()

let a () =
let t = Task.Factory.StartNew(fun () -> 1) // use the code fix on Task
()
```

![open namespace indentiation glitch](https://user-images.githubusercontent.com/87944/99890560-6972d200-2c15-11eb-8d14-27fbef978bed.gif)

**Related information**

VS2019 16.8

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.