-
-
Notifications
You must be signed in to change notification settings - Fork 895
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
Omnisharp connects but fails to work #1125
Comments
Are you sure that you are using the latest version of the omnisharp? There were a lot of issues fixed in omnisharp regarding lsp support. |
@yyoncho both tried the one installed from Omnisharp and actual omnisharp-roslyn page but I'll try and see if I can find an unstable branch that works when I get a chance. |
I'm also getting this issue:
followed by:
Omnisharp-Roslyn is on v1.34.7 I can confirm that I don't get this issue with standalone Omnisharp-Emacs |
I couldn't find a newer version of omnisharp-roslyn. but I tried older versions, namley a 6 month old one, linux vs windows, even gave it a go on msys. I tried an older lsp-mode.el . Couldn't get any of them working. I might have messed up trying an older version of omnisharp-roslyn, but I can only assume that there is something wrong with lsp-mode in my particular configuration. |
@Mallchad can you try with the latest lsp-mode? It will automatically download and configure omnisharp. In case, it still does not work can you attach a sample project? |
The same thing happens to me. However if I refresh the file with C-x C-v AFTER the server has completely finished loading .csproj's then the issue goes away. The actual issue appears for me to be that omnisharp-roslyn sends a response to I.e. it sends the response before it has finished loading all the projects on the solution, thus any requests lsp-mode sends before that is done are bound to fail in some way. For some larger solutions it might take a while for all projects to load and for the moment we don't have a way to know when except for watching when these (or similar) lines appear on
There has been a couple of issued registered on omnisharp-roslyn repo on this:
BTW this same crash appears to be happending for @sebasmonia on #1108 (comment) |
Thank you @razzmatazz . Do you think we can create a workaround by waiting for "Successfully loaded project file" message or we should close the issue and wait for the upstream? |
IMHO fixing this upstream is a better approach, – I will try to register an issue and/or maybe a PR to omnisharp-roslyn once I understand what is actually wrong here.. |
Ok. Then once you have a more details I suggest closing this issue and #1108 and adding a faq entry pointing to the upstream issue(and eventually mentioning that the user should wait for the loaded project message). |
@razzmatazz @yyoncho |
@razzmatazz do you know if the upstream has been fixed? |
As far as I know — not yet (tested a couple of weeks ago)
Actually I have started writing my own lsp server for C# in the meantime — l as attempting to fix omnisharp is just too much mental load for me, the codebase is rather sophisticated/complicated.
https://github.com/razzmatazz/csharp-language-server
I forked lsp wiring off https://github.com/fsprojects/fsharp-language-server and things are surprising easy to implement. (I know Pareto rule will show its head eventually)
—Saulius Menkevičius
… Am 22.02.2020 um 15:03 schrieb Ivan Yonchovski ***@***.***>:
@razzmatazz do you know if the upstream has been fixed?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
@razzmatazz that is cool. Feel free to link it from lsp-mode supported servers if you are looking for more contributors. |
It is really too early, basic things don’t work. But definitely will inform once I have something that works somewhat for me, — having something that works is better than nothing. In the meantime I’m ok with using omnisharp-emacs w/omnisharp (non lsp Setup) |
It seems to be fixed in yesterday's release: https://github.com/OmniSharp/omnisharp-roslyn/releases/tag/v1.34.14 At least, it is yet again feeding popup information and company completion correctly. No need to reopen the file once the project is fully loaded. Still, I had a few issues that eventually I will be able to reproduce. dotnet --version: 3.1.101 |
@lxbarbosa great! will take a look to confirm |
Actually it's not working at all. LOL Once it loads a project it parsers and correctly provides information to popup and company. Changing the code and it is stuck with early "parsing" state. eg: changing a string var to char and it still shows the same early information. The same goes for company completions. As for linting, flymake never "worked" Well, its almost there :D |
It does not work for me either. It connects, but then nothing. Not even a popup or company. :( |
Yes, it still does not work. However, I noticed @david-driscoll and others are still actively working on improving LSP part of Omnisharp so hopefully LSP w/ C# is coming eventually: |
I made a PR for omnisharp-roslyn that upgrades LSP component and doing that fixes some of the issues (at least for me) -- now I have proper autocompletion context, flycheck, go-to-def, lenses and some other things working. |
v1.35.1 released. Most of its feature works correctly once But it still unaware of any change in the file is made. |
@lxbarbosa yeah, that is because of omnisharp-roslyn LSP file sync issue. My PR to fix this is no longer WIP, -- hopefully maintainers of omnisharp-roslyn will take a look at that. |
For those interested the issue seems to be fixed in OmniSharp/omnisharp-roslyn#1791. YES! |
Using a minimal project to test and building Omnisharp from |
I have also added a handler for the |
Pre-release of v1.35.2 with @razzmatazz PRs is out. https://github.com/OmniSharp/omnisharp-roslyn/releases/tag/v1.35.2 |
Uh, they didn’t merge the code actions and workspace symbols handlers yet.. but the sync issue should be fixed finally though. |
@razzmatazz |
Can confirm the latest update does solve most issues. |
@Mallchad |
This is wonderful. Thank you! It works like a charm. Bye bye omnisharp-emacs? Most probably. |
I am planning to deprecate omnisharp-emacs eventually, but some features are still not working with LSP. At least the ones that I use :) -- e.g. running unit test(s). Thus I am kind of reluctant to declare a victory yet. I am starting to implement some of those things (unit test running on queue): |
@razzmatazz I agree it is good but there is still a lot of work to be done. @lxbarbosa as to answer your question the one thing that doesn't necessarily work is external libraries, particularly UnityEditor.dll |
To run unit tests I'm using dotnet.el. It's not perfect, and many times I've toyed with the idea of a mega submission or creating a new package. But, it works! |
@sebasmonia
Those features hardly will be in the scope of LSP servers, though! I wonder if it would be better a CLI tool instead of an Emacs package. |
Part of this functionality is already facilitated with packages like
yasnippet and the codelens server capability that has been wired up in
razzmatazz' PR omnisharp-roslyn/#1799
I think automatic method creation is probably well out of the scope of this
project.
Formatting document is something that emacs provides in a light way by
default, mainly through indentation,
but there could be a code formater from omnisharp wired up, but I don't
know if that implementation actually existed to begin with.
…On Fri, 22 May 2020 at 16:23, Alexander Barbosa ***@***.***> wrote:
@sebasmonia <https://github.com/sebasmonia>
One idea I had is to bring to emacs a few essential Visual Studio/Rider
features as Method extract, inserting Constructor, automatically creating
method as we add a new parameter, format document...
I wonder if it would be better a CLI tool instead of an emacs package.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1125 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AK5GWWNXRRJYHOA3Z4PW5ULRS2RI3ANCNFSM4JDROGXQ>
.
|
Snippets: Format Document: Its kinda just indentation, what I mean is following .NET standards as:
Method(string param1, string param2, string param3, string param4, string param5) to Method(string param1, string param2,
string param3, string param4, string param5) ... Other features that I miss in emacs are:
|
Actually, most of the functionality you listed above has already been available in omnisharp-roslyn/omnisharp-emacs and will be available over LSP with the next omnisharp-roslyn release (my code actions PR has been merged already) So it is closer than you think :) |
@razzmatazz |
Describe the bug
After connecting the omnisharp language server when opening a
.cs file
, nothing much in it just for test purposes to see if the server worked I always get errors, eitherSystem.NullReferenceException
or(wrong-type-argument hash-table-p nil)
like mentioned in #815I believe this is purely an lsp-mode problem because standalone omnisharp-emacs (https://github.com/OmniSharp/omnisharp-emacs) works just fine almost out of the box even though they use the same server of omnisharp-roslyn
Flycheck also states that "A suitable syntax checker is not found." despite the connecting to the language server.
To Reproduce
Emacs with lsp mode hooked onto prog-mode.
omnisharp roslyn release or build placed in
~/.omnisharp/omnisharp/omnisharp
empty C# file, hovering over any text will give you the error
Expected behavior
I expected to get either some kind of flycheck error or C# related company popup while typing or manually invoking
M-x company-lsp
Which Language Server did you use
Omnisharp-Roslyn, release, manual build using including build.ps1 and through copying over Omnisharp-emacs files
OS
Which os do you use?
WIndows 10
Error callstack
If there is an error please reproduce the issue with
toggle-debug-on-error
and after settinglsp-print-io
to t, and then include the callstack and attach the content of*lsp-log*
buffer and the content of the server log(uselsp-workspace-show-log
)LSP Log Error
LSP Full Log
(https://gist.github.com/Mallchad/b6c7900b6975d5169826bae963bcf994)
LSP IO Log Error
LSP IO Full Log
(https://gist.github.com/Mallchad/decd44f66df2cc973391aabb5a1201b9)
The text was updated successfully, but these errors were encountered: