ObliviousHarmony / vscode-php-codesniffer

A VS Code extension for integrating PHP_CodeSniffer.
https://marketplace.visualstudio.com/items?itemName=obliviousharmony.vscode-php-codesniffer
Other
38 stars 2 forks source link

Diagnostics Not Erased On Error #71

Closed ObliviousHarmony closed 10 months ago

ObliviousHarmony commented 1 year ago

Description

When an error is caught](https://github.com/ObliviousHarmony/vscode-php-codesniffer/blob/88912e0d91076b52e88b37135473fd6eb5df8ea2/src/services/diagnostic-updater.ts#L201), it doesn't look like existing diagnostics are cleaned up. This means that problems might be left behind from a previous run and lead to confusion. Did it work even though it gave an error? What if they change the standard and get an error; it'll leave behind existing errors that are invalid?

Reproduction Steps

  1. Change the phpCodeSniffer.standard setting to "Custom" and phpCodeSniffer.customStandard to something invalid.
  2. The document's problems are not erased even though there is an error displayed.

Expected Behavior

The problems should be erased when the worker fails.