-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add debug window context menu contribution points #212501
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: thegecko <[email protected]>
const context = delegate.getActionsContext ? delegate.getActionsContext(event) : undefined; | ||
// Determine whether the action source is contributed via a proxy (e.g. from an external extension) | ||
// Context will need to be serializable (e.g. no recursive structures) | ||
const contributedAction = (actionToRun instanceof MenuItemAction) && actionToRun?.item?.source; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Due to the existing context menus already utilising referenced objects in their commands which cannot be serialised (e.g. due to circular references or bigint types), a mechanism is required to determine if the context menu item has been contributed by an external extension.
The method chosen here relies on a source
existing for external contributions. I'm not a bug fan of this, is there a better way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't try to use two different contexts for one toolbar. That is one thing that has always been an issue with exposing menus to extensions, and I'm not sure whether there's a better way to handle it, I will try to discuss that this week.
|
||
return { | ||
sessionId: this.debugService.getViewModel().focusedSession?.getId(), | ||
expressionId: expression.getId(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this ID is meaningful or exposed to extensions elsewhere, or is it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could be right, but it may be useful as a unique ID?
As discussed in #200880 we are keen to ensure there are contribution points in all debug window context menus
This proposal implements contribution points for the watch, breakpoints and disassembly views.
To use this proposal, the
package.json
would look similar to:An example can be found here: https://github.com/thegecko/vscode-proposed-debug
Fixes: #200880, #150161
Relates with: #212500