vscode-apex-pmd
vscode-apex-pmd copied to clipboard
Clear out problems for a file when that file is closed
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
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.