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

feat(harper-ls): remove deleted file/s diagnostics #304

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mcecode
Copy link
Contributor

@mcecode mcecode commented Dec 5, 2024

I noticed that even after files are deleted, their diagnostics stay. This fixes that.

Copy link
Collaborator

@elijah-potter elijah-potter left a 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) {
Copy link
Collaborator

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.

Copy link
Contributor Author

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 () => {
Copy link
Collaborator

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.

@mcecode mcecode marked this pull request as draft December 6, 2024 16:17
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

Successfully merging this pull request may close these issues.

2 participants