emacs-fsharp-mode icon indicating copy to clipboard operation
emacs-fsharp-mode copied to clipboard

Support project file modifications via LSP

Open baronfel opened this issue 2 years ago • 1 comments

Description

FSAC provides LSP commands for project file modifications that prevent client applications from having to learn the details of this format. It would be nice to have integration for:

  • fsproj/moveFileUp
  • fsproj/moveFileDown
  • fsproj/addFileAbove
  • fsproj/addFileBelow
  • fsproj/addFile
  • fsproj/removeFile

The moveFileUp/moveFileDown/addFile/removeFile commands all use the following structure:

type DotnetFileRequest =
  { FsProj: string // absolute path to the project file (not a file:// uri)
    FileVirtualPath: string // relative path (from the parent directory of the FsProj above) specifying the file to act on
  } 

The addFileAbove/addFileBelow commands use the following structure:

type DotnetFile2Request =
  { FsProj: string // absolute path to the project file (not a file:// uri)
    FileVirtualPath: string // relative path (from the parent directory of the FsProj above) specifying the file the new file will be added above/below
    NewFile: string // relative path (from the FileVirtualPath above) specifying the new file to create
  }

baronfel avatar Aug 23 '22 19:08 baronfel

I took a stab at this that works pretty well for me (I've been running it in a private fork for a while). There are some design choices that I'd like to get consensus around, and I probably need to beef up the testing before really issuing it as a PR

#333

amcguier avatar Sep 06 '23 04:09 amcguier