-
-
Notifications
You must be signed in to change notification settings - Fork 865
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lsp-csharp doesn't work with C# .net 6 projects when using csharp-ls as a language-server #3198
Comments
@josteink there is razzmatazz/csharp-language-server#3 issue reported by someone yesterday will take a look later today/this week as for csharp-ls -- this is my reimplementation of LSP server on top of roslyn (independent implementation from omnisharp-roslyn) -- I got tired trying to get people @ omnisharp-roslyn to merge my PRs and fixes and figured I could my own LSP server -- shouldn't be that hard huh.. and for most part it isn't that hard :D as LSP maps really nicely to Roslyn APIs. omnisharp-roslyn is way more complex and has long history, as it needs to support old protocol for vscode client and other things -- csharp-ls is much simpler it already has some features omnisharp-roslyn doesn't, like go-to-definition in metadata I think this should then be closed :) |
I think closing is premature. You can see this issue is really 2 issues:
The latter is definitely an issue which should be fixed in lsp-csharp IMO. |
oh.. right |
There is lsp-enabled-clients and lsp-disabled-clients which you can use for selecting what servers you want to run. |
I believe there is nothing else here(please reopen if you disagree). |
Not so much agreeing vs disagreeing, as much as I think lsp-mode should let me chose (interactively) what language server to use when there are several options. Right now it seems it just defaults to the last one defined and forgets/disregards previously defined language servers. As a user there's literally no way to know there are other options (which can be enabled/disabled through elisp), because only one option is shown. If that user-experience could be improved, I for one would really appreciate it. Is this a general problem for lsp-mode as a whole or an issue specific to lsp-csharp? I don't know. Wouldn't it be interesting to find out? I know rust has the same thing with several language servers (rls vs rust-analyser). Does the same issue manifest itself there? I know as a maintainer one may be overburdened with work, but still, just closing the issue seems a tad dismissive to me. |
@josteink I could not replicate your problem though.. (doom emacs + some stock version of emacs-lsp/lsp-mode) I get omnisharp (as second selection item) and then, when I type "ENTER" it installs and runs properly for me..
you said something about "shadowing" of omnisharp server version, how does it manifest on your machine? one thing we could do is mark "csharp-ls" as "experimental" on the server selection list, as it is not of that high quality as omnisharp-roslyn (even if it has other features that omnisharp lacks) maybe we should change priority of the csharp-ls ? @yyoncho now we have "csharp-ls" with |
Thanks for the feedback so far guys. I’ll try to get a screenshot and a minimal POC for reproducing tomorrow, so we have something (more) concrete to work with. I mean, if I had gotten both options like you did, I wouldn’t have posted a issue here 😅 |
@josteink this was discussed at the beginning of the project.
For sure if we ask the user to pick a server each time you open a project will bring tons of issue reports until we turn that off which again will narrow down to using lsp-enabled-clients/lsp-disabled-clients.
I thought that I have answered your question. |
I think that it is up to you. About the order of the servers in the list - we should do sorting by priority. I believe now the sorting is random. We may add a flag to the client |
so |
@josteink now I am wondering, is your problem that you: |
@razzmatazz no, priority atm is strictly for selecting which LS to run when both are present. https://emacs-lsp.github.io/lsp-mode/page/faq/#i-have-multiple-language-servers-registered-for-language-foo-which-one-will-be-used-when-opening-a-project |
btw, @josteink I have just released |
No idea why, but seeing as:
I really think it's fully OK to close this issue. Not sure what happened here or why, but sorry for wasting your time. I'll try to make sure it doesn't happen again 😄 |
Thank you for the bug report
lsp-mode
related packages.where
lsp-start-plain.el
can be downloaded here.Bug description
The title pretty much says it all, but if that was all I realize I should be reporting this in
csharp-ls
instead of here 😄The main problem seems to be that
lsp-csharp
actually provides 2 language-servers:Omnisharp-Roslyn
csharp-ls
... which somehow wraps Omnisharp?Of these two only
csharp-ls
is unable to run with .NET 6 projects.So the solution is for the user to chose the Omnisharp server, and keep on working, right?
And here is the problem: The way
lsp-csharp
is implemented thecsharp-ls
language server "shadows" theOmnisharp-Roslyn
language-server, makingcsharp-ls
the only selectable/installable language-server option for C#.A temporary workaround I have to work with .NET 6 so far is to:
csharp-ls
code inlsp-csharp.el
If we have 2 language servers for one language, it should IMO be possible for the user to chose which one he prefers, and right now it seems like that is not really possible.
CC: @razzmatazz
Steps to reproduce
Observed:
csharp-ls
language server (with no choice for other server)Expected behavior
If several language servers are available:
Which Language Server did you use?
lsp-csharp with csharp-ls language server.
OS
Linux
Error callstack
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: