Skip to content

Use Roslyn language server directly#57

Merged
reflectronic merged 1 commit into
zed-extensions:mainfrom
reflectronic:roslyn-direct
Feb 17, 2026
Merged

Use Roslyn language server directly#57
reflectronic merged 1 commit into
zed-extensions:mainfrom
reflectronic:roslyn-direct

Conversation

@reflectronic
Copy link
Copy Markdown
Contributor

The Roslyn language server previously required sending private messages (solution/open, project/open) to load projects into the language server. Since this isn't possible with the Zed extension API, we used a wrapper program (csharp-language-server) which intercepted the Roslyn language server initialization and generated these private messages automatically.

Roslyn has since gained the ability to auto-load projects (using the --autoLoadProjects argument), so csharp-language-server is no longer necessary (and has been deprecated). Now we download and execute Roslyn directly from the Microsoft NuGet feed.

Fixes #55

@cla-bot cla-bot Bot added the cla-signed label Feb 17, 2026
@reflectronic reflectronic merged commit 87ee023 into zed-extensions:main Feb 17, 2026
7 checks passed
@BlueCyro
Copy link
Copy Markdown

BlueCyro commented Feb 26, 2026

Hey, this actually breaks solution loading as far as I can tell. :(

SofusA's language server allowed specifying a solution, but roslyn-language-server currently does not. While it does auto-load projects, it auto-loads them individually and as far as I can tell, doesn't actually respect opening the solution properly.

I realize this is likely an issue to be made on the roslyn-language-server repo, but I just wanted to state that there is a regression in functionality.

It seems I'm a little late on the draw since this is merged now, but I wanted to make some noise regardless to see if maybe something could be done in the immediate term.

For context: I work with solutions where the dependencies are defined outside of the actual solution directory, and since roslyn-language-server doesn't do this, $(SolutionDir) does not seem to get populated correctly in some of the .csproj files, causing certain projects to fail to load.

@SofusA : It looks like you also archived your repo (and it was also used here) so I didn't have a super concrete way to mention this; but roslyn-language-server is NOT at feature parity with yours due to this fact, and since both your repo is archived and the zed extension no longer uses yours, I can't load solutions the way I need to. :(

@SofusA
Copy link
Copy Markdown

SofusA commented Feb 26, 2026

@SofusA : It looks like you also archived your repo (and it was also used here) so I didn't have a super concrete way to mention this; but roslyn-language-server is NOT at feature parity with yours due to this fact, and since both your repo is archived and the zed extension no longer uses yours, I can't load solutions the way I need to. :(

I am sorry to hear. Hopefully Microsoft will implement a better loading of solutions.

You can use csharp-language-server in Zed until then by using a semi-hacky way to use omnisharp configuration:

"lsp": {
  "omnisharp": {
    "binary": {
      "path": "csharp-language-server"
    }
  }
}

@BlueCyro
Copy link
Copy Markdown

BlueCyro commented Feb 27, 2026

@SofusA : It looks like you also archived your repo (and it was also used here) so I didn't have a super concrete way to mention this; but roslyn-language-server is NOT at feature parity with yours due to this fact, and since both your repo is archived and the zed extension no longer uses yours, I can't load solutions the way I need to. :(

I am sorry to hear. Hopefully Microsoft will implement a better loading of solutions.

You can use csharp-language-server in Zed until then by using a semi-hacky way to use omnisharp configuration:

"lsp": {
  "omnisharp": {
    "binary": {
      "path": "csharp-language-server"
    }
  }
}

Thanks for the quick tip! Apologies for making a bit of a ruckus at you. I plan to make an issue on their github about it. Hopefully they do fix it, but in the meantime this is a life saver!

EDIT: Letting anybody who comes across this know that you may need to edit the config for roslyn instead of omnisharp since the zed extension now defaults to using roslyn. The instructions are the same, just swap the names of the language server you're editing if omnisharp doesn't do the trick.

@reflectronic
Copy link
Copy Markdown
Contributor Author

reflectronic commented May 11, 2026

roslyn-language-server can now auto-load solution files, and also allows you to manually specify a solution to load: https://github.com/dotnet/roslyn/blob/main/docs/roslyn-language-server-copilot-plugin.md#automatic-project-loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

https://github.com/SofusA/csharp-language-server is deprecated

3 participants