fsharp icon indicating copy to clipboard operation
fsharp copied to clipboard

Opening namespace in module with multiline attributes puts the open into a wrong position (within attributes)

Open xperiandri opened this issue 8 months ago • 0 comments

Repro steps

  1. Create a new project
  2. Paste
namespace X

open System

[<RequireQualifiedAccess;
  CompiledName((nameof System.Collections.Immutable.ImmutableArray)
               + "Module")>]
module FlatList =

    let a : KeyValuePair<string, int> = KeyValuePair<string, int>("key", 1)
  1. Put the cursor at KeyValuePair
  2. Press Ctrl+. to trigger light bulb
  3. Select opening the namespace in light bulb menu
  4. See
namespace X

open System

[<RequireQualifiedAccess;
  CompiledName((nameof System.Collections.Immutable.ImmutableArray)
    open System.Collections.Generic

               + "Module")>]
module FlatList =

    let a : KeyValuePair<string, int> = KeyValuePair<string, int>("key", 1)

Expected behavior

namespace X

open System
open System.Collections.Generic

[<RequireQualifiedAccess;
  CompiledName((nameof System.Collections.Immutable.ImmutableArray)

               + "Module")>]
module FlatList =

    let a : KeyValuePair<string, int> = KeyValuePair<string, int>("key", 1)

Actual behavior

namespace X

open System

[<RequireQualifiedAccess;
  CompiledName((nameof System.Collections.Immutable.ImmutableArray)
    open System.Collections.Generic

               + "Module")>]
module FlatList =

    let a : KeyValuePair<string, int> = KeyValuePair<string, int>("key", 1)

Known workarounds

Unknown

Related information

  • .NET Core 9.0.300
  • Visual Studio 17.14.4 Preview 1.0

xperiandri avatar Jun 06 '25 20:06 xperiandri