Add Show in Memory Inspector entry to Watch view context menu#166
Add Show in Memory Inspector entry to Watch view context menu#166xoriath wants to merge 1 commit into
Conversation
jreineckearm
left a comment
There was a problem hiding this comment.
@xoriath , thanks a lot again for your contribution! And apologies for taking a bit more time with the initial review. See some comments. I haven't tried building yet due to the comments around the yarn hash and base URLs in package.json.
Will do some local modifications later to test the functionality while waiting for responses.
1678772 to
29201f3
Compare
Think I got all your points done :) Sorry for the corepack change; I have it turned on in my system so I just glance over it when I see it being added to package.json these days :) |
jreineckearm
left a comment
There was a problem hiding this comment.
Thanks, @xoriath, for the swift updates! Much appreciated.
Good to go with what looks like new prettier changes in src/common/debug-requests.ts.
And various new dependency updates in yarn.lock.
My only remaining question before I build and try is whether to keep the "packageManager" entry. It sounded like you were planning to remove. Which I'd support.
|
.. it snuck in AGAIN! Yes the debug-requests should just be prettier changing a bit ... I lost the fight against prettier a long time ago :) |
29201f3 to
c23265c
Compare
jreineckearm
left a comment
There was a problem hiding this comment.
Perfect, thanks, @xoriath !
May I also ask if you tested the changes interactively? If so, which Debug Adapter did you use? I am using a solution that builds on gdbtarget type. But if I add it, I don't see the entries in the Watch window context menus.
|
I tested it on the mplab-core-da adapter... However we should not key of anything that is debug adapter specific... do you use an older vscode? (it's a fairly new contributes segment) |
|
I see for Do you register |
|
nothing more than declaring us as a DA , rest is normal memoryRead/memoryWrite capabilities in DAP ... let me check when I get into the office tomorrow with another debug adapter and see what's falling apart there |
|
Awesome, thanks! |
|
So the debug adapter needs to provider 2 supports messages in the capability exchange. However; just to get bearings; do you have the option to watch in the variables view? If you don't then I think we're on solid ground; i.e |
|
These are the capabilities for Where this.variablesTree gets filled here by a debug tracker here:
That is only looking out for scopes and variables requests.
IIRC, that part is also used to determine the |
VS Code 1.103 introduced the debug/watch/context menu extension point (microsoft/vscode#237751), which lets extensions contribute actions to the Watch view context menu. The Watch view passes the IExpression instance directly as the command argument instead of the wrapped {sessionId, container, variable} shape used by the Variables view, so a separate type guard is required. - Add WatchView.IWatchItemContext type and isWatchItemContext guard in src/common/external-views.ts. - Teach the show-variable and go-to-value command handlers in memory-webview-main.ts to accept the Watch view argument shape, resolving the memory reference from memoryReference (always populated when canViewMemory is true) with a fallback to getAddressOfVariable(evaluateName ?? name). - Mirror the debug/variables/context menu entries under debug/watch/context in package.json so show-variable, go-to-value and store-file are offered on watch items when the debug adapter supports reading memory. - Wire up mocha + ts-node + chai test infrastructure and add unit tests for isVariablesContext and isWatchItemContext covering wrapper contexts, root/child watch expressions, primitives and discrimination between the two shapes. Fixes: eclipse-cdt-cloud#165 Signed-off-by: Morten Engelhardt Olsen <MortenEngelhardt.Olsen@microchip.com>
c23265c to
c2379b4
Compare
|
OK, thanks for double-checking. Will give it another try then to see if I did something wrong when I set up my test environment. |
|
Still no joy with making it work with the VSIX build from CI. I'll see if can debug into it next week. Got a public holiday tomorrow. Have a good weekend! |
|
Same here! Have a great weekend! |
|
Sorry, haven't forgotten about this. But super-busy this week. And now on holiday until 18.05. 🙁 |

What it does
Mirror the debug/variables/context menu entries under debug/watch/context in package.json so show-variable, go-to-value and store-file are offered on watch items when the debug adapter supports reading memory.
How to test
Simply add a a watch variable and right click; should behave identical to the variables view
Review checklist
Reminder for reviewers
Fixes: #165