omnisharp-vim icon indicating copy to clipboard operation
omnisharp-vim copied to clipboard

Omnisharp-vim not working on git-bash's vim

Open gorrioncillo opened this issue 4 years ago • 3 comments

I git clone the repo, then I try to download roslyn but did not work, after try some solutions explained here, but any work. So, I try to install manually the server roslyn, and it seems that works (at least no more errors on vim while opening cs files), but when I try to use some command like :OmniSharpGetCodeActions but do not show anything, even omni completition. When try :OmniSharpStatus it says it is running but do the same any command work. I try putting let g:OmniSharp_server_install = 'C:\<PATH>\.omnisharp-roslyn', and let g:OmniSharp_server_path = 'C:\<PATH>\.omnisharp-roslyn\OmniSharp.exe' But any works. I do not know what else to do, maybe someone can help. Thanks in advance

gorrioncillo avatar Jun 26 '21 21:06 gorrioncillo

Hi @gorrioncillo,

Unfortunately, stdio communication does not work with the OmniSharp-roslyn server from msys (git bash) or cygwin. I don't really understand why but I've never managed to send a successful request to the server in these environments.

The only option from git bash is using the HTTP version of the server, which is a different executable. So you'd want the omnisharp.http-win-x64.zip release. Note that the HTTP server requires python, and is not asynchronous. The omnisharp-vim integration with the HTTP server is basically obsolete, and remains only as a last resort.

I strongly recommend using Windows Subsystem for Linux (WSL) rather than trying to actually code C# in git bash. In WSL, OmniSharp-vim will be able to install the stdio server itself (either the Windows version or the linux version, but I expect you'll want the Windows version, so add let g:OmniSharp_translate_cygwin_wsl = 1 to your .vimrc. See the README for more details.

nickspoons avatar Jun 28 '21 00:06 nickspoons

ouw, so sorry to hear that, but it is OK. I wonder to say that maybe "winpty", a program which helps to use programs that output to stdout (It works with python3 inside git-bash). Maybe that can help. Thanks for the quick response

gorrioncillo avatar Jun 28 '21 21:06 gorrioncillo

Hmm. I gave it a quick try with winpty but now vim no longer receives any response from the server :shrug:

nickspoons avatar Jun 28 '21 22:06 nickspoons