sqlfluff / vscode-sqlfluff

An extension to use the sqlfluff linter in vscode.
https://marketplace.visualstudio.com/items?itemName=dorzey.vscode-sqlfluff
MIT License
156 stars 33 forks source link

Improved Handling for Problems in Closed/Deleted Files #150

Closed jackfrey13 closed 4 months ago

jackfrey13 commented 4 months ago

Right now, if lintEntireProject is turned on, the onDidCloseTextDocument logic will not delete any diagnostics from the Problems tab. This is desirable in most cases, however if I close a file that's not in the workspace (i.e. unnamed SQLQuery_1) or if onDidCloseTextDocument gets called by the editor for a file that got closed because it was deleted, the diagnostics for the file should be removed in those cases.

The screenshot below shows an example where SQLQuery_2 and SQLQuery_3 were closed without being saved but still show in the Problems tab even though they are not files in the active workspace/project directory. This is undesirable because it results in the Problems tab showing linting errors for files that don't exist anymore.

image

RobertOstermann commented 4 months ago

Thanks for the PR. This will be released in v3.1.3