JetBrains / resharper-fsharp

F# support in JetBrains Rider
Apache License 2.0
327 stars 52 forks source link

Provide and document a way to run the plugin with a locally built FCS #494

Open safesparrow opened 1 year ago

safesparrow commented 1 year ago

I would like to run the Rider F# plugin with a locally built FCS. This would allow me to do the following:

I have a workaround, which is currently as follows:

  1. Checkout https://github.com/JetBrains/fsharp/tree/net231
  2. ./build.cmd -noVisualStudio - this fails, but only for test projects that are not relevant - is there a script that does not fail?
  3. Copy FSharp.Compiler.Service.dll to $NUGET_CACHE\jetbrains.fsharp.compiler.service\2023.1.1\lib\netstandard2.0\
  4. dotnet restore --force && dotnet build to bring in the built dll to the plugin.
  5. Run the IDE as usual.

This is hacky and cumbersome.

I would expect that maintainers of this repo have a much better workflow. Would it be possible to share it if it exists?

Plugin and FCS in one solution

What would make debugging and hacking around even better would be having a single solution containing both the plugin projects and FCS projects - for local dev purposes only. This way one can make changes to both and debug both.

Currently this involves opening two solutions, doing the NuGet dance as described above, and only one of the two solutions can have a debugger attached to the backend process, so it's not possible to debug both sides at the same time.

I believe this might be of interest to @nojaf .

safesparrow commented 1 year ago

For this to work well, https://github.com/dotnet/fsharp/pull/14677 should be done first - this would avoid having to build the bootstrap compiler and avoid any dependencies that brings in (which probably won't work if projects are referenced from another solution/directory).

I tried the changes from that PR in this repo, and I'm getting the following error:

dotnet build .\FSharp.Compiler.Service.sln /p:BUILDING_USING_DOTNET=true
...
C:\projekty\fsharp\jetbrains-fsharp\src\Compiler\FSharp.Compiler.Service.fsproj : error MSB4057: The target "_GetRestoreSettingsPerF
ramework" does not exist in the project. [TargetFramework=netstandard2.0]