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

Problem entries loops #56317

Closed
ghost opened this issue Aug 14, 2018 · 28 comments
Closed

Problem entries loops #56317

ghost opened this issue Aug 14, 2018 · 28 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug error-list Problems view verified Verification succeeded

Comments

@ghost
Copy link

ghost commented Aug 14, 2018

  • VSCode Version: 1.26.0
  • OS Version: Debian x64

Steps to Reproduce:

  1. Start a project with multiples errors and warnings
  2. wait, and see:
  • The display of errors loops for a time—the number grows up to the maximum of errors and the count restarts from the beginning…
  • Problems hangs with the maximum number of errors, but the display is incomplete—not all errors appear—–and not update anymore

This issue does not occur when C# for Visual Studio Code (powered by OmniSharp) is disabled.

@sandy081
Copy link
Member

Can you please provide a video (gif) of the issue you are seeing?

@sandy081 sandy081 added error-list Problems view info-needed Issue requires more information from poster and removed new release labels Aug 14, 2018
@sandy081 sandy081 self-assigned this Aug 14, 2018
@ghost
Copy link
Author

ghost commented Aug 14, 2018

vscode_1 26_2018-08-14 11-10

@Domvel
Copy link

Domvel commented Aug 14, 2018

Same here. The first line ist a non related (to a file) error. An not clickable. And sometime no line is clickable. Since 1.26. there is a bug.

image

PS: This is not the bottom scroll position. These are all errors. And the first line is a glitch.

PPS: Btw. the error should be about "trailing comma". The problems panel displays wrong errors. The trailing comma was behind an object like {one, two, three,} and tslint is set to never allow this.
You see Problems (1) but displayed many.

@Domvel
Copy link

Domvel commented Aug 14, 2018

I tested the same on the version 1.25.1. It's correct. See:
image

It's a bug in 1.26.0

@FranklinWhale
Copy link

FranklinWhale commented Aug 14, 2018

I am experiencing the same in 1.26.0 and confirm that the Problem Panel works normally when C# for Visual Studio Code (powered by OmniSharp) is disabled.

looping

@sandy081 I think you may want to stop the auto updater before this issue is resolved.

@Domvel
Copy link

Domvel commented Aug 14, 2018

I recommend to use version 1.25.1 or another, but not 1.26.0 until this bug is fixed. I have no idea how to fix it.

@dchw
Copy link

dchw commented Aug 14, 2018

Yep, same issue here.

I am noticing that it only happens when the tab is focused, though If I introduce errors in my code while it is not focused, the number changes appropriately, and stays constant. I guess its a workaround, but not much of one.

So it must be something about the problems being focused that is triggering the error?

@GlenCFL
Copy link

GlenCFL commented Aug 14, 2018

Callbacks provided to vscode.workspace.onDidCloseTextDocument are being invoked constantly, possibly erroneously. This causes Omnisharp C# to remove diagnostic errors over a short time span until it eventually finishes the project analysis, resets the diagnostics, and repeats.

