-
Notifications
You must be signed in to change notification settings - Fork 53
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
feat(harper-ls): remove deleted file/s diagnostics #304
base: master
Are you sure you want to change the base?
Conversation
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've got a concern or two, but otherwise it looks great! Thanks for noticing the issue.
@@ -407,6 +435,34 @@ impl LanguageServer for Backend { | |||
|
|||
async fn did_close(&self, _params: DidCloseTextDocumentParams) {} | |||
|
|||
async fn did_delete_files(&self, params: DeleteFilesParams) { |
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.
It looks like you're just listening for files that have been deleted by the editor. If a file is deleted separately (i.e. via File Explorer or bash), this won't pick it up.
Would you mind adding listeners to watch for other kinds of deletions? I'd be happy to make it happen, just won't be able to for a bit.
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.
Yeah, this only works if a file is deleted within the editor. I'll look for a way so it'd also pick up deletions that happen outside of the editor. I'll turn this PR into a draft until it's ready.
@@ -61,4 +61,23 @@ describe('Integration >', () => { | |||
// Set config back to default value | |||
await config.update('repeated_words', true, ConfigurationTarget.Workspace); | |||
}); | |||
|
|||
it('updates diagnostics when files are deleted', async () => { |
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.
Love the extensive test coverage you've been building out.
I noticed that even after files are deleted, their diagnostics stay. This fixes that.