-
-
Notifications
You must be signed in to change notification settings - Fork 892
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
Emacs + ls-mode fail on C# file in Linux Ubuntu 20.04 #2188
Comments
Can you provide that project or another one that can be used to reproduce the issue? Most likely it is a server-side issue. I am not 100% sure if the server supports that kind of project. @razzmatazz might know better. |
I think you are right. Here is the output of The .csproj and .sln are |
CC @sebasmonia as well. |
hi @snowgoon88! Haven't used Unity projects with Omnisharp but from your logs it would seem that something more fundamental is missing. Have you installed the C# SDK? And one thing worth trying is, following @yyoncho 's suggestion, create a new project |
Hmm, as I said, I'm not skilled in the C# environment. I'm on Linux, using Unity and tried to use Emacs as an editor.
They seem to come from
Ok; installing .Net from Micro$oft... |
I am not sure what is missing in your environment, but something is. |
Yes, I did follow the instruction. I have one good news : I restarted my linux session, and now it works smoothly for the basic console project. Nice. Still, the bad news (for me) is that lsp-mode still fails on .cs file inside a Unity project. Mostly because of .csproj file as in the basic console project, the log says :
whereas with the files coming from Unity, I have :
It seems strange to me because omnisharp comes with its own mono (and thus SDK I think), supposed to deal with .NET version 4.7.2 and then, in *Message* buffer after M-x lsp RET on one of my file...
|
Yes it does seems strange. Usually I would say it referencing 4.7.2 is a problem with Windows dependencies (the version numbers on .NET are up to 4.7 for "old .NET" and up to 3 for "dotnet core". PS: soon we will have a single .NET, version 5, all unified. But until then the 4.7 log entries are suspicious. |
Ok, I was not aware of the existence of 2 different .Net ... ok... So, it seems the issue comes from omnisharp. But, as I said, it comes with Mono (compilation of C# on Linux) that is supposed to be compatible with .Net 4.7.2. I guess I will have to wait to use lsp on Unity. Too bad. |
I have it working on my ubuntu 20.04. So I've modified the run script as below and even if I still have some errors while the connection with server is initialized, sometimes it works. In fact; my second try was the good one : lsp is ok, can find definitions, suggest proper actions and completions. (although, a bit slow but Unity is Huge) (to be complete, I mention the solution suggested in OmniSharp/omnisharp-roslyn#1948 (comment), but I haven't tested it) My run file
|
But I have to restart the server several times (like 3 or 4) for it to finally work. Not very user friendly... |
Did you try to wait for some time? I am closing this issue since it seems there is nothing to do on emacs side. |
I think that there was an issue related to startup. Where if you do some operation right after the server has started it breaks. In this case you have to close the buffer and open it again. |
OK, I'll check. But waiting before doing things does not solves the problem : I've waited 15min. Nothing. Restarted the server, and everything was ok, nearly instantly. BTW, on the server side (omnisharp) they have closed the issue, saying it was the client that was responsible of "finding" the good |
You may either rename this bug or open another one. |
Not sure I agree with the assessment that it's on the client to find EDIT: just read the issue, they said it's up to the user to install global mono, I understood they were asking lsp-mode to locate it. I kind of agree with their point. They provided a minimum to get it working but if you need extra dependencies is up to you to set them up. |
There is not much I can add here, except for trying with another omnisharp client (like vscode) and then noting if there is a difference in behaviour, and if not (i.e. if it works the same in emacs and VS code -- which uses legacy/custom protocol) -- report the issue to omnisharp-roslyn server project, which I see has been done here. Other than that, I have added a PR #2196 which handles 'o#/error' notifications from the server and displays them in |
I am not able to replicate this. Sadly my setup randomly broke today, and I've been trying a couple various solutions. |
Describe the bug
Using emacs + lsp-mode with Linux (Ubuntu 20.04) on C# files, it seems I can connect to the omnisharp server but then nothing work and I have "LSP :: Error from the Language Server: Internal Error - System.NullReferenceException".
Seems related to issue #1125.
To Reproduce
Emacs with lsp-mode package.
Open .cs file
M-x lsp
Expected behavior
Code analysis and flycheck errors (as working for my c++ files)
Which Language Server did you use
omnisharp-roslyn as downloaded by emacs in
~/.emacs.d/.cache/lsp/omnisharp-roslyn/v1.37.1
(I tried to git clone the omnisharp-roselyn and built but failed because of gitVersion)
OS
Linux Ubuntu 20.04
=> mono --version Mono JIT compiler version 6.8.0.105 (Debian 6.8.0.105+dfsg-2 Wed Feb 26 23:23:50 UTC 2020) Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com TLS: __thread SIGSEGV: altstack Notifications: epoll Architecture: amd64 Disabled: none Misc: softdebug Interpreter: yes LLVM: supported, not enabled. Suspend: hybrid GC: sgen (concurrent by default)
Error callstack
lsp-workspace-log in https://gist.github.com/snowgoon88/6e0f1a0cf3eadff11c64076c8dd4fa31#file-lsp-workspace-log
messages.log in https://gist.github.com/snowgoon88/6e0f1a0cf3eadff11c64076c8dd4fa31#file-messages-log
lsp-session
The
Assembly-CSharp.csproj
andImPacman.sln
(generated with Unity) are in/home/alain/Projets/Unity/ImPacman
It might be a difficulty to read/analyse the .csproj or .sln. But I'm not expert enough in C# or emacs to tell. I can share these files if needed.
The text was updated successfully, but these errors were encountered: