microsoft/vscode

Support context menu action contributions for debug viewlet views

weinand opened this issue · 14 comments

Support context menu action contributions for debug viewlet views.

@weinand did you sync with @jrieken on this?

fyi @roblourens now we support for extensions to contribute context menu items for debug views. For the moment we only support it for the call stack view but this can easily change

From your extension under package.json you can as before contribute "menus", but we introduced a new context called "debug/callstack/context". Under there you can specify a custom command which you want to be added to the debug callstack context menu.
Once executed the command gets the stackFrame internal uri as an argument from which the extension should be able to identify the stack frame.

Try to connect all the dots and if you have issues I can implement this tomorrow in the mock debugger as a template.

@weinand it would be cool if you implemented restart frame using a similar approach and we get rid of the capability

Sure, for blackbox scripts this was going to be for next milestone though right? Since we need to communicate between the extension host and debug adapter.

@roblourens yes, we will not ship the skipFiles UI for this milestone. But we can experiment with the necessary implementation details...

@isidorn Yes, if we have a richer debug model available to extensions, and if we can communicate to the debug adapter from an extension, it would be possible to implement "Restart Frame" in an extension.

However, we will not do this for these reasons:

  • we cannot remove existing debug UI because it will cripple existing extensions.
  • if we would move more functionality into the extension (as private features), we would make it harder for other frontends (e.g. VS) to support this functionality.

@isidorn I would like to implement an extension that runs alongside the "Native Debug" extension that would allow the user to right click on a variable in the debug view for a context menu with a custom button. In my application, the custom button would be "View Image" for an OpenCV Mat C++ object, so I would need the variable info passed along to the context menu action (and possibly be able to hide the button in case it's not a Mat object) so I can use that to draw in an HTML preview window. Will this be available to extensions?

@cmrigney yes, we are planning to support this scenario. But we still have to design the debug object model that needs to be surfaced when passing the selection (e.g. the variable) to the context menu action.

@weinand Great thanks. Any idea if this will be in the next release?

@cmrigney not in the November release, but in the following.

@jrieken thanks for the doc pointer. We will update as soon as these APIs become official.

This was exploratory work for November. Will be tested in January milestone.

How to configure opencv? Is there have any link?

@CangHaiQingYue I'm no longer working with OpenCV, so I didn't develop any extension for it. Not sure if anyone else did.