vscode-apex-pmd icon indicating copy to clipboard operation
vscode-apex-pmd copied to clipboard

Clear out problems for a file when that file is closed

Open YodaDaCoda opened this issue 3 years ago • 1 comments

The extension does not clear out linter messages for a file that has been closed. As a user, this is frustrating as I end up with many files in the problems pane, few of which are related to the task/file(s) I'm working on.

Refer to VSCode bug, apparently clearing out these 'old' problems is entirely the responsibility of the extension: https://github.com/microsoft/vscode/issues/66982

YodaDaCoda avatar Jan 22 '21 01:01 YodaDaCoda

Agreed... Although I think maybe there should be a configuration setting and it should allow keeping "errors" but not "warnings" or "info" diagnostics (determined via priorityErrorThreshold & priorityWarnThreshold configuration on readme).

Maybe the setting could just be something like:

clearProblemOnClose: true (default) | false 1 | 2 | 3 | 4

If you pass a number it would only clear errors less severe than that number

I believe the way to do this is to watch for onDidCloseDocument events and push an empty array.

ChuckJonas avatar Jan 22 '21 01:01 ChuckJonas