OmniSharp / omnisharp-vim

Vim omnicompletion (intellisense) and more for C#
http://www.omnisharp.net
MIT License
1.72k stars 168 forks source link

OmniSharpInstall fails on Windows with no error. #814

Closed rcmosher closed 1 year ago

rcmosher commented 2 years ago

I run :OmniSharpInstall on Windows and I get the following error message and log file. This is from gVim VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Jun 28 2022 12:46:00)

Error:

Failed to install the OmniSharp-Roslyn server The full error log can be found in the file: C:\Users\rob\vimfiles\plugged\omnisharp-vim\log\install.log

Log File:

> powershell -ExecutionPolicy Bypass -File "C:\Users\rob\vimfiles\plugged\omnisharp-vim\installer\omnisharp-manager.ps1"  -6 -l "C:\Users\rob\AppData\Local\omnisharp-vim\omnisharp-roslyn" 
================================================================================

No actual error seems to be logged.

If I try running that powershell command in the log file directly in powershell it is running without issue.

nickspoons commented 2 years ago

If the command works in powershell, but not from vim (with no error) then I expect it's a permission issue of some kind.

nickspoons commented 2 years ago

@axvr any ideas? I don't know anything about powershell and windows permissions.

rene-descartes2021 commented 2 years ago

Printing the error code might be illuminating.

Dunno if you'd read %errorlevel% or $LASTEXITCODE, looks like $? won't do [1].

axvr commented 2 years ago

Never seen this before... A couple of questions that may help debugging it:

  1. How did you install Vim and how are you starting it?
  2. What does running :set shell? give in Vim?
rcmosher commented 2 years ago
  1. I installed it with a downloaded executable, gvim90.exe.
  2. shell=C:\Windows\system32\cmd.exe. I had played around with changing shell but I commented it all out a while ago.
axvr commented 2 years ago

A couple more things you could try that might reveal the issue:

  1. Open "Command Prompt" and run the command.
    powershell -ExecutionPolicy Bypass -File "C:\Users\rob\vimfiles\plugged\omnisharp-vim\installer\omnisharp-manager.ps1"  -6 -l "C:\Users\rob\AppData\Local\omnisharp-vim\omnisharp-roslyn"
  2. Run this from inside Gvim:
    :! powershell -ExecutionPolicy Bypass -File "C:\Users\rob\vimfiles\plugged\omnisharp-vim\installer\omnisharp-manager.ps1"  -6 -l "C:\Users\rob\AppData\Local\omnisharp-vim\omnisharp-roslyn"
rcmosher commented 1 year ago

Both ran without issue. Apologies on taking so long to run them. I also tried running :OmniSharpInstall from Gvim again and it's not indicating any errors. So it seems to be resolved. Not sure what would have changed. I haven't made changes to my git config in that time. But it could be updates or policy changes since it's a work machine.