Skip to content

handle cancel correctly#289

Merged
ferozco merged 3 commits into
developfrom
fo/handle-cancel-correctly
Mar 15, 2018
Merged

handle cancel correctly#289
ferozco merged 3 commits into
developfrom
fo/handle-cancel-correctly

Conversation

@ferozco
Copy link
Copy Markdown
Contributor

@ferozco ferozco commented Mar 14, 2018

Per LSP spec (AKA bible) every request must be responded to, even cancelled ones. We now do that correctly.

@ferozco ferozco requested a review from gatesn March 14, 2018 23:46
Comment thread pyls/rpc_manager.py Outdated
try:
self._received_requests[request_id].cancel()
self._received_requests[request_id].set_exception(
JSONRPCDispatchException(code=LSP_CANCEL_CODE, message="Request cancelled"))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hanging parenthesis!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

And can you put the request id in the message

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

don't need the request id! the actual response is create here: https://github.com/palantir/python-language-server/blob/develop/pyls/rpc_manager.py#L150

@ferozco ferozco merged commit f57323e into develop Mar 15, 2018
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