puppetlabs / puppet-editor-services

Puppet Language Server for editors
Apache License 2.0
45 stars 21 forks source link

(CAT-1595) - Remove diagnostic on textDoucment onDidClose #356

Closed jordanbreen28 closed 7 months ago

jordanbreen28 commented 7 months ago

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

After Nov-24-2023 11-11-35

Related Issues (if any)

Fixes https://github.com/puppetlabs/puppet-editor-services/issues/357

Checklist