Longstanding Intellisense bug
From @Figbash on April 29, 2016 17:30
Will somebody please give this bug some attention? There are many of us that haven't been able to move from version 0.10.3 in December. I would very much like to run an up to date version of VSCode.
https://github.com/OmniSharp/omnisharp-roslyn/issues/371 https://github.com/OmniSharp/omnisharp-vscode/issues/6
Copied from original issue: Microsoft/vscode#5993
This bug is still in the latest release. Any updates?
Sorry to chase @jrieken, but do you guys have any kind of ETA on this? Is there anything we can do to help diagnose the issue? Cheers
I am also experiencing painfully slow, if non existent intellisense support on VS Code running in a Ubuntu VM.
The project having issues is just a blank .NET Console application - typing "args." does nothing, and hitting ctrl+space pops open the "Loading..." and sometimes it loads.
Attached is my VSCode output.
@DustinCampbell will know
Honestly I have given up on this being looked at, I even emailed dustin directly offering to help figure it out and got no response. There doesn't seem to be any interest in making C# functional again ever since this was split into a separate plugin :( It's very frustrating, as it worked so perfectly before that.
@VinditCo My gut feeling is that it has something to do with either precompiled DLL plugins or just very large projects, as it doesn't seem to occur on any of my simpler projects. I have been trying to narrow it down so at least we could pull offending files out of the solution to allow us to work, but I have not had any luck. I will let you know if I ever find anything that helps.
@Figbash -- don't give up hope! I actually never received your email.
The OmniSharp log you provided indicated that you're using a project.json-based project. Is this a project targeting ASP .NET RC1 (e.g. DNX), or a newer .NET CLI project?
@DustinCampbell thanks for getting back to us! I'm running Unity 5.3.4p5 - how would I check if it's using a json-based project?
@DustinCampbell I apologize for venting, I sent the email a couple weeks ago. I am running Unity as well and believe the problem generally affects Unity projects (I'm thinking misnor has a different issue). Unity targets Mono that is equivalent to .NET 2.
The startup log in version .10.3 of VSCode always shows: [INFORMATION:OmniSharp.Dnx.DnxPaths] Using runtime '/Users/raymondbritton/.dnx/runtimes/dnx-mono.1.0.0-beta4'. [INFORMATION:OmniSharp.Dnx.DnxProjectSystem] Scanning 'AJMobile_Trunk' for DNX projects [INFORMATION:OmniSharp.Dnx.DnxProjectSystem] No project.json based projects found
The solution file/csproj files seem to be an XML format for visual studio 12 rather than JSON. I have uploaded the solution from my broken project: Assembly.zip The solution files are generated by Unity.
Sorry, I was looking at the OmniSharp log that @misnor posted -- that one is project.json-based. I'll take a look at the project you provided.
I'm not entirely sure if the output log is even related, I often get the same issue without the log appearing. For instance I have just used command click on to jump around some files in VSCode 1.1.0-insider, and did not receive any logs in output. The first few jumps were quick, but the third one brings up the "Loading..." tooltip for around 6 seconds before working again, and there was nothing in the output besides: [INFORMATION:OmniSharp.Middleware.LoggingMiddleware] /v2/getcodeactions: 200 627ms
I did get this in the output a little before the slowdown:
[INFORMATION:OmniSharp.ScriptCs.ScriptCsProjectSystem] Detecting CSX files in '/Users/raymondbritton/Desktop/AJMobile_Trunk'.
[INFORMATION:OmniSharp.ScriptCs.ScriptCsProjectSystem] Could not find any CSX files
[INFORMATION:OmniSharp.Startup] Solution has finished loading
[ERROR:Microsoft.AspNet.Diagnostics.ErrorHandlerMiddleware] An unhandled exception has occurred: Diagnostic must have span '[1505..1505)'
Parameter name: diagnostics
System.ArgumentException: Diagnostic must have span '[1505..1505)'
Parameter name: diagnostics
at Microsoft.CodeAnalysis.CodeFixes.CodeFixContext.VerifyDiagnosticsArgument (ImmutableArray1 diagnostics, TextSpan span) [0x00000] in <filename unknown>:0 at Microsoft.CodeAnalysis.CodeFixes.CodeFixContext..ctor (Microsoft.CodeAnalysis.Document document, TextSpan span, ImmutableArray1 diagnostics, System.Action2 registerCodeFix, Boolean verifyArguments, CancellationToken cancellationToken) [0x00000] in <filename unknown>:0 at Microsoft.CodeAnalysis.CodeFixes.CodeFixContext..ctor (Microsoft.CodeAnalysis.Document document, TextSpan span, ImmutableArray1 diagnostics, System.Action2 registerCodeFix, CancellationToken cancellationToken) [0x00000] in <filename unknown>:0 at OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.CodeActionHelper+<GetCodeFixContext>d__2.MoveNext () [0x00000] in <filename unknown>:0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00000] in <filename unknown>:0 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00000] in <filename unknown>:0 at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00000] in <filename unknown>:0 at System.Runtime.CompilerServices.TaskAwaiter1[System.Nullable1[Microsoft.CodeAnalysis.CodeFixes.CodeFixContext]].GetResult () [0x00000] in <filename unknown>:0 at OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.CodeActionHelper+<GetActions>d__0.MoveNext () [0x00000] in <filename unknown>:0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00000] in <filename unknown>:0 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00000] in <filename unknown>:0 at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00000] in <filename unknown>:0 at System.Runtime.CompilerServices.TaskAwaiter1[System.Collections.Generic.IEnumerable1[Microsoft.CodeAnalysis.CodeActions.CodeAction]].GetResult () [0x00000] in <filename unknown>:0 at OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.GetCodeActionsService+<Handle>d__4.MoveNext () [0x00000] in <filename unknown>:0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00000] in <filename unknown>:0 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00000] in <filename unknown>:0 at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00000] in <filename unknown>:0 at System.Runtime.CompilerServices.TaskAwaiter1[OmniSharp.Models.V2.GetCodeActionsResponse].GetResult () [0x00000] in 2+<HandleSingleRequest>d__18[OmniSharp.Models.V2.GetCodeActionsRequest,OmniSharp.Models.V2.GetCodeActionsResponse].MoveNext () [0x00000] in <filename unknown>:0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00000] in <filename unknown>:0 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00000] in <filename unknown>:0 at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00000] in <filename unknown>:0 at System.Runtime.CompilerServices.TaskAwaiter1[System.Object].GetResult () [0x00000] in 2+<Process>d__16[OmniSharp.Models.V2.GetCodeActionsRequest,OmniSharp.Models.V2.GetCodeActionsResponse].MoveNext () [0x00000] in <filename unknown>:0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00000] in <filename unknown>:0 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00000] in <filename unknown>:0 at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00000] in <filename unknown>:0 at System.Runtime.CompilerServices.TaskAwaiter1[System.Object].GetResult () [0x00000] in
Hmmm... Could you try this? Grab the latest omnisharp.linux-mono.tar.gz from https://github.com/OmniSharp/omnisharp-roslyn/releases/tag/v1.9-alpha13 and untar it to a directory. Then, set the "csharp.omnisharp" preference in VS Code to point to "/directory/you/just/created/OmniSharp.exe". Restart VS Code and see if this addresses the issue.
I am running OSX BTW. Attempting to do what you said shows: /Users/raymondbritton/Desktop/omnisharp-linux-mono/OmniSharp.exe: cannot execute binary file
:grumble: ok. Give me a day or two to get set up to try and repro. If you have anymore you could share to reproduce the problem that'd be helpful.
Note that I've never actually installed Unity before so this is new territory for me :blush:
Ok, thank you. I cannot share the project unfortunately as it is my companies and is enormous, perhaps @VinditCo has something shareable? If it would help figure it out I would be willing to screen share.
I have gotten the alpha to start using a bash script with mono OmniSharp.exe, but it gives me:
[INFO] Starting OmniSharp at '/Users/raymondbritton/Desktop/AJMobile_Trunk/AJMobile_Trunk.sln'...
[INFO] Started OmniSharp from '/Users/raymondbritton/Desktop/omnisharp-linux-mono/omnisharp' with process id 17707...
OmniSharp:
info: OmniSharp.Startup[0]
Omnisharp server running on port '2000' at location '/Users/raymondbritton/Desktop/AJMobile_Trunk' on host -1.
info: OmniSharp.DotNet.DotNetProjectSystem[0]
Initializing in /Users/raymondbritton/Desktop/AJMobile_Trunk
info: OmniSharp.DotNet.DotNetProjectSystem[0]
Auto package restore: True
fail: OmniSharp.Startup[0]
The project system 'DotNetProjectSystem' threw exception during initialization.
Failed to initialize Microsoft.DotNet.ProjectModel.WorkspaceContext at /Users/raymondbritton/Desktop/AJMobile_Trunk.
at OmniSharp.DotNet.DotNetProjectSystem.Initalize (IConfiguration configuration) [0x00000] in
If you have any ideas on that exception I can try again.
OK. I'm also adding @troydai, who might have some ideas as well. It seems suspicious that the DotNetProjectSystem is throwing. Do you have project.json files in your project at all?
I can walk you through Unity: Install Unity Free, tell it to include the demo project Open the demo project in Unity Grab https://github.com/dotBunny/VSCode and put it under the demo project dir /Assets/Editor In Unity open Assets menu, Open C# Project In Code This will generate the solution and open it in Code. Then just try using it a little bit and the issue will either be very apparent or the demo project won't have the issue, hopefully the former :)
I don't see any project.json files in the project.
I'm also on OSX and don't have any project.json files. Sadly I also cant post a copy of the project. Are there any logs you'd like me to post?
I am trying to reproduce this on a smaller project but I'm not having any luck. It definitely seems to have something to do with project size or complexity...
Good to know. I'm still looking at this. Thanks for the update!