Closed frarees closed 4 years ago
I don't know what this is sorry, it might be an OmniSharp-roslyn issue, perhaps try to ask there?
I'd recommend getting a raw OmniSharp-roslyn log, by starting the server directly from the command line:
cd /Users/frarees/Desktop/test/
/Users/frarees/.cache/omnisharp-vim/omnisharp-roslyn/run -l debug
Cool, will try sharing there. More insights from the OmniSharp-roslyn log.
Can't find custom attr constructor image: /Users/frarees/Desktop/test/Library/ScriptAssemblies/Unity.Properties.dll mtoken: 0x0a000005 due to: Cannot resolve dependency to assembly because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.
Can't find custom attr constructor image: /Users/frarees/Desktop/test/Library/ScriptAssemblies/UnityEditor.UI.dll mtoken: 0x0a00000b due to: Cannot resolve dependency to assembly because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.
Can't find custom attr constructor image: /Users/frarees/Desktop/test/Library/ScriptAssemblies/Unity.Properties.dll mtoken: 0x0a000005 due to: Cannot resolve dependency to assembly because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.
Can't find custom attr constructor image: /Users/frarees/Desktop/test/Library/ScriptAssemblies/UnityEditor.UI.dll mtoken: 0x0a00000b due to: Cannot resolve dependency to assembly because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.
Also:
{"Event":"log","Body":{"LogLevel":"ERROR","Name":"OmniSharp.MSBuild.ProjectLoadListener","Message":"Unexpected exception got thrown from project load listener: System.NullReferenceException: Object reference not set to an instance of an object\n at OmniSharp.MSBuild.ProjectLoadListener.GetSdkVersion (OmniSharp.MSBuild.Notification.ProjectLoadedEventArgs args) [0x0000b] in <7e6cb753aca94549b693616e0e7d1016>:0 \n at OmniSharp.MSBuild.ProjectLoadListener.ProjectLoaded (OmniSharp.MSBuild.Notification.ProjectLoadedEventArgs args) [0x0001a] in <7e6cb753aca94549b693616e0e7d1016>:0 "},"Seq":582,"Type":"event"}
Yeah that NullReferenceException
is certainly happening on the OmniSharp-roslyn side
I've seen that the NullReferenceException is happening on other projects that I can open successfully, so might not be related.
Aside, since I get more than 3 errors (4 Can't find custom attr constructor image
errors), it warns me that I might be using the HTTP version.
You appear to be running an HTTP server in stdio mode - upgrade to the stdio server with :OmniSharpInstall, or to continue in HTTP mode add the following to your .vimrc and restart Vim: let g:OmniSharp_server_stdio = 0
channel 0 closed: '<feff>'
Maybe there's a way to gracefully ignore these?
The project actually loads, so I'm wondering if omnisharp-vim is stopping cause it's getting these unknown errors, but could actually continue to function.
...
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.MSBuild.ProjectManager","Message":"Successfully loaded project file '/Users/frarees/Desktop/test/Assembly-CSharp.csproj'."},"Seq":50,"Type":"event"}
{"Event":"MsBuildProjectDiagnostics","Body":{"FileName":"/Users/frarees/Desktop/test/Assembly-CSharp.csproj","Warnings":[],"Errors":[]},"Seq":51,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.MSBuild.ProjectManager","Message":"Adding project '/Users/frarees/Desktop/test/Assembly-CSharp.csproj'"},"Seq":52,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.MSBuild.ProjectManager","Message":"Update project: Assembly-CSharp"},"Seq":53,"Type":"event"}
...
Maybe there's a way to gracefully ignore these?
The project actually loads, so I'm wondering if omnisharp-vim is stopping cause it's getting these unknown errors, but could actually continue to function.
Hmm, you may be right about that. Do you want to test this out? You could try changing the 3
here to e.g. 100
: https://github.com/OmniSharp/omnisharp-vim/blob/master/autoload/OmniSharp/stdio.vim#L15
Indeed, it worked!
Well, just increasing that limit is a pretty simple fix. I don't know what a sensible number of json errors to receive is? I do still want to have this test, as it is a reasonably reliable way to detect that the user is using the HTTP version of the server.
Or perhaps instead of just counting invalid json messages from the server, we could count both valid and invalid, and just check that there are more valid than invalid messages. That seems a bit more robust.
Or perhaps instead of just counting invalid json messages from the server, we could count both valid and invalid, and just check that there are more valid than invalid messages.
Sounds like a good idea. I guess a message being valid is a greater indicator than a message being invalid. Is it easy to have successful messages when missmatching stdio/http? If it's not easy, what about waiting for n messages and check how many of them are successful? e.g. wait until you get 6 messages, check that 3 of them are valid.
@frarees could you give the latest version a try?
All good 👍
Log:
It happens just on one of my projects, and I cannot seem to figure out where this comes from. Any clue? Thanks!