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

Cancelled requests from cpptools server don't throw exceptions in extension host #12591

Closed
benmcmorran opened this issue Aug 20, 2024 · 0 comments
Assignees
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. internal Used to opt-out an issue from having GitHub actions applied to it Language Service
Milestone

Comments

@benmcmorran
Copy link
Member

Environment

  • OS and Version: Windows 11
  • VS Code Version: 1.93.0
  • C/C++ Extension Version: 1.21.6
  • If using SSH remote, specify OS of remote machine: N/A

Bug Summary and Steps to Reproduce

If the cpptools server cancels an LSP request, the error information is returned directly as a result instead of propagating as an exception into the extension host. In the screenshot below, I have a dummy LSP handler than always cancels.

Image

The expected behavior when the JSON-RPC message indicates an error is that an exception is thrown, which can then be handled with normal try/catch mechanisms in Typescript.

This is happening because when the cpptools server cancels a request, it puts ResponseError information into the result member of the ResponseMessage. It should actually go into the error member to be correctly handled by vscode-jsonrpc.

Configuration and Logs

N/A

Other Extensions

No response

Additional context

No response

@Colengms Colengms self-assigned this Aug 20, 2024
@sean-mcmanus sean-mcmanus added this to the 1.22.0 milestone Aug 20, 2024
@bobbrow bobbrow moved this to In progress in cpptools Aug 20, 2024
@Colengms Colengms moved this from In progress to Done in cpptools Aug 20, 2024
@Colengms Colengms added the fixed Check the Milestone for the release in which the fix is or will be available. label Aug 20, 2024
@sean-mcmanus sean-mcmanus added the internal Used to opt-out an issue from having GitHub actions applied to it label Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. internal Used to opt-out an issue from having GitHub actions applied to it Language Service
Projects
Status: Done
Development

No branches or pull requests

3 participants