microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.16k stars 29.28k forks source link

Inline editing of debug variables #209677

Open connor4312 opened 7 months ago

connor4312 commented 7 months ago

@hediet showed me his extension that has "edit variable" code lens in certain places over variables in the code while debugging. It led me to thinking that we could have an in-editor "Edit Variable" experience that would look kind of similar to the input opened during inline chat.

DAP doesn't have knowledge of variable placements, but we do have the EvaluatableExpressionProvider. In the case where inline values are turned on, they could be clickable to edit them. Additional/otherwise, this could be surfaced through an "edit" action in debug hovers. Editing a variable would open an overlaid input box, prefilled with the variables current value, and the variable would be updated in the DA once changed and submitted.

hediet commented 7 months ago

I like the idea of enriching debugging UI! Though I'm unsure what use-case this enhancement would improve. It seems to serve a different use-case than the extension I prototyped.

This is the what the extension does (notice the live-updates and the playground-like experience): Code_-_Insiders_r9nz6uTvmy

connor4312 commented 7 months ago

Yea, this is not really related to your extension, it was more inspired by seeing the "edit value" action in the editor. Letting people stay in the code instead of having to move out to the REPL to edit their variables would be a very smooth experience.