Skip to content

Reordering files in F# Solution Explorer causes items in <ItemGroup> to be listed horizontally #1498

@GarryPatchett

Description

@GarryPatchett

Describe the bug

When using F# Solution Explorer and using the "Move file up" and Move file down" arrows, no evidence can be seen until the buttons are pressed twice and, in the meantime, the ordering of the files in the fsproj file becomes 'horizontal' rather than 'vertical'.

Steps to reproduce

  1. Create new project with: dotnet new classlib -lang f# -o TestLib
  2. Launch VS Code and open the TestLib folder;
  3. Go to the F# Solution Explorer;
  4. Add a file called Test1.fs below Library.fs;
  5. Add a file called Test2.fs above Library.fs;
  6. Go to the VS Code Explorer and open the fsproj file.

And it all looks okay – a vertical listing of fs files at this point.

However, when I go back to F# Solution Explorer and press the “up-arrow” icon to the right of Test1.fs no change can be seen.

If I then go to the VS Code Explorer and open the fsproj file I see:

 <ItemGroup>
   <Compile Include="Test2.fs" />
   <Compile Include="Library.fs" /><Compile Include="Test1.fs" />
 
 </ItemGroup>

If I then go back to F# Solution Explorer and press the “up-arrow” icon to the right of Test1.fs again then Test1.fs moves above Library.fs but I now have, in the fsproj file:

 <ItemGroup>
   <Compile Include="Test2.fs" />
   <Compile Include="Test1.fs" /><Compile Include="Library.fs" />
 
 </ItemGroup>

Then, moving Test2.fs down once gives me:

 <ItemGroup>
 
   <Compile Include="Test2.fs" /><Compile Include="Test1.fs" /><Compile Include="Library.fs" />
 
 </ItemGroup>

Expected behaviour

I would expect to see the file move on the first press of the buttons and that the files would remain listed 'vertically'.

Machine infos

  • OS: Windows 10.0.19045
  • .NET SDK version: 9.0.311
  • Ionide version: 7.31.1

Additional context

I looked at the line endings of the fsproj file (in Notepad++) and they are all CRLF (except for the final line which is at the end of the file anyway).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions