Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IntelliSense lost when developing with C# for Unity #1535

Closed
cluo85 opened this issue Dec 21, 2015 · 11 comments
Closed

IntelliSense lost when developing with C# for Unity #1535

cluo85 opened this issue Dec 21, 2015 · 11 comments
Assignees
Milestone

Comments

@cluo85
Copy link

cluo85 commented Dec 21, 2015

The IntelliSense worked fine at the beginning when I started the VS code. Sometimes after I used it for a little while, The IntelliSense would lost.
I have two ways to fix this: One is to type the command "Restart Omnisharp" and I will get IntelliSense again. Most of time this way will work, But sometimes it won't. Another way is to close vs code and reopen it. This way worked every time.
I guess the IntelliSense lost usually happened when I write comments in Chinese. But sometimes it didn't happen. I'm not sure.
I'm using C# language. Windows 10. Newest version of Unity and VS code and dotbunny unity tool.

@bpasero bpasero added bug Issue identified by VS Code Team member as probable bug c# labels Dec 21, 2015
@bpasero bpasero added this to the Backlog milestone Dec 21, 2015
@VinditCo
Copy link

I think I have the same thing.
Omnisharp keeps restarting for me whilst I'm typing (every time I add a new line) - it's very annoying as the lines jump up and down as references are found. Makes VSCode pretty much unusable.

Any suggestions on how to debug this?

@BazIdle
Copy link

BazIdle commented Dec 22, 2015

Can confirm the same issue with VSCode + C# + Unity. Omnisharp keeps restarting.

This is what I managed to get from embedded developer tools:
https://gist.github.com/BazIdle/df424cb5cd2b065a2618

("potentially unhandled rejected promise" and "Error: Canceled: Error: Canceled" are looping on every Omnisharp restart)

@VinditCo
Copy link

@BazIdle good find. Which Unity version are you on?

Figured a downgrade might fix it. I've tried to find previous versions of vscode for OSX with no joy. Any ideas where to find one?

(The builds on the Wiki are auto-trashed by OSX claiming they're corrupted - so I have to look elsewhere...)

@BazIdle
Copy link

BazIdle commented Dec 22, 2015

@VinditCo 5.2.3f1

Are you, perchance, getting the same errors in Dev. Tools?

@VinditCo
Copy link

Looks like it ! Like 91 of Workbench causing an issue

Error: Canceled: Error: Canceled
    at /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/jrieken.vscode-omnisharp/out/omnisharpServer.js:235:31
    at e.invoke (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/pluginHostProcess.js:7:20571)
    at e.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/pluginHostProcess.js:7:21929)
    at e.cancel (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/pluginHostProcess.js:7:22756)
    at e.cancel (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/pluginHostProcess.js:7:23366)
    at DiagnosticsProvider._validateDocument (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/jrieken.vscode-omnisharp/out/features/diagnosticsProvider.js:129:44)
    at DiagnosticsProvider._onDocumentAddOrChange (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/jrieken.vscode-omnisharp/out/features/diagnosticsProvider.js:101:18)
    at DiagnosticsProvider.<anonymous> (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/jrieken.vscode-omnisharp/out/features/diagnosticsProvider.js:86:93)
    at e.invoke (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/pluginHostProcess.js:7:20571)
    at e.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/pluginHostProcess.js:7:21929)

@VinditCo
Copy link

After this and the disastrous Unity update I'm going to have a new rule: Don't download any software updates pushed during December.

All devs are on the egg-nog...

@jrieken
Copy link
Member

jrieken commented Dec 22, 2015

That stack trace is unhappy but won't be the cause of this issue. Can check your omnisharp log (Cmd+L, L) and paste it here?

@cluo85
Copy link
Author

cluo85 commented Dec 22, 2015

Here is my omnisharp log. I don't know why there are some strange characters. I'm not using any Chinese characters in the directory names and project names. There are only Chinese characters in comments.

[INFO] Starting OmniSharp at 'd:\Work\AlienTown\AlienTown.sln'...
[INFO] Started OmniSharp from 'c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\jrieken.vscode-omnisharp\bin\omnisharp.cmd' with process id 15484...
[INFORMATION:OmniSharp.Startup] Omnisharp server running using stdio at location 'd:\Work\AlienTown' on host 4100.
[INFORMATION:OmniSharp.Dnx.DnxPaths] Using runtime 'C:\Users\Luochong.dnx\runtimes\dnx-clr-win-x86.1.0.0-beta8'.
[INFORMATION:OmniSharp.Dnx.DnxProjectSystem] Scanning 'd:\Work\AlienTown' for DNX projects
[INFORMATION:OmniSharp.Dnx.DnxProjectSystem] No project.json based projects found
[INFORMATION:OmniSharp.MSBuild.MSBuildProjectSystem] Detecting projects in 'd:\Work\AlienTown\AlienTown.sln'.
[INFORMATION:OmniSharp.MSBuild.MSBuildProjectSystem] Loading project from 'd:\Work\AlienTown\Assembly-CSharp.csproj'.
[INFORMATION:OmniSharp.MSBuild.MSBuildProjectSystem] Using toolset 2.0 for d:\Work\AlienTown\Assembly-CSharp.csproj
[INFORMATION:OmniSharp.MSBuild.MSBuildProjectSystem] Loading project from 'd:\Work\AlienTown\Assembly-CSharp-Editor-firstpass.csproj'.
[INFORMATION:OmniSharp.MSBuild.MSBuildProjectSystem] Using toolset 2.0 for d:\Work\AlienTown\Assembly-CSharp-Editor-firstpass.csproj
[INFORMATION:OmniSharp.ScriptCs.ScriptCsProjectSystem] Detecting CSX files in 'd:\Work\AlienTown'.
[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: ָ���IJ����ѳ�����Чֵ�ķ�Χ��
������: index
System.ArgumentOutOfRangeException: ָ���IJ����ѳ�����Чֵ�ķ�Χ��
������: index
�� Microsoft.CodeAnalysis.Text.SourceText.LineInfo.get_Item(Int32 index)
�� Microsoft.CodeAnalysis.Text.TextLineCollection.GetPosition(LinePosition position)
�� OmniSharp.Roslyn.CSharp.Services.Intellisense.IntellisenseService.d__3.MoveNext()
--- �����쳣����һλ���ж�ջ���ٵ�ĩβ ---
�� System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
�� System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
�� OmniSharp.Middleware.Endpoint.EndpointHandler2.<HandleSingleRequest>d__18.MoveNext() --- �����쳣����һλ���ж�ջ���ٵ�ĩβ --- �� System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) �� System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) �� OmniSharp.Middleware.Endpoint.EndpointHandler2.d__16.MoveNext()
--- �����쳣����һλ���ж�ջ���ٵ�ĩβ ---
�� System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
�� System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
�� OmniSharp.Middleware.EndpointMiddleware.d__7.MoveNext()
--- �����쳣����һλ���ж�ջ���ٵ�ĩβ ---
�� System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
�� System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
�� Microsoft.AspNet.Diagnostics.ErrorHandlerMiddleware.d__4.MoveNext()
[INFORMATION:OmniSharp.Middleware.LoggingMiddleware] /autocomplete: 500 32ms
[ERROR:Microsoft.AspNet.Diagnostics.ErrorHandlerMiddleware] An unhandled exception has occurred: ָ���IJ����ѳ�����Чֵ�ķ�Χ��
������: index
System.ArgumentOutOfRangeException: ָ���IJ����ѳ�����Чֵ�ķ�Χ��
������: index
�� Microsoft.CodeAnalysis.Text.SourceText.LineInfo.get_Item(Int32 index)
�� Microsoft.CodeAnalysis.Text.TextLineCollection.GetPosition(LinePosition position)
�� OmniSharp.Roslyn.CSharp.Services.Intellisense.IntellisenseService.d__3.MoveNext()
--- �����쳣����һλ���ж�ջ���ٵ�ĩβ ---
�� System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
�� System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
�� OmniSharp.Middleware.Endpoint.EndpointHandler2.<HandleSingleRequest>d__18.MoveNext() --- �����쳣����һλ���ж�ջ���ٵ�ĩβ --- �� System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) �� System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) �� OmniSharp.Middleware.Endpoint.EndpointHandler2.d__16.MoveNext()
--- �����쳣����һλ���ж�ջ���ٵ�ĩβ ---
�� System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
�� System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
�� OmniSharp.Middleware.EndpointMiddleware.d__7.MoveNext()
--- �����쳣����һλ���ж�ջ���ٵ�ĩβ ---
�� System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
�� System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
�� Microsoft.AspNet.Diagnostics.ErrorHandlerMiddleware.d__4.MoveNext()
[INFORMATION:OmniSharp.Middleware.LoggingMiddleware] /autocomplete: 500 1ms
[ERROR:Microsoft.AspNet.Diagnostics.ErrorHandlerMiddleware] An unhandled exception has occurred: ָ���IJ����ѳ�����Чֵ�ķ�Χ��
������: index
System.ArgumentOutOfRangeException: ָ���IJ����ѳ�����Чֵ�ķ�Χ��
������: index
�� Microsoft.CodeAnalysis.Text.SourceText.LineInfo.get_Item(Int32 index)
�� Microsoft.CodeAnalysis.Text.TextLineCollection.GetPosition(LinePosition position)
�� OmniSharp.Roslyn.CSharp.Services.Intellisense.IntellisenseService.d__3.MoveNext()
--- �����쳣����һλ���ж�ջ���ٵ�ĩβ ---
�� System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
�� System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
�� OmniSharp.Middleware.Endpoint.EndpointHandler2.<HandleSingleRequest>d__18.MoveNext() --- �����쳣����һλ���ж�ջ���ٵ�ĩβ --- �� System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) �� System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) �� OmniSharp.Middleware.Endpoint.EndpointHandler2.d__16.MoveNext()
--- �����쳣����һλ���ж�ջ���ٵ�ĩβ ---
�� System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
�� System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
�� OmniSharp.Middleware.EndpointMiddleware.d__7.MoveNext()
--- �����쳣����һλ���ж�ջ���ٵ�ĩβ ---
�� System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
�� System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
�� Microsoft.AspNet.Diagnostics.ErrorHandlerMiddleware.d__4.MoveNext()
[INFORMATION:OmniSharp.Middleware.LoggingMiddleware] /autocomplete: 500 1ms
[ERROR:Microsoft.AspNet.Diagnostics.ErrorHandlerMiddleware] An unhandled exception has occurred: ָ���IJ����ѳ�����Чֵ�ķ�Χ��
������: index
System.ArgumentOutOfRangeException: ָ���IJ����ѳ�����Чֵ�ķ�Χ��
������: index
�� Microsoft.CodeAnalysis.Text.SourceText.LineInfo.get_Item(Int32 index)
�� Microsoft.CodeAnalysis.Text.TextLineCollection.GetPosition(LinePosition position)
�� OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService.d__2.MoveNext()
--- �����쳣����һλ���ж�ջ���ٵ�ĩβ ---
�� System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
�� System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
�� OmniSharp.Middleware.Endpoint.EndpointHandler2.<HandleSingleRequest>d__18.MoveNext() --- �����쳣����һλ���ж�ջ���ٵ�ĩβ --- �� System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) �� System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) �� OmniSharp.Middleware.Endpoint.EndpointHandler2.d__16.MoveNext()
--- �����쳣����һλ���ж�ջ���ٵ�ĩβ ---
�� System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
�� System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
�� OmniSharp.Middleware.EndpointMiddleware.d__7.MoveNext()
--- �����쳣����һλ���ж�ջ���ٵ�ĩβ ---
�� System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
�� System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
�� Microsoft.AspNet.Diagnostics.ErrorHandlerMiddleware.d__4.MoveNext()
[INFORMATION:OmniSharp.Middleware.LoggingMiddleware] /findusages: 500 28ms
[ERROR:Microsoft.AspNet.Diagnostics.ErrorHandlerMiddleware] An unhandled exception has occurred: ָ���IJ����ѳ�����Чֵ�ķ�Χ��
������: index
System.ArgumentOutOfRangeException: ָ���IJ����ѳ�����Чֵ�ķ�Χ��
������: index
�� Microsoft.CodeAnalysis.Text.SourceText.LineInfo.get_Item(Int32 index)
�� Microsoft.CodeAnalysis.Text.TextLineCollection.GetPosition(LinePosition position)
�� OmniSharp.Roslyn.CSharp.Services.Intellisense.IntellisenseService.d__3.MoveNext()
--- �����쳣����һλ���ж�ջ���ٵ�ĩβ ---
�� System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
�� System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
�� OmniSharp.Middleware.Endpoint.EndpointHandler2.<HandleSingleRequest>d__18.MoveNext() --- �����쳣����һλ���ж�ջ���ٵ�ĩβ --- �� System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) �� System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) �� OmniSharp.Middleware.Endpoint.EndpointHandler2.d__16.MoveNext()
--- �����쳣����һλ���ж�ջ���ٵ�ĩβ ---
�� System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
�� System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
�� OmniSharp.Middleware.EndpointMiddleware.d__7.MoveNext()
--- �����쳣����һλ���ж�ջ���ٵ�ĩβ ---
�� System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
�� System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
�� Microsoft.AspNet.Diagnostics.ErrorHandlerMiddleware.d__4.MoveNext()
[INFORMATION:OmniSharp.Middleware.LoggingMiddleware] /autocomplete: 500 1ms
[ERROR:Microsoft.AspNet.Diagnostics.ErrorHandlerMiddleware] An unhandled exception has occurred: ָ���IJ����ѳ�����Чֵ�ķ�Χ��

@jrieken jrieken removed bug Issue identified by VS Code Team member as probable bug c# labels Dec 22, 2015
@BazIdle
Copy link

BazIdle commented Dec 22, 2015

@jrieken here you go: https://gist.github.com/BazIdle/c1aae81f1fc6d6e0122d
(I copied only the error)

@jrieken
Copy link
Member

jrieken commented Dec 22, 2015

This seems to be an issue with omnisharp. Moving there and see what we can do

@jrieken
Copy link
Member

jrieken commented Dec 22, 2015

This issue was moved to OmniSharp/omnisharp-roslyn#371

@jrieken jrieken closed this as completed Dec 22, 2015
@BazIdle BazIdle mentioned this issue Feb 9, 2016
97 tasks
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants