Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft of FsProj Enhancements #333

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

amcguier
Copy link
Contributor

@amcguier amcguier commented Mar 30, 2023

This PR is a (very) rough draft of some FsProj and eglot enhancements I've been playing with.

I'd love to get some general feedback on the approach and see what folks appetite would be for bringing something like this in.

Pain points this solves for my workflow

  1. Currently, when starting eglot in a multi-project workspace with a sln eglot uses the project integration and ends up finding the fsproj first, even if there's a sln file further up the directory tree, which means I end up running multiple copies of FsAutoComplete when editing client/server projects
  2. When editing an fsproj file with the dotnet command line tools or manually, eglot/FsAutoComplete don't pickup the change, requiring me to kill/restart eglot to get completions on new files
  3. Similar to '2.' when reordering files in an fsproj file during development I have to kill/restart eglot/FsAutoComplete for the changes to be detected

General layout of my approach, and some reasoning.

The solution file issue is straightforward, I've extended the project/sln search to first run a search for a sln file, and then to fallback to either an fsproj file if a sln file cannot be found see here

For adding/removing fs files is accomplished via pretty straightforward modifications to eglot-fsharp itself here. Renaming is similar, although in that case I save the buffer first, and then open the alternative file once the operation is completed.

The changing of the file order is a bit more complicated. I opted to create a new fsproj-mode because it simplifies the implementation of tabulated-list-mode, however this mode isn't intended to be accessed from an fsproj file, but rather launched from an fs file with eglot running, because otherwise getting the running eglot session (or joining one) seems tricky to manage. You can open the buffer for with the command fsproj-list-files and then use u/d to move/change the file order.

amcguier and others added 4 commits March 23, 2023 23:30
Rough draft of using FsAutoComplete to add, remove, rename, and change
the file order of compilable files in an fsproj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant