-
Notifications
You must be signed in to change notification settings - Fork 764
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
debug: don't show "Unable to eval expression" error message already under WATCH #143
Comments
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". |
From microsoft/vscode-go#3227 (comment) by @hyangah:
|
My first thought was the same as @hyangah's: instead of sending ErrorResponse, send back successful EvaluateResponse, setting the result of the expression to the error message. Quick test of this alternative code snippet (which could be used in case of
yielded expected results: the error appeared in the Watch section without the pop-up. Request:
Response before:
Response after:
But this seems like the wrong way to go, given the spec. |
Now lets look into what vscode-python does, given that it has the desired behavior without the pop-up. Its debug adaptor appears to forward things over to PTVSD, which also uses DAP. And PTVSD sends back neither a successful EvaluateResponse nor a full-fledged ErrorResponse, but something in-between - an EvaluateResponse with the body set to EvaluteResponseBody and not ErrorResponseBody while success and message fields are set as they would be in an ErrorResponse. Turning on logging with
This is then forwarded up the adaptor chain, stripping the EvaluateResponseBody and turning this into a proper ErrorResponse (since
But the big difference with Go is that the optional error Message in the body is not set at all. I will put together a quick PR tomorrow. |
From microsoft/vscode-go#3227 by @kzhui125
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 text was updated successfully, but these errors were encountered: