Closed redjoker011 closed 2 years ago
There's a lot going on here!
First of all, I'd recommend paring down your omnisharp config. The g:OmniSharp_proc_debug
isn't generally very useful and actually stops some proper logging from happening, so remove that.
Now, what kind of project are you working on? If it's a unity project it will be .NET Framework, otherwise is it .NET Framework or dotnet core? Actually either way it would be worth trying the new net6
version of the server, but especially if you're running dotnet core projects. (For some background, OmniSharp-roslyn has been a .NET Framework project requiring mono to run on mac and linux until quite recently, but there is now a dotnet native build available which seems to be superior in all situations I've tried - but I haven't tried a Unity project so it's possible the old .NET Framework+mono still works better for those).
To install the net6
version, remove g:OmniSharp_server_use_mono
from your init.vim and add let g:OmniSharp_server_use_net6 = 1
instead. Then restart vim and :OmniSharpInstall
to download the correct version. Then open your project and report with the log.
Here Omnisharp is using Omnisharp.exe Is this correct ?
Yes, this was correct in this situation. The executable was being launched by mono which is as expected with this config.
Hi @nickspoons , thanks for your response. Well basically I've just started exploring c# and .Net so I have a Visual Studio installed in my end. Mostly following tutorials from Microsoft. I've tried you're suggestion to use net6 as language server
Change the config and reinstall omnisharp:
Restart vim and omnisharp pop up installation appear:
Encountered a weird error upon opening a .cs file which link was redirected to installation
page
Do the installation again even though I already have dotnet installed via visual studio and still encountered the same error
:OmniSharpOpenLog command displays the ff. info which states that the server successfully started but autocompletion and suggestions still not working
Omnisharp commands still not working though
Running the executable where omnisharp is installed give more details about the issue which seems like a build compatibility. Does this mean OmniSharpInstall fails to install correct build for MacM1 ?
Does this mean OmniSharpInstall fails to install correct build for MacM1 ?
I don't know exactly. There's something fishy but I can't tell if it's OmniSharp-vim's installer, OmniSharp-roslyn, or your environment. I don't have an M1 so can't help much with debugging, but I believe omnisharp does work on them. Try downloading an osx-arm64-net6 build from https://github.com/OmniSharp/omnisharp-roslyn/releases and try running the OmniSharp
exe.
Do the installation again even though I already have dotnet installed via visual studio
Just to clarify, :OmniSharpInstall
is not installing dotnet
, in fact it's not really "installing" anything at all, it just downloads an OmniSharp-roslyn release and extracts it to ~/.cache/omnisharp-vim/omnisharp-roslyn
Already resolved the issue 🎉 . In my case I have 2 binaries installed in/usr/local/share/dotnet
and /usr/local/share/dotnet/x64
. Based on /etc/dotnet/install_location
the default install location was in /usr/local/share/dotnet/x64
which is quite confusing so I uninstall dotnet using the ff. command
sudo rm -r /usr/local/share/dotnet && sudo rm -r /etc/dotnet
Reinstall latest dotnet sdk for Arm64
and point dotnet root to where the sdk were installed which is in /usr/local/share/dotnet
.
Add this to your shell configuration .zsh,.bash,.config.fish
export DOTNET_ROOT=/usr/local/share/dotnet
Thanks for your assistance @nickspoons. Please feel free to close this issue whenever needed
Glad to hear you're up and running now!
I had the similar error
I installed dotnet through homebrew
➜ which dotnet
/opt/homebrew/bin/dotnet
vimrc:
...
let g:OmniSharp_server_display_loading = 1
let g:OmniSharp_server_use_net6 = 1
let g:OmniSharp_loglevel = 'debug'
I hadd to add
export DOTNET_ROOT="$HOMEBREW_PREFIX/opt/dotnet/libexec"
to my .zshrc to get it to work
then it all started working
Hello, I'm installing omnisharp-vim in my workstation but I the auto completion is not working as well as other omnisharp commands aside form
OmniSharpInstall and OmniSharpOpenLog
Platform: MacOS M1 Neovim Version: v0.8.0-dev-nightly-246-g977790746
Vim config
The installation was successful, but the log is empty as well as the commands are not available
Installation
Log
Debug Mode
Here Omnisharp is using Omnisharp.exe Is this correct ?