Skip to content

Add set value to live watch#977

Open
omarArm wants to merge 6 commits into
mainfrom
addSetValueToLiveWatch
Open

Add set value to live watch#977
omarArm wants to merge 6 commits into
mainfrom
addSetValueToLiveWatch

Conversation

@omarArm
Copy link
Copy Markdown
Collaborator

@omarArm omarArm commented Apr 30, 2026

Fixes

Changes

  • Added ability to edit value through the live watch window

Screenshots

Checklist

  • 🤖 This change is covered by unit tests (if applicable).
  • 🤹 Manual testing has been performed (if necessary).
  • 🛡️ Security impacts have been considered (if relevant).
  • 📖 Documentation updates are complete (if required).
  • 🧠 Third-party dependencies and TPIP updated (if required).

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds “Set Value” support to the Live Watch view so users can modify watched variables directly from the Live Watch context menu, addressing feature request #653.

Changes:

  • Registered a new vscode-cmsis-debugger.liveWatch.setValue command and implemented handling to issue DAP setExpression / setVariable requests.
  • Added unit tests covering root vs child node set-value behavior.
  • Exposed the command via extension contributions (command + Live Watch context menu entry).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
src/views/live-watch/live-watch.ts Registers the new command and implements the set-value request logic.
src/views/live-watch/live-watch.test.ts Adds tests for set-value behavior and updates command registration expectations.
package.json Contributes the new command and wires it into the Live Watch view context menu.
__mocks__/vscode.js Extends VS Code mock with window.showInputBox to support new tests.

Comment thread package.json Outdated
Comment thread src/views/live-watch/live-watch.ts Outdated
Comment thread src/views/live-watch/live-watch.ts
Comment thread src/views/live-watch/live-watch.ts
@qltysh
Copy link
Copy Markdown

qltysh Bot commented Apr 30, 2026

Qlty


Coverage Impact

⬇️ Merging this pull request will decrease total coverage on main by 0.02%.

Modified Files with Diff Coverage (1)

RatingFile% DiffUncovered Line #s
Coverage rating: A Coverage rating: A
src/views/live-watch/live-watch.ts86.7%293, 301
Total86.7%
🤖 Increase coverage with AI coding...
In the `addSetValueToLiveWatch` branch, add test coverage for this new code:

- `src/views/live-watch/live-watch.ts` -- Lines 293 and 301

🚦 See full report on Qlty Cloud »

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

Copy link
Copy Markdown
Collaborator

@jreineckearm jreineckearm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies for raising only now, didn't submit the review yet.

Changes look good and work for me as expected for expression children.

However, changes to parent expressions are silently ignored at the moment. Which makes sense because the support is not yet released in the GDB Adapter. We should enable Set Value only when we detect supportsSetExpression on the adapter capabilities.

Capabilities are already stored here:

private capabilities: DebugProtocol.Capabilities | undefined;
.

Also, if we can't make it work while running, then we should disable/block this functionality while running

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants