Intelllisense errors in a vscode dotnet core 2.1 / C# project (with git diff view)
See original GitHub issueEnvironment data
dotnet --info
output:
.NET Core SDK (reflecting any global.json): Version: 2.1.402 Commit: 3599f217f4
Runtime Environment: OS Name: Windows OS Version: 10.0.17134 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\2.1.402\
Host (useful for support): Version: 2.1.4 Commit: 85255dde3e
.NET Core SDKs installed: 2.1.202 [C:\Program Files\dotnet\sdk] 2.1.400 [C:\Program Files\dotnet\sdk] 2.1.401 [C:\Program Files\dotnet\sdk] 2.1.402 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed: Microsoft.AspNetCore.All 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.3-servicing-26724-03 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download
VS Code version:
Version: 1.27.2 (user setup) Commit: f46c4c469d6e6d8c46f268d1553c5dc4b475840f Date: 2018-09-12T16:17:45.060Z Electron: 2.0.7 Chrome: 61.0.3163.100 Node.js: 8.9.3 V8: 6.1.534.41 Architecture: x64
C# Extension version:
1.16.1
Steps to reproduce
- unzip the attached sample project, notice that the project contains a partial class called
Test
, and it spans two files:Test.cs
, andTest2.cs
- put the project under Git control (do a
git init
at the project root dir), so one can have git diff view inside vscode (the “Source Control” icon on the leftmost side of vscode) - make some modification to the prototype of some method, like changing the parameter name from
input
toinputxx
in the attached fileTest2.cs
of the methodinternal string foo(string input)
(use “Rename Symbol” from the right click context menu to make sure the references are also changed - no compiler errors!), save the change in vscode - in the vscode git tab, click the file that now has the changes, so the vscode would show the git diff view of the file
- hover the mouse on the changed variable, and see some Intellisense tips showing up, and hover your mouse anywhere around the project (like clicking open another file, and hovering the mouse pointer on top of random symbols)
- now close the git diff view file tab - IMPORTANT the git diff view file tab needs to be CLOSED in order for the Intellisense errors to be showing up!
- under the “Problems” output window in vscode, you should now see that Intellisense is complaining about various random syntax errors, e.g.
s
is not defined inTest
, or something similar - build and run the project, it still works as expected.
Expected behavior
The Intellisense should not display random syntax errors after opening and closing the modified file diff view, while the source code is proved to be valid with normal build and run.
Actual behavior
The Intellisense displays random syntax errors, even though there are no syntax errors!
Summary
This issue seems to be related to git diff view, causing Intellisense to become messed up.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:11 (3 by maintainers)
Top GitHub Comments
@llint I am definitely able to reproduce the error. I seems that when the file is opened in git view, omnisharp process deleted the file from the workspace, hence the intellisense seems messed up. Thanks for filing, we are investigating.
@llint @zvinless Glad it works for you–thanks for taking the time to let us know!