Skip to content

fix(lsp): only call notify_reply_callback once the request is actually resolved#171

Closed
saecki wants to merge 1 commit intomainfrom
lsp-request
Closed

fix(lsp): only call notify_reply_callback once the request is actually resolved#171
saecki wants to merge 1 commit intomainfrom
lsp-request

Conversation

@saecki
Copy link
Copy Markdown
Owner

@saecki saecki commented Aug 2, 2025

This is a follow up to #167

The complete function might do some async work, such as fetching crates.io versions or searches.
If I understand correctly a lsp request has 3 states pending, cancel, and complete.
The documentation says to call the callback once the request is no longer pending, which (because we don't handle cancellation) would make it complete right?

So this just schedules the notify_reply_callback after the callback has been called by the request handler.

Are my thoughts correct here, or is the no longer pending more of a: when work has started?
@PolyMeilex I would appreciate your input on this manner :)

@saecki saecki changed the title fix: only call notify_reply_callback once the request is actually resolved fix(lsp): only call notify_reply_callback once the request is actually resolved Aug 2, 2025
@saecki
Copy link
Copy Markdown
Owner Author

saecki commented Aug 2, 2025

Oh, never mind the notify_reply_callback is for the synchronous case...

@saecki saecki closed this Aug 2, 2025
@PolyMeilex
Copy link
Copy Markdown
Contributor

Yep, since neovim/neovim#33624 it is synchronous aware.

@saecki
Copy link
Copy Markdown
Owner Author

saecki commented Aug 2, 2025

So just to clarify, should notify_reply_callback be called once the server has begun handling the request, or after the request has been completed, thus the callback has been called?

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