mattn / efm-langserver

General purpose Language Server
MIT License
1.36k stars 61 forks source link

Fix problems diagnostics do not disappear when context cancelled for workspace level linters #201

Closed Matts966 closed 2 years ago

Matts966 commented 2 years ago

This PR fixes the problems in which diagnostics do not disappear when context is canceled for workspace level linters.

When the context of lint is canceled because of new lintRequest, the existing implementation can update the h. lastPublishedURIs but sometimes does not publish necessary empty diagnostics.

This fix updates h. lastPublishedURIs after the cancellable block is completed.

This fix is tested with https://github.com/mattn/efm-langserver/commit/a9dc902e363d8383e935c9e869839c89c5fc3d47, but the test is not committed as it uses time.Sleep. If the test should be committed, please tell me :bow:

Sorry for my buggy implementation of #193

mattn commented 2 years ago

Thanks. Please let me known if this is ready to merge.

Matts966 commented 2 years ago

@mattn Thank you! It's ready 🙏

mattn commented 2 years ago

Thank you