redhat-developer / vscode-java

Java Language Support for Visual Studio Code
Eclipse Public License 2.0
2.07k stars 433 forks source link

Add setting to exclude files from diagnostic publishing. #3723

Closed rgrunber closed 2 months ago

rgrunber commented 2 months ago

The language server side supports clearing diagnostics from documents when they are excluded due to setting update. This is easily done by getting the list of documents that have any diagnostics, and comparing against the updated filter. Any new matches can have their diagnostics cleared. However, it does not support restoring diagnostics on documents that are no longer filtered. The main reason is because finding all documents and comparing them to the filters might be a lot more expensive for large projects. The diagnostics would be restored as soon as the document is modified. As a result we let this setting trigger the notification that recommends reloading the project.