Skip to content

visualstudio open namespace codefix has wrong indentation in some cases #10521

@smoothdeveloper

Description

@smoothdeveloper

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.

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

Related information

VS2019 16.8

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-FCSArea-LangService-CodeFixesCode fixes associated with diagnosticsBugImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.

    Type

    Projects

    Status

    In Progress

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions