question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Intelllisense errors in a vscode dotnet core 2.1 / C# project (with git diff view)

See original GitHub issue

Intellisense.zip

Environment 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

  1. unzip the attached sample project, notice that the project contains a partial class called Test, and it spans two files: Test.cs, and Test2.cs
  2. 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)
  3. make some modification to the prototype of some method, like changing the parameter name from input to inputxx in the attached file Test2.cs of the method internal 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
  4. 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
  5. 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)
  6. 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!
  7. 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 in Test, or something similar
  8. 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:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
akshita31commented, Sep 20, 2018

@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.

0reactions
rchandecommented, Oct 4, 2018

@llint @zvinless Glad it works for you–thanks for taking the time to let us know!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Intellisense does not work unless I open the project in visual ...
I had a very similar log. I was able to solve my problem by updating visual studio code editor in the package manager...
Read more >
Source Control with Git in Visual Studio Code
Using Git source control in VS Code. Visual Studio Code has integrated source control management (SCM) and includes Git support out-of-the-box.
Read more >
New C# project with vscode and I have intellisense errors
New C# project with vscode and I have intellisense errors · You're using the new .net 6 minimal project. · Does OmniSharp logs...
Read more >
Fixing Visual Studio Intellisense Errors - Rick Strahl's Web Log
I ran into a problem in one of my applications where Visual Studio was showing errors that were clearly not actual errors.
Read more >
Visual Studio 2019 version 16.11 Release Notes
Get the latest features, bug fixes, and support for Visual Studio 2019 v16.11. Download today.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found