Skip to content

feat: replace csharp-ls with roslyn-language-server#14463

Merged
Hona merged 6 commits intoanomalyco:devfrom
jmbryan4:feat/csharp-roslyn-lsp
Apr 21, 2026
Merged

feat: replace csharp-ls with roslyn-language-server#14463
Hona merged 6 commits intoanomalyco:devfrom
jmbryan4:feat/csharp-roslyn-lsp

Conversation

@jmbryan4
Copy link
Copy Markdown
Contributor

@jmbryan4 jmbryan4 commented Feb 20, 2026

Issue for this PR

Closes #14462

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Replaces csharp-ls with roslyn-language-server as the default C# LSP. (@Hona confirmed this on 2026-04-20 with the Roslyn team).

The CSharp export in lsp/server.ts now installs roslyn-language-server via dotnet tool install --global roslyn-language-server --prerelease and starts it with --stdio --autoLoadProjects. The server id stays "csharp" so existing user configs are unaffected.

How did you verify your code works?

Screenshots / recordings

N/A — no UI changes.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Feb 20, 2026
@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Feb 20, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@adam-paterson
Copy link
Copy Markdown

Just spent the afternoon implementing this myself! ➕

@Hona
Copy link
Copy Markdown
Member

Hona commented Apr 20, 2026

heya @jmbryan4 the rosyln team says their LSP is good now - can you update this PR from dev + remove the flag.
we can fully swap to this one

Bring the branch current with upstream dev (2014 commits). Resolves
conflicts in flag.ts, lsp/index.ts, and lsp/server.ts by taking the
upstream refactored structure and applying the roslyn swap on top.
@jmbryan4 jmbryan4 changed the title feat: add roslyn-language-server as opt-in C# LSP alternative feat: replace csharp-ls with roslyn-language-server Apr 21, 2026
@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels Apr 21, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@jmbryan4
Copy link
Copy Markdown
Contributor Author

@Hona great! I updated the PR

@Hona
Copy link
Copy Markdown
Member

Hona commented Apr 21, 2026

thanks @jmbryan4 presumably you've tested within a C# project using bun dev locally and confirm that LSP errors etc show up?

Comment thread packages/opencode/src/lsp/server.ts Outdated
Comment on lines +725 to +726
"--tool-path",
Global.Path.bin,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets just drop these 2 - global is okay here

@jmbryan4
Copy link
Copy Markdown
Contributor Author

thanks @jmbryan4 presumably you've tested within a C# project using bun dev locally and confirm that LSP errors etc show up?

yes

@Hona Hona enabled auto-merge (squash) April 21, 2026 21:53
@Hona
Copy link
Copy Markdown
Member

Hona commented Apr 21, 2026

thank you - nice work :)

@Hona Hona merged commit 5e9fb3c into anomalyco:dev Apr 21, 2026
8 checks passed
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.

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

3 participants