With the Omnisharp C# extension:

  • clone the repository (https://github.com/OmniSharp/omnisharp-vscode.git)
  • install the NPM dependencies
  • compile the source code with the compile NPM script/task
  • place a breakpoint in the file src/features/diagnosticsProvider.ts within the _onDocumentRemove function
  • start a debug session for the extension
  • open a directory containing a C# project (.csproj/.sln), open one of the C# files within a tab, and let the dependencies download

For me with VSCode 1.26.0, this breakpoint will constantly trigger, which C# extension isn't really programmed to deal with.

@demisx
Copy link

demisx commented Aug 15, 2018

Same here. After upgrading to 1.26.0 I see some bogus Typescript errors that have nothing to do with the code.

screen shot 2018-08-14 at 5 45 56 pm

@angi-
Copy link

angi- commented Aug 15, 2018

I’m experiencing the exact same issue as @FranklinWhale with C#

@rvanmaanen
Copy link

rvanmaanen commented Aug 15, 2018

Same sort of issue here on Win10 x64 with VSCode 1.26.0. Colleague who is running 1.25.1 experiences no issues with the same codebase and plugins. What happens here is that the 1 (correct) warning we have keeps disappearing and then reappearing.

@sandy081 sandy081 added the candidate Issue identified as probable candidate for fixing in the next release label Aug 15, 2018
@sandy081
Copy link
Member

May I know if any of you were using quick fix from the problems panel while this issue has happened?

@sandy081
Copy link
Member

Also it would be great, if any of you can provide steps to reproduce this.

@FranklinWhale
Copy link

FranklinWhale commented Aug 15, 2018

@sandy081

No quick fix is required to reproduce this issue.

Steps to reproduce:

  1. In VS Code, install the C# extension
  2. Create a folder
  3. In the folder, run dotnet new console
  4. Open the folder with VS Code
  5. Open the Problems Panel
  6. In workspace settings, add "csharp.suppressHiddenDiagnostics": false
  7. In Program.cs, add using System.Collections.Generic;

Result:

looping2

@Domvel
Copy link

Domvel commented Aug 15, 2018

In my case there are no steps. 😄 Just load a project (e.g. Ionic / Angular) and have one or more (ts) linter or syntax errors. Just have a error and look to the problems panel.

{
  "editor.tabSize": 2,
  "editor.detectIndentation": false,
  "editor.lineNumbers": "on",
  "editor.autoClosingBrackets": true,
  "editor.selectionHighlight": true,
  "editor.occurrencesHighlight": true,
  "editor.matchBrackets": true,
  "editor.insertSpaces": true,
  "editor.renderWhitespace": "all",
  "editor.scrollBeyondLastLine": true,
  "editor.minimap.enabled": true,
  "editor.renderControlCharacters": true,
  "editor.renderIndentGuides": true,
  "editor.trimAutoWhitespace": true,
  "files.trimTrailingWhitespace": true,
  "files.insertFinalNewline": true,
  "files.trimFinalNewlines": true,
  "editor.minimap.showSlider": "always",
  "window.zoomLevel": 0,
  "beautify.tabSize": 2,
  "terminal.integrated.shell.windows": "C:\\Windows\\Sysnative\\cmd.exe",
  "workbench.startupEditor": "newUntitledFile",
  "explorer.confirmDragAndDrop": false,
  "extensions.ignoreRecommendations": false,
  "http.proxyStrictSSL": false,
  "workbench.statusBar.feedback.visible": false,
  "editor.suggestSelection": "first",
  "editor.fontSize": 15,
  "workbench.colorTheme": "One Dark Pro Vivid",
  "diffEditor.ignoreTrimWhitespace": true,
  "editor.rulers": [
    120
  ]
}

Currently I'm on 1.25.1. This version does not have this bug. But I'll test 1.26.0 with the bug again if I have more time. I'll try different installations / PCs. In best case a completely fresh virgin installation. But cannot promise.

@sinbad
Copy link

sinbad commented Aug 15, 2018

I can confirm this started happening with all my Unity C# projects with v 1.26.0, on Win10x64 + C# plugin v1.15.2. Constantly flicks between "No Problems" and the actual (correct) problems, which appear for 1s before disappearing again.

@sandy081
Copy link
Member

@FranklinWhale With your steps I see following. It looks like C# extension is continuously updating the diagnostics and hence problems view is getting updated.

kapture 2018-08-15 at 18 26 16

@Domvel Looks like you have a different issue that problems view is showing bogus errors. Is it possible to steps to reproduce with some code samples?

@GlenCFL
Copy link

GlenCFL commented Aug 15, 2018

I have the C# flickering issue fixed locally with some modifications to their diagnostics provider, though they seemed pretty confident that it was a VSCode issue over in their repository.

@FranklinWhale
Copy link

@sandy081 The issue was reported in dotnet/vscode-csharp#2456 and it was closed

@dchw
Copy link

dchw commented Aug 15, 2018

I accidentially posted this earlier on #56371, sorry!

I am on macOS Mojave and here is a sample C# project that can reproduce this. I created it with dotnet commands at the command line exclusively.
testProj.zip

It becomes more apparent if you also tun on the info level warnings. Add this to your User Settings:
"csharp.suppressHiddenDiagnostics": false,

@sandy081 sandy081 added bug Issue identified by VS Code Team member as probable bug and removed info-needed Issue requires more information from poster labels Aug 15, 2018
@sandy081 sandy081 added this to the July Recovery 2018 milestone Aug 15, 2018
@sandy081 sandy081 changed the title Buggy PROBLEMS panel Problem entries loops Aug 15, 2018
@sandy081
Copy link
Member

As I said there are two issues:

  1. Problems keep on showing in loops.

This is happening because, whenever problems for a file are shown, problems view asks for the code actions in that file by opening it and closing it after. Looks like the C# extension is reacting to these and generating diagnostics.

@rchande Can the C# extension handles this? I will try to see if I can do a fix from our side.

  1. Showing bogus problems.

Please refer to #56371 for this.

@rchande
Copy link

rchande commented Aug 15, 2018

@sandy081 Our diagnostics provider tries to react to a variety of events and push diagnostics to a diagnostic collection. It sounds like Code has changed the way it processes/requests diagnostics internally. Can you help me understand exactly what chose changes were? It sounds like we can stop responding to file open/close to push diagnostics. Anything else?

@domske
Copy link

domske commented Aug 15, 2018

Sometimes the error checker is looping. But also incorrect and buggy errors in problem panel.
vs-code-1-26-problems-panel-bug

In the image you see a corrupt problem panel content. The errors are not clickable. The first error is not related to a source file.
After restart of VS Code the panel works correctly. I did not yet figured out, how to reproduce. But this is only in version 1.26 for sure. Maybe a tslint (by egamma) extension issue?

demo-project.zip

... Oh no, VS code has a cold. 😢 Get well soon! Best wishes. ❤️

Update: Related to #56371

@Marconius6
Copy link

I have this same issue on 1.26.0, on Windows; a colleague working on Mac said he had it too, but for him it resolved after restarting Code once.

I also noticed the number next to Problems updates as you'd expect when you have that tab open, BUT if you have any other tab open, or close that window entirely, the number always stays at whatever is highest. To me this says it's an error with the Problems tab specifically, and doesn't seem to be an issue with OmniSharp itself; also not that if you're looking at OmniSharp output, it does NOT produce additional output beyond the first time.

@Domvel
Copy link

Domvel commented Aug 16, 2018

Of course . My case is more related to #56371.

sandy081 added a commit that referenced this issue Aug 16, 2018
sandy081 added a commit that referenced this issue Aug 16, 2018
@sandy081
Copy link
Member

To verify:

  • Install c# extensions
  • Download the testProj.zip
  • Open the project in VS Code
  • Open Problems Panel and make sure that problems are shown without any looping.

@aeschli
Copy link
Contributor

aeschli commented Aug 16, 2018

Code reviewed

@aeschli
Copy link
Contributor

aeschli commented Aug 16, 2018

Verified in 1.26.1-stable
Commit: 49e7ddb

@aeschli aeschli added the verified Verification succeeded label Aug 16, 2018
@egamma egamma removed the candidate Issue identified as probable candidate for fixing in the next release label Aug 17, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Sep 30, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug error-list Problems view verified Verification succeeded
Projects
None yet
Development

No branches or pull requests