-
Notifications
You must be signed in to change notification settings - Fork 215
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
Drop diagnostics on closing the file #1395
Drop diagnostics on closing the file #1395
Conversation
a581181
to
b41065c
Compare
Signed-off-by: Govardhan G D <[email protected]>
b41065c
to
2b928d4
Compare
@@ -1179,6 +1179,8 @@ impl LanguageServer for SolangServer { | |||
if let Ok(path) = uri.to_file_path() { | |||
self.files.lock().await.remove(&path); | |||
} | |||
|
|||
self.client.publish_diagnostics(uri, vec![], None).await; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wonderful!
Again, this could do with a test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried writing a test using the vscode
typescript API to open and close files.
I am using vscode.commands.executeCommand('workbench.action.closeActiveEditor')
to close the open tab. But this doesn't seem to emit the didClose
event which is what the language server listens for.
I tried registering a listener for this event in javascript as well. But, this listener did not run either.
But manually closing the files works every time and the old diagnostics disappear when this happens.
Please, run |
Signed-off-by: Govardhan G D <[email protected]>
c1b55b3
to
b8f1ac3
Compare
When closing a file in VS code, all the warnings and errors remain in the list of problems. This removes all diagnostics pertaining to the close file.