fernandoescolar / vscode-solution-explorer

This is a Visual Studio Code extension that provides a (.sln) Visual Studio Solution explorer panel..
MIT License
348 stars 73 forks source link

Display folders in project file order in F# projects #283

Closed farlee2121 closed 1 year ago

farlee2121 commented 1 year ago

282

What happens if the PR is merged

Folders in all kinds of projects always show at the top, but F# folders should be shown in compile order. This PR updates F# projects to display folders in project file (compile) order.

For example, for this project item group

<ItemGroup>
    <Compile Include="DefaultValidators.fs" />
    <Compile Include="SpecModule.fs" />
    <Compile Include="Nya/Normalization.fs" />
    <Compile Include="Nya/SpecData.fs" />
    <Compile Include="Formatters.fs" />
    <Compile Include="suchFolder\boi.fs" />
    <Compile Include="suchFolder\Formatters.fs" />
</ItemGroup>

The current project item tree before this PR will look like image

After this PR it'll look like image

Follow up issues

This PR does not add functionality to move folders up/down via the project explorer UI.

I also noticed that drag-drop is not working for F# projects. The issue predates this PR, thus I think it's a distinct unit of work for a different PR.

farlee2121 commented 1 year ago

UPDATE: Stabilized move file and added move folder

I noticed that with folders showing in project order there could be some odd file move behaviors, since the moved project item might get into the middle of a bunch of folder items.

I solved that and that made it easy to support moving folders, so I added support for moving folders too.

This also solves the issue where move up/down wouldn't move items across ItemGroups