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

refactor(lsp): slightly reorganize diagnostics debounce logic #9796

Merged
merged 1 commit into from Mar 18, 2021

Conversation

piscisaureus
Copy link
Member

This patch doesn't actually fix the bug I was hoping to fix, which is
that update_diagnostics() sometimes gets called even when there are
more updates that should be processed first. I did eventually figure out
that this issue is caused by Tokio's cooperative yielding, which
currently can't be disabled.

However overall it makes the debounce code somewhat more readable IMO,
which is why I'm suggesting to land it anyway.

This patch doesn't actually fix the bug I was hoping to fix, which is
that `update_diagnostics()` sometimes gets called even when there are
more updates that should be processed first. I did eventually figure out
that this issue is caused by Tokio's cooperative yielding, which
currently can't be disabled.

However overall it makes the debounce code somewhat more readable IMO,
which is why I'm suggesting to land it anyway.
@bartlomieju
Copy link
Member

bartlomieju commented Mar 15, 2021

I did eventually figure out
that this issue is caused by Tokio's cooperative yielding, which
currently can't be disabled.

I think this is now possible in Tokio 1.3: https://docs.rs/tokio/1.3.0/tokio/task/index.html#unconstrained

Copy link
Contributor

@kitsonk kitsonk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, yes agree it is more readable.

@piscisaureus
Copy link
Member Author

I think this is now possible in Tokio 1.3: https://docs.rs/tokio/1.3.0/tokio/task/index.html#unconstrained

I would like to follow up on this, but currently I don’t have the time, so landing it as-is for now.

@piscisaureus piscisaureus merged commit fb5a278 into denoland:main Mar 18, 2021
@piscisaureus piscisaureus deleted the reorg_debounce branch March 18, 2021 20:26
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.

None yet

3 participants