Skip to content
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 working on git-bash's vim #705

Open
gorrioncillo opened this issue Jun 26, 2021 · 3 comments
Open

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

gorrioncillo opened this issue Jun 26, 2021 · 3 comments

Comments

@gorrioncillo
Copy link

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

@nickspoons
Copy link
Member

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.

@gorrioncillo
Copy link
Author

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

@nickspoons
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants