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 out of sync #2927

Open
bradwilson opened this issue Mar 20, 2019 · 5 comments

Comments

@bradwilson
Copy link

@bradwilson bradwilson commented Mar 20, 2019

Issue Description

I frequently get a situation where Intellisense is out of sync, even though builds are successful. Restarting Omnisharp usually resolve this, though sometimes restarting VS Code is required.

Steps to Reproduce

Unknown at this time.

Performing package restore (dotnet restore) and/or building (dotnet build) does not resolve the issue, regardless of where they're done from (Code task, Code internal terminal, external terminal, etc.).

Expected Behavior

Intellisense matches known type information.

Actual Behavior

Intellisense shows unexpected errors with type information:

Screenshot from 2019-03-20 10-46-22

Logs

OmniSharp log

Starting OmniSharp server at 3/20/2019, 10:31:31 AM
    Target: /home/brad/src/appcenter/appcenter/samples/netcore-api/NetCoreApi.sln

OmniSharp server started with Mono 5.18.1.
    Path: /home/brad/.vscode/extensions/ms-vscode.csharp-1.17.1/.omnisharp/1.32.8/omnisharp/OmniSharp.exe
    PID: 12109

[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/home/brad/src/appcenter/appcenter/samples/netcore-api/src/bin/Debug/netcoreapp2.2/NetCoreApi.dll'

C# log

This log is empty.

Environment information

VSCode version: 1.32.3
C# Extension: 1.17.1

Mono Information OmniSharp using global mono :5.18.1
Dotnet Information .NET Core SDK (reflecting any global.json): Version: 2.2.105 Commit: 7cecb35b92

Runtime Environment:
OS Name: ubuntu
OS Version: 18.10
OS Platform: Linux
RID: ubuntu.18.10-x64
Base Path: /usr/share/dotnet/sdk/2.2.105/

Host (useful for support):
Version: 2.2.3
Commit: 6b8ad509b6

.NET Core SDKs installed:
2.2.105 [/usr/share/dotnet/sdk]

.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.2.3 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.2.3 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.2.3 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download

Visual Studio Code Extensions
Extension Author Version
azure-pipelines ms-azure-devops 1.147.2
chat karigari 0.12.0
code-settings-sync Shan 3.2.7
code-spell-checker streetsidesoftware 1.6.10
csharp ms-vscode 1.17.1
dotnet-test-explorer formulahendry 0.6.5
EditorConfig EditorConfig 0.13.0
github-plus-theme thenikso 1.2.0
gitlens eamodio 9.5.1
ilspy-vscode icsharpcode 0.7.5
material-icon-theme PKief 3.6.3
PowerShell ms-vscode 1.11.0
quokka-vscode WallabyJs 1.0.196
ruby rebornix 0.22.3
toggle-excluded-files eamodio 1.6.0
vscode-browser-preview auchenberg 0.4.0
vscode-docker PeterJausovec 0.6.1
vscode-kubernetes-tools ms-kubernetes-tools 0.1.18
vscode-typescript-tslint-plugin ms-vscode 1.0.0
vscode-versionlens pflannery 0.22.0
vscode-yaml redhat 0.3.0
vscodeintellicode VisualStudioExptTeam 1.1.4
vsliveshare ms-vsliveshare 0.3.1326
vsliveshare-audio ms-vsliveshare 0.1.48
vsliveshare-pack ms-vsliveshare 0.2.10
@bradwilson

This comment has been minimized.

Copy link
Author

@bradwilson bradwilson commented Mar 20, 2019

BTW, there is nothing particularly special about this project. It's just a .NET Core 2.2 API project sample (it includes several services that we wire up by default for AKS, so it's suitable as a copy/paste for a starter project). If a Microsoft employee wants to look at the code, I can provide a link to an AzDO repository; just reach out to me internally at brwilso@.

@jamars

This comment has been minimized.

Copy link

@jamars jamars commented Apr 6, 2019

@bradwilson, that's probably due to a problem with the Omnisharp server... It's annoying, but if you go to the "Command Palette" (Ctrl-Shift-P) and restart Omnisharp you should have intellisense back to making sense again... ;)

@bradwilson

This comment has been minimized.

Copy link
Author

@bradwilson bradwilson commented Apr 8, 2019

Yeah, that's why I reported this bug, because on average I'm restarting Omnisharp upwards of 20x per day (and it's a common complaint on my team).

@robertmiles3

This comment has been minimized.

Copy link

@robertmiles3 robertmiles3 commented Apr 16, 2019

I have the same issue multiple times per day. I usually "Reload Window" to get it back in shape, but it's super annoying and time draining.

@ielcoro

This comment has been minimized.

Copy link

@ielcoro ielcoro commented May 31, 2019

I experienced the same issues every day, some scenarios I have seen it include:

  • Renaming a code file and then renaming his class name in the same workspace, sometimes it shows duplicated intellisense (both the old class name is available along the new one), or the new class name cannot be resolved.

  • Changing a namespace name with Search and Replace, intellisense does not get updated with the new namespace.

  • Performing changes in another workspace in the same window or another VS Code window with a project that is a dependency of the current workspace most of the time intellisense does not catch up with the changes.

All of them get resolved via restarting Omnisharp, but it gets annoying, is time consuming, and it explodes when the number of workspaces and projects grows up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.