microsoft/vscode-go

Don't show "Unable to eval expression" message box

kzhui125 opened this issue · 4 comments

1

In other extensions such as python, if you eval an expression which produces error, the error is only shown in "WATCH".

But in VSCode go extension, the message box is shown, which is not needed.

And the message box pop up again and again, which has very bad experience.

There are cases when you put a variable in watch, but not available in current debug point.

The error message is from

this.sendErrorResponse(response, 2009, 'Unable to eval expression: "{e}"', {
. I believe how to present the error to users is determined by the vscode and we have little control about that.
Maybe we should report the error in a different way and use the sendErrorResponse sparingly.
@polinasok What do you think?

I don't see how we can communicate the error to VS Code if we don't send the error response as shown in

this.sendErrorResponse(response, 2009, 'Unable to eval expression: "{e}"', {

If we remove that, then the watch pane would simply say "not available".
But another place to evaluate symbols is the debug console which would not say anything if we don't send an error response.

My proposal is not to drop the error response, but to find another way (is it possible to formulate it as a regular response, but with some indication on error?). Does anyone know how python extension handles this?

Closing in favor of golang/vscode-go#143 due to the repo move. Please subscribe to the new issues for further updates