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

Add a setting to enable retaining listed problems in the Problems tab when files are closed #155172

Closed
Mike-Logit opened this issue Jul 14, 2022 · 3 comments
Assignees

Comments

@Mike-Logit
Copy link

Mike-Logit commented Jul 14, 2022

Usually, I have to open individual files for the errors and warnings (a.k.a. problems) to show in the Problems tab of vscode. The Problems tab retains all the listed problems for all opened files until I begin to close files and the problems start to disappear.

In my React-based project, I run ESLint . to report all problems for the entire project without the need to manually open each file which works fine. These problems remain in the Problems tab even if the associated files are not open in vscode.

The problem is that when I click on a problem or open up the associated file that contains the mentioned problem and then I close the file the problem disappears in the Problems tab.

The feature I would like is to be able to have a setting that is configurable in settings.json to retain these problems so they do not disappear when closing files.

I have configured ESLint as an automated task that runs when vscode is launched so that my development team can keep an eye out for any problems reported.

Running ESLint . manually in a vscode terminal also reports the same results listed in the Problems tab which are also removed when I open and then close the associated files so I don't think the issue is the tasks.json file, but I'll add the tasks.json below just in case you want to see it (I use type shell instead of eslint due to another off-topic bug where the task fails to run due to a "task detection didn't contribute a task" error message, but the shell task does work).

{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "lint",
      "type": "shell",
      "command": "node_modules\\.bin\\eslint.cmd . ",
      "problemMatcher": ["$eslint-stylish"],
      "runOptions": { "runOn": "folderOpen" }
    }
  ]
}

It can be very inconvenient at times to have to re-run ESLint to regenerate these problems when I lose them by accident. I think if this was changed to retain the listed problems then it would help the whole dev team.

GIF to illustrate the problem:
problems-disappearing

@Mike-Logit
Copy link
Author

Mike-Logit commented Jul 14, 2022

I think this feature request might be related to this bug:
#47386

Which was reopened by:
553e6e4

But I might be wrong as it's not strictly a typescript issue. It also happens with Javascript files and the source of my reported problems is eslint whereas the other bug report refers to tsc.

I found the same question on Stackoverflow with no answer:
https://stackoverflow.com/questions/64522841/vscode-show-problems-in-closed-files

@Mike-Logit
Copy link
Author

Not sure if it's a VSCode issue or ESLint issue considering that others have reported the same issues with other tools such as the typescript compiler (tsc). I noticed the same question asked on the vscode-eslint repo so I linked this issue over there as well just in case.

@sandy081
Copy link
Member

Problems (Diagnostics) are controlled/managed by extensions. It seems the extension is removing the diagnostic on closing the file.

It seems you have already filed an issue in the ESLint extension which is correct.

@github-actions github-actions bot locked and limited conversation to collaborators Aug 29, 2022
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

2 participants