microsoft / vscode-go

An extension for VS Code which provides support for the Go language. We have moved to https://github.com/golang/vscode-go
Other
5.93k stars 645 forks source link

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

Closed kzhui125 closed 4 years ago

kzhui125 commented 4 years ago
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.

hyangah commented 4 years ago

The error message is from https://github.com/microsoft/vscode-go/blob/12fd44a26788fb285207a3482dbb21d486b9d8b9/src/debugAdapter/goDebug.ts#L1332. 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?

ramya-rao-a commented 4 years ago

I don't see how we can communicate the error to VS Code if we don't send the error response as shown in https://github.com/microsoft/vscode-go/blob/12fd44a26788fb285207a3482dbb21d486b9d8b9/src/debugAdapter/goDebug.ts#L1332

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.

hyangah commented 4 years ago

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?

ramya-rao-a commented 4 years ago

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