Creating a project file item for F# projects adds it to the end of the item list and displayed files.
It can then be moved using move up or directly editing the project file.
Behavior After PR
Two new context menu items are added for Create file above and Create file below, but only in F# projects. These actions respect the normal create file experience (i.e. naming, templates) but will insert the created file into the project file next to whatever project item was selected to trigger the command.
This required a new optional parameter passed through the createFile call chain.
Decisions of Note
I decided to modify and reuse the create file command and it's call chain since there seemed to non-trivial logic that would be duplicated in new commands and easy to forget to maintain. There also didn't seem to be any benefit in splitting out new manager methods or actions. The file manager would have to ignore relative position in any case just like it does with move up/down.
I named the context menu items with create instead of add (i.e. Create file above instead of Add file above) This is different from visual studio's naming but consistent with this explorer's naming. We also don't support adding existing items relatively.
I added the custom type RelativeFilePosition to the project folder mimicking how ProjectFileStat is handled
I noticed a decent amount of shared defensive programming and iteration between the move and relative create actions, so I centralized them in someProjectItem
Motivation
See issue #270
Behavior Before PR
Creating a project file item for F# projects adds it to the end of the item list and displayed files. It can then be moved using move up or directly editing the project file.
Behavior After PR
Two new context menu items are added for
Create file above
andCreate file below
, but only in F# projects. These actions respect the normal create file experience (i.e. naming, templates) but will insert the created file into the project file next to whatever project item was selected to trigger the command.This required a new optional parameter passed through the
createFile
call chain.Decisions of Note
Create file above
instead ofAdd file above
) This is different from visual studio's naming but consistent with this explorer's naming. We also don't support adding existing items relatively.RelativeFilePosition
to the project folder mimicking howProjectFileStat
is handledsomeProjectItem