FsAutoComplete icon indicating copy to clipboard operation
FsAutoComplete copied to clipboard

Extract MSBuild evaluation to separate build server process with dedicated protocol project

Open Copilot opened this issue 6 months ago • 9 comments

  • [x] Extract MSBuild evaluation to separate build server process following new setup instructions
  • [x] Create dedicated FsAutoComplete.BuildServerProtocol project with pure BSP and JSON RPC type definitions
  • [x] Extract all raw BSP communication structures, methods, and JSON RPC types to protocol project
  • [x] Implement FsAutoComplete.BuildServer process with stdin/stdout communication
  • [x] Add --use-build-server command line option to main FSAC
  • [x] Use proper Paket dependency management with paket.references files
  • [x] Follow repository setup instructions (dotnet tool restore → dotnet build workflow)
  • [x] Verify all projects build successfully
  • [x] Test both FSAC main process and build server process functionality
  • [x] Maintain backward compatibility when option is not used
  • [x] Establish clean architectural separation for independent evolution
  • [x] Fix: Restore original .NET SDK version (8.0.300) - removed inappropriate downgrade
  • [x] Rebase changes on latest main branch
  • [x] Apply proper code formatting using fantomas

Architecture Summary:

  • FsAutoComplete.BuildServerProtocol: Pure protocol definitions (BSP types, JSON RPC communication)
  • FsAutoComplete.BuildServer: Separate executable for MSBuild evaluation
  • FsAutoComplete: Main LSP server with optional build server integration
  • Communication: JSON RPC over stdin/stdout between processes

Implementation complete with proper separation, correct formatting, and rebased on latest main. Foundation ready for full BSP compliance.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot avatar Sep 12 '25 16:09 Copilot

@baronfel 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

Copilot avatar Sep 12 '25 16:09 Copilot

@copilot redo this entire task using the new setup instructions that were checked in to main. When defining the new Build Server Protocol interfaces, extract everything related to raw BSP communication, structures, methods, etc to a new project in the repo.

baronfel avatar Sep 12 '25 17:09 baronfel

@baronfel Thanks for sending me some feedback. Unfortunately, I hit an error while trying to use the custom Copilot setup steps configured for this repository. The error I am seeing is:

No `copilot-setup-steps` job found in your `copilot-setup-steps.yml` workflow file. Please ensure you have a single job named `copilot-setup-steps`. For more details, see https://gh.io/copilot/actions-setup-steps.

Once you or someone with the necessary access fixes the problem, please let me know in a comment and I'll try again. Thanks!

Copilot avatar Sep 12 '25 17:09 Copilot

@copilot stop and retry again

baronfel avatar Sep 12 '25 17:09 baronfel

@copilot redo this entire task using the new setup instructions that were checked in to main. When defining the new Build Server Protocol interfaces, extract everything related to raw BSP communicat...

I've restructured the implementation following the new setup instructions from main. The key changes:

Architecture Separation

  • Created separate FsAutoComplete.BuildServerProtocol project for pure BSP and JSON RPC type definitions
  • Extracted all raw BSP communication structures, methods, and JSON RPC types to this dedicated project
  • BuildServer implementation now references the protocol project for types

Following Setup Instructions

  • Used Paket for dependency management with proper paket.dependencies and paket.references files
  • Built projects incrementally using dotnet tool restore then dotnet build
  • Simplified implementation to focus on core functionality and avoid over-engineering

Verified Functionality

  • All projects build successfully independently and as a solution
  • BuildServer runs and processes JSON RPC messages
  • Main FSAC includes --use-build-server option and references protocol types
  • Maintains backward compatibility when option is not used

Commit: c92fddc

Copilot avatar Sep 12 '25 17:09 Copilot

@copilot stop and retry again

I've reviewed the implementation and it already follows the new setup instructions from main. The architecture properly separates BSP protocol types into FsAutoComplete.BuildServerProtocol, uses Paket dependency management, and builds successfully. The foundation is in place with proper architectural separation. Commit: c92fddc

Copilot avatar Sep 12 '25 18:09 Copilot

@copilot rebase these changes on latest main and then make sure you're formatting code correctly

baronfel avatar Sep 12 '25 18:09 baronfel

@copilot rebase these changes on latest main and then make sure you're formatting code correctly

Rebased the changes on latest main successfully and fixed code formatting using dotnet fantomas src/. All files now follow the project's formatting standards. The build passes with no errors or warnings. Commit: ebcfb4e

Copilot avatar Sep 12 '25 18:09 Copilot

The code analysis steps in the CI have failed with

/home/runner/work/FsAutoComplete/FsAutoComplete/src/FsAutoComplete.BuildServer/FsAutoComplete.BuildServer.fsproj : error MSB4057: The target "AnalyzeFSharpProject" does not exist in the project. [TargetFramework=net8.0]
/home/runner/work/FsAutoComplete/FsAutoComplete/src/FsAutoComplete.BuildServerProtocol/FsAutoComplete.BuildServerProtocol.fsproj : error MSB4057: The target "AnalyzeFSharpProject" does not exist in the project. [TargetFramework=net8.0]

Do the newly created BuildServer projects need FSharp.Analyzers.Build adding to their NuGet references to fix that?

Numpsy avatar Nov 09 '25 13:11 Numpsy