Uh oh!
There was an error while loading. Please reload this page.
[wasm][debugger] Implement Runtime.evaluate. - #62142
Conversation
ghost
commented
Nov 29, 2021
Tagging subscribers to this area: @thaystg Issue DetailsImplement Runtime.Evaluate, the behavior is the same of Debugger.EvaluateOnCallFrame and use the first frame to evaluate. Fixes #61974
|
| if (!expression.StartsWith('(')) | ||
| { | ||
| expression = "(" + expression + ")"; | ||
| expression = "(" + expression + "\n)"; |
There was a problem hiding this comment.
No! The code that VS tries to evaluate is like I added in the test case.
Something like this:15 //evaluate from VS
So I added this \n to avoid to comment the ")".
There was a problem hiding this comment.
can you add that as a code comment here? And maybe a \n before the expression too?
| if (context.CallStack != null) | ||
| { | ||
| Frame scope = context.CallStack.First<Frame>(); | ||
| return await OnEvaluateOnCallFrame(id, | ||
| scope.Id, | ||
| args?["expression"]?.Value<string>(), token); |
There was a problem hiding this comment.
super-nit:
| if(context.CallStack!=null) | |
| { | |
| Framescope=context.CallStack.First<Frame>(); | |
| returnawaitOnEvaluateOnCallFrame(id, | |
| scope.Id, | |
| args?["expression"]?.Value<string>(), token); | |
| if(context.CallStack?.Length>0) | |
| { | |
| returnawaitOnEvaluateOnCallFrame(id, | |
| context.CallStack[0].Id, | |
| args?["expression"]?.Value<string>(), token); |
| if (!expression.StartsWith('(')) | ||
| { | ||
| expression = "(" + expression + ")"; | ||
| expression = "(" + expression + "\n)"; |
There was a problem hiding this comment.
can you add that as a code comment here? And maybe a \n before the expression too?
radical
commented
Nov 29, 2021
btw, can you add to the PR description why this is being added, referencing the original issue, and the jsdebugger issue too? |
Implement Runtime.Evaluate, the behavior is the same of Debugger.EvaluateOnCallFrame and use the first frame to evaluate.
Implementing it make possible to set variable value from VSCode and Visual Studio.
Fixes#61974
Original Issues: https://dev.azure.com/devdiv/DevDiv/_workitems/edit/1366427/
JSDebugger Issue: microsoft/vscode-js-debug#1143