Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When closing a project, diagnostics and verification 'tests' for that project may not be removed. #434

Open
keyboardDrummer opened this issue Sep 11, 2023 · 0 comments

Comments

@keyboardDrummer
Copy link
Member

keyboardDrummer commented Sep 11, 2023

We do not want to see diagnostics or verification as tests for projects that are not being viewed in the IDE, however currently that can happen. The server currently depends on didClose notifications to determine a project is no longer being viewed. However, VSCode will not always send a didClose to the server when closing an editor in the IDE.

The reliable event on the VSCode side is window.onDidChangeVisibleTextEditors. On the LSP side, there is a pull API for diagnostics. Using that seems to be the way for diagnostics to disappear at the right time.

We could then reinterpret the pull diagnostics API as a state syncing API. If a document is closed, then we expect the client not to send a previousResultId, which tells the server to send all notifications for this document. If a previousResultId is provided then the server can compare with the result of the last sent notification and if it matches, only resend if there's a difference.

The server will only close state and enable garbage collection after didClose though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant