Skip to content

[FEATURE]: add roslyn-language-server as opt-in C# LSP alternative to csharp-ls #14462

Description

@jmbryan4

Feature request

Is your feature request related to a problem?

The current C# LSP support uses csharp-ls, a community-maintained implementation. Microsoft now publishes an official C# LSP based on Roslyn — roslyn-language-server — as a .NET global tool on NuGet. This is the same server that powers the C# extension for VS Code and C# Dev Kit.

Describe the solution you'd like

Add roslyn-language-server as a built-in LSP option alongside csharp-ls, selectable via the OPENCODE_EXPERIMENTAL_LSP_ROSLYN=1 env flag (same pattern as OPENCODE_EXPERIMENTAL_LSP_TY for pyright vs ty).

  • New server ID: csharp-roslyn
  • Default: disabled (existing csharp-ls behaviour unchanged)
  • Opt-in: set OPENCODE_EXPERIMENTAL_LSP_ROSLYN=1 to switch — this disables csharp-ls and enables roslyn-language-server
  • Auto-installs via dotnet tool install --global roslyn-language-server --prerelease into opencode's bin dir if not found on PATH
  • Spawns with --stdio --autoLoadProjects

.NET global tool on NuGet: https://www.nuget.org/packages/roslyn-language-server/

  • I have verified this feature I'm about to request hasn't been suggested before

PR #14463

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions