-
Notifications
You must be signed in to change notification settings - Fork 168
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-vim not doing anything on WSL2 #706
Comments
Can you share your log? |
So here is a simple config file:
And this are the logs with debug level
I don't have any Visual Studio installed, I imagine that's the reason for the |
Peculiar. Your first request to the server ( |
Do you have any idea what I can try, in order to solve it? |
I think it would be useful if you could try in vim. I suspect there's a communication issue, either in OmniSharp-roslyn or in neovim, so it'll be useful to know if the same thing happens in vim as in neovim. I will try to find time to try to repro, tomorrow or in the weekend. I don't currently have a WSL set up in my Windows VM. |
I have the same problem using vim.
|
Ok well that appears to answer the question of whether this also happens in vim: it does. Seems like OmniSharp-vim cannot communicate with OmniSharp-roslyn in WSL2 currently 😢 |
I just downgraded to WSL1 and everything works, so it seems that way 🤔 |
I've been experimenting a bit with this, I installed both a WSL1 and WSL2 instance in my Windows VM and tried some things. In WSL2 neither Vim nor neovim are able to communicate reliably with the server. They are able to send 2 requests, which are received by the server, and handled correctly. But after that no more requests are received by the server, and the server doesn't return any more responses to vim/neovim. I don't know the reason for this at all. But it reminds me of the issue we had in neovim 0.4 on Windows, which wasn't able to communicate with the server (that bug was eventually fixed in neovim). We had a workaround in that case, discovered by @jpfeiffer16, to use a simple dotnet core proxy between neovim and the .NET Framework server. I just tried this out again and it works. It's reasonably simple to do:
This is a bit clumsy but does get OmniSharp-vim working in WSL2 with a Windows server. As to what the actual problem is ... I don't know, I'd love to hear anyone's ideas! |
Thank you very much, I'll test this in the next few days, when I get a little more time... 👍 |
Wow, the "next few days" turned out to be a very long time! I'm sorry 🙈 |
Should this be closed if we need a hack to get it working? |
Probably not, it's good for people to be able to find it easily. I don't believe the error itself lies on the Vim side, but ideally it would be nice to be able to "package" the workaround up. A possible way forward could be to clean up the |
It seems that working with two projects simultaneously does not wok with this approach.
|
OK that's an error in the proxy. The simplest solution (and probably the correct one in this case, since we already perform logging elsewhere) is just to disable the logging (remove the File.Create(...) line and the logStream usage). |
I had considered something similar to that, but neovim had in theory solved the "overlapped io" bug that was causing it. |
Actually, I never added that directive. My bad. Is this something that would be useful for me to add? |
For the time being, you can just rip out all of the logging logic. You don't need it. It's just for debugging purposes. It will speed things up a ton as well. |
Yeah that might be a good idea, or just remove the logging code completely as you say |
Yea. I will make sure it's not in a fresh build with no changes. You can change the code to put it back if you need it. |
I pushed those changes. |
OmniSharp-roslyn Net6 and Vim8.2 worke well on wsl2 |
Great to hear! I hadn't tried it yet. |
I just installed Arch WSL2 and tried to use omnisharp-vim from neovim with the same configuration as in WSL1.
On the first start, the OmniSharp.exe binary is successfully installed in the AppSettings folder of my Windows user.
When opening a project (sln with 2 projects) I don't get any errors, but there is neither code-highlighting nor the completion works.
When calling :OmniSharpStatus I get that the server is running.
The same solution with the same configs work in WSL1, but I have no idea how can I debug this problem. Any ideas?
The text was updated successfully, but these errors were encountered: