Closed AndrGutierrez closed 3 years ago
In your other issue I referred you to issue #707, which these issues are duplicates of. Did you try telling OmniSharp-vim to use the mono version of OmniSharp-roslyn, as described in #707?
yes, I tried it, it didn't work.
As far as I know that's a mac issue, anyways I tried it but nothing happened
No, it's not a Mac issue. OP in issue #707 is using manjaro.
Unity uses .NET Framework, which means you need mono to run it on non-Windows systems.
Please follow the instructions in this comment and then post your log (:OmniSharpOpenLog
)
I already did, but then I commented the mono line, restarted vim, uncommented the same line and opened the project, it worked PERFECTLY... then I restarted vim to check that it would work a second time and it didn't...
at least I don't have the load files error anymore
here is my log, it is too long, it doesn't have any fail messages
That link 404s
404.
Is this file in a private repo?
I already did, but then I commented the mono line, restarted vim, uncommented the same line and opened the project, it worked PERFECTLY... then I restarted vim to check that it would work a second time and it didn't...
I don't know how to interpret this. Was it the same project both times? Was there a .csproj and .sln both times (my understanding is that unity creates these on the fly and they are not always available)? The log will tell you this.
let g:OmniSharp_server_use_mono = 1
to .vimrc:OmniSharpInstall
:echo g:OmniSharp_server_use_mono
outputs 1
yeah, the repository was private, I am stupid, it is public now
OK, this looks like the problem:
[dbug]: OmniSharp.CompositionHostBuilder
.NET SDK requires MSBuild instances version 16.8.0 or higher
[dbug]: OmniSharp.MSBuild.Discovery.Providers.MonoInstanceProvider
Mono MSBuild could not be used because '/usr/lib/mono/msbuild/Current/bin/Microsoft.Build.dll' does not exist.
[warn]: OmniSharp.MSBuild.Discovery.Providers.MonoInstanceProvider
It looks like you have Mono 6.4.0 or greater installed but MSBuild could not be found.
Try installing MSBuild into Mono (e.g. 'sudo apt-get install msbuild') to enable better MSBuild support, or upgrade to latest Mono: https://www.mono-project.com/download/stable/.
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 1 MSBuild instance(s)
1: StandAlone 17.0.0 - "/home/andres/.cache/omnisharp-vim/omnisharp-roslyn/.msbuild/Current/Bin"
[dbug]: OmniSharp.CompositionHostBuilder
MSBuild instance StandAlone 17.0.0 scored at 1
Here's what mine looks like:
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 2 MSBuild instance(s)
1: Mono 16.10.1 - "/usr/lib/mono/msbuild/Current/bin"
2: StandAlone 17.0.0 - "/home/nickspoon/.cache/omnisharp-vim/omnisharp-roslyn-mono-1.37.13/.msbuild/Current/Bin"
[dbug]: OmniSharp.CompositionHostBuilder
MSBuild instance Mono 16.10.1 scored at 2
I'm using the mono-msbuild
package on arch, give that a go.
it worked! but just for autocompletion for some reason the errors like:
The type or namespace name 'UnityEngine' could not be found
keep appearing
It's not loading those Unity libraries for whatever reason, there are probably details in the log
I already opened an issue of autocompletion and linting not working in unity projects and I realized that it probably is because of this error
Failed to load project:
it says that about all the .csproj files. Thank you for your time