Implements setExpression request.#612
Conversation
| const capabilities = super.initialize(args); | ||
| const capabilities: VSDebugProtocolCapabilities = super.initialize(args); | ||
| capabilities.supportsRestartRequest = true; | ||
| capabilities.supportsSetExpression = true; |
There was a problem hiding this comment.
setExpression request will not be issued by PZ untill we turn the configuration on like this.
|
I'm I understanding this correct: |
|
@auchenberg That is correct. And if the DA is not connected to PZ, it won't receive a setExpression request regardless of what |
|
Is there a feature request open for this on the DA protocol? What happens if I edit an expression like Why is it not relevant to Node? |
|
@roblourens Thanks for these questions.
That being said, I will do another PR in chrome-core to fix those issues. The current PR should cover everything I need to do in vscode-chrome-debug. Please help share your opinion on what the right approach should be.
|
Would you have the flexibility to just send an evaluate request from PZ, implementing it on that end the same way it's implemented here?
If we go with this, I don't see why it wouldn't work for node, and I would think this code should live in -core |
I don't have the flexibility to send an evaluate request. I think that PZ is doing the right thing. There is no guarantee that doing a "p = v" will work for every debug target. Some debug target might require getting the variable reference first, and change value using that reference. It also depends on whether the returned information from evaluate() is adequate for what the caller expects. If not, setExpression(p, v) has to do more work to get the extra information. In other words, the semantic of setExpression(p, v) does not necessarily equal to evaluating "p = v".
|
|
Sure I understand.
I just mean that when you call |
setExpression is emitted by Visual Studio to change a value of a watch variable. Such request is out of the definition of VSCode debug protocol. In this PR we implement only for Chrome. It is what we have verified working. Other debug adapter might need a different approach to update the value.
|
Setting "repl" works, but I still see a useless callstack appended to the error description. That's probably something only fixable in the -core code base (which I will do next). And the VS Code issue regarding setExpression request is opened here: microsoft/vscode#45621 PTAL. Thanks! |
|
Ok, I will merge this to unblock you but we can keep the discussion going. |
|
Thanks Rob. I will keep you in the loop of the follow-up works. |
setExpression is emitted by Visual Studio to change a value of a watch variable. Such request is out of the definition of VSCode debug protocol.
In this PR we implement only for Chrome. It is what we have verified working. Other debug adapter might need a different approach to update the value.
We want to release this change for Chrome first, because after we switch to PZ, we will have a regression of functionality unless we implement this code change. So we do want to release this piece asap.
I will spend more time to investigate whether the same approach of updating an expression will work the same for Edge. If it can work in the same way, I will take care of moving this code to vscode-chrome-debug-core as well.