-
-
Notifications
You must be signed in to change notification settings - Fork 278
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 on Windows fails to run likely because of spaces in user name #455
Comments
Additional information I think may be important. I'm using the auto config option from mason-lspconfig.nvim. This results in LSP setup like this from LspInfo:
|
Today I tried using my nvim-lsp-installer setup again with omnisharp to compare. Everything is still working fine there.
So comparing with the mason setup it seems a likely error spot is from the second path |
Hello! Ah hm something must be up with the Just some semi-related trivia - the So with the above explanation I believe the cmd itself is fine, the issue is in the contents of the edit: Oh and the path separators get normalized somewhere along the way as well. |
Thanks for your response. And thanks again for this amazing project! If you believe the issue is with the CMD file I will try working to solve it as well. I found today that the powershell lsp has a similar error. The LspLog shows the same error. I then tested powershell on Linux and it worked. |
Ok so I've finally figured out where the problem is (relevant Node.js issue here: nodejs/node#7367). This is a bit of a weird edge case on Windows in libuv where if both the command and one or more arguments contain a space, it freaks out with the error message in your logs. Omnisharp in particular will include the workspace directory as an argument to the language server command so it will run into this 100% of the time. Other language servers usually don't have any arguments (or if they do they're generally just options like Short answer is: don't use spaces in directory names, especially your home directory. You'll run into weird issues like these. Slightly longer answer is: imo this is not really an issue that can/should be solved on a plugin-level but rather users would have to override default behaviour to work around this issue. At the very least, it's not an issue with Mason. What you can do to work around this is to override the lspconfig.omnisharp.setup {
cmd = { "cmd.exe", "/C", "omnisharp" } -- The "omnisharp" executable is provided by Mason and will be found by cmd.exe
} The lspconfig configuration for omnisharp will then append all necessary arguments to your |
Thanks for looking into this! I understand this is a weird edge case. I always avoid spaces in my file paths. But unfortunately I am unable to change this directory on my work computer. But since you've narrowed it down to the libuv library, perhaps I'll see if I may be able to help find a fix for that. As for your suggested work around... I found that it still fails in the same way as if I had not added any extra config. |
I believe this to be an issue that should be addressed by maintainers of mason.nvim.
Why do you think this is an issue with mason.nvim?
I am getting errors with the omnisharp client quitting on start up. Upon looking through the lsp.log it appears that it does not like the space in my user name.
So, I'd guess the most likely source of the issue is mason.nvim because the problem seems to stem from an issue with handling spaces in the omnisharp.cmd scripts (one is in the bin directory, the other is in the packages directory)
Neovim version (>= 0.7)
NVIM v0.8.0-dev-1120-ga0e6e767a
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Operating system/version
Windows 10
I've manually reviewed logs to find potential errors
I've recently downloaded the latest plugin version of mason.nvim
Affected packages
omnisharp (not the mono package)
Problem description
The omnisharp client quits on startup. Again here are the logs from lsp.log. There are no relevant logs from mason.log.
Using LspInstaller for omnisharp worked great. Also, for reference I'm getting no issues with running sumneko lua lsp.
Looking at differences in the files in the mason bin directory:
mason\bin\omnisharp.cmd
calls another cmd scriptlua-language-server.cmd
calls an executableSteps to reproduce
Actual behavior
LSP quits on startup.
Expected behavior
I expected omnisharp to start working once I opened my csharp file program.cs
Healthcheck
Screenshots or recordings
I don't have any relevant items for this.
I would like to say great job on this project. This is more than a plugin, this is like a candy store!
It is quite impressive what you've created! I am in awe!
The text was updated successfully, but these errors were encountered: