[wasm][debugger] Implement Runtime.evaluate.#62142
Conversation
|
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) | |
| { | |
| Frame scope = context.CallStack.First<Frame>(); | |
| return await OnEvaluateOnCallFrame(id, | |
| scope.Id, | |
| args?["expression"]?.Value<string>(), token); | |
| if (context.CallStack?.Length > 0) | |
| { | |
| return await OnEvaluateOnCallFrame(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?
|
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