Prior to this PR, diagnostics (or "problems") in the vscode problems pane would not be removed on the closing of a file. This is bad practice, and quickly leads to a polluted problems pane with linting issues etc showing for all files despite being open or not.
This PR aims to fix this issue, by calling publishDiagnostics in the vscode API on the close of a text document with an empty array of diagnostics as per the vscode documentation.
This has been verified as working in local vscode setup.
Before
Summary
Prior to this PR, diagnostics (or "problems") in the vscode problems pane would not be removed on the closing of a file. This is bad practice, and quickly leads to a polluted problems pane with linting issues etc showing for all files despite being open or not.
This PR aims to fix this issue, by calling publishDiagnostics in the vscode API on the close of a text document with an empty array of diagnostics as per the vscode documentation.
This has been verified as working in local vscode setup. Before![Nov-24-2023 11-10-52](https://github.com/puppetlabs/puppet-editor-services/assets/112936862/5d4f3f02-35d7-4836-a49d-41feef43c7ef)
After![Nov-24-2023 11-11-35](https://github.com/puppetlabs/puppet-editor-services/assets/112936862/d284ba37-cbfc-4d00-92cf-2cae101ecff4)
Related Issues (if any)
Fixes https://github.com/puppetlabs/puppet-editor-services/issues/357
Checklist