Skip to content
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

builtin-git: add support for missing menu paths #11730

Open
vince-fugnitto opened this issue Sep 30, 2022 · 8 comments
Open

builtin-git: add support for missing menu paths #11730

vince-fugnitto opened this issue Sep 30, 2022 · 8 comments
Labels
builtins Issues related to VS Code builtin extensions git issues related to git scm issues related to the source control manager vscode issues related to VSCode compatibility

Comments

@vince-fugnitto
Copy link
Member

vince-fugnitto commented Sep 30, 2022

Bug Description:

There are issues when using the vscode.git and vscode.git-ui builtins as it references unsupported menu paths:

Failed to register a menu item for plugin vscode.git contributed to scm/sourceControl
Failed to register a menu item for plugin vscode.git contributed to editor/content
Failed to register a menu item for plugin vscode.git contributed to scm/change/title

Steps to Reproduce:

  1. remove vscode.git and vscode.git-ui from the exclusion list

theia/package.json

Lines 119 to 120 in 978a3a0

"vscode.git",
"vscode.git-ui",

  1. remove @theia/git and @theia/scm-extra from the example applications
  2. rebuild, and confirm that the download:script pulls the git builtins
  3. notice the errors related to not being able to set the toolbar items
@vince-fugnitto vince-fugnitto added scm issues related to the source control manager builtins Issues related to VS Code builtin extensions labels Sep 30, 2022
@safisa
Copy link
Contributor

safisa commented Nov 17, 2022

Hi @vince-fugnitto, @colin-grant-work
I have a similar or maybe the same issue. I am getting this error when trying to press on the 3 dots toolbar menu on the git/source control:

Uncaught Error: 'git.tags' is not a menu group.
    at MenuModelRegistry.findSubMenu (menu-model-registry.ts:250:19)
    at MenuModelRegistry.findGroup (menu-model-registry.ts:235:32)
    at MenuModelRegistry.getMenuNode (menu-model-registry.ts:112:25)
    at MenuModelRegistry.linkSubmenu (menu-model-registry.ts:170:28)
    at TabBarToolbar.renderMoreContextMenu (tab-bar-toolbar.tsx:183:53)
    at TabBarToolbar.showMoreContextMenu (tab-bar-toolbar.tsx:166:14)
    at HTMLUnknownElement.callCallback (react-dom.development.js:4164:1)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:4213:1)
    at invokeGuardedCallback (react-dom.development.js:4277:1)
    at invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:4291:1)

Can I fix this issue in my Theia extension (by overriding some methods)?
If so, can you point out where can I start from?

Thanks in advance

@colin-grant-work
Copy link
Contributor

@safisa, I think I've tracked down the source of your problem. I'll make a PR for it in a bit.

@safisa
Copy link
Contributor

safisa commented Jun 20, 2023

Hi,

Also the following warn messages in the console (copied from the forum https://community.theia-ide.org/t/many-vscode-git-extension-warning-messages-in-console-log/3032):

WARN Failed to register a menu item for plugin vscode.git contributed to scm/sourceControl Object Error: Could not find submenu with id scm/sourceControl
{command: 'git.acceptMerge', submenu: undefined, alt: undefined, group: undefined, when: 'isMergeEditor && mergeEditorBaseUri =~ /^(git|file):/ && mergeEditorResultUri in git.mergeChanges'}

WARN Failed to register a menu item for plugin vscode.git contributed to merge/toolbar Object Error: Could not find submenu with id merge/toolbar
{command: 'git.stageChange', submenu: undefined, alt: undefined, group: undefined, when: 'config.git.enabled && !git.missing && originalResourceScheme == git'}

WARN Failed to register a menu item for plugin vscode.git contributed to scm/change/title Object Error: Could not find submenu with id scm/change/title
{command: 'git.revertChange', submenu: undefined, alt: undefined, group: undefined, when: 'config.git.enabled && !git.missing && originalResourceScheme == git'}

Thanks

@vince-fugnitto vince-fugnitto added the git issues related to git label Jul 18, 2023
@JonasHelming JonasHelming mentioned this issue Jan 16, 2024
63 tasks
@rschnekenbu
Copy link
Contributor

The 2 scm menus are listed in the missing vscode declarative APIs issue (#13051 ), and more specifically in the comment #13051 (comment).

editor/content is a proposed API (see https://github.com/microsoft/vscode/blob/main/src/vscode-dts/vscode.proposed.contribEditorContentMenu.d.ts)

documentation for the source control menus: https://code.visualstudio.com/api/extension-guides/scm-provider#menus

@JonasHelming
Copy link
Contributor

@dhuebner Would you be interested in looking at this? IIRC, you added some declarative API in the past or am I mistaken?

@dhuebner
Copy link
Member

@JonasHelming
Sure, I can take a look this week.

@dhuebner
Copy link
Member

@JonasHelming
I did some investigation regarding the missing sub menu entries. The problem is that we have missing functionality in this area and there is simply no place where we can register this menu contribution. @rschnekenbu please correct me if I'm wrong.

Following the list of Failed to register a menu item warning logs I found by following the "Steps to reproduce" instructions. In parenthesis I listed the command ids:

  • scm/sourceControl/title (git.reopenClosedRepositories) - not supported needs multi repo support
  • scm/sourceControl (git.closeOtherRepositories) - not supported needs multi repo support
  • scm/incomingChanges (git.fetchRef, git.pullRef) - Incoming/Outgoing section is missing in SCM view
  • scm/incomingChanges/context (git.pullRef) - Incoming/Outgoing section is missing in SCM view
  • scm/incomingChanges/allChanges/context (git.viewAllChanges) - Incoming/Outgoing section is missing in SCM view
  • scm/incomingChanges/historyItem/context (git.viewCommit) - no Incoming/Outgoing section
  • scm/outgoingChanges - same as scm/incomingChanges, see above
  • editor/content (git.acceptMerge, git.openMergeEditor) - experimental API? Seem to be the blue rectangle button in the editors bottom right conner, not supported
  • multiDiffEditor/resource/title (git.stageFile, git.unstageFile) - multiDiffEditor is not supported
  • diffEditor/gutter/hunk (git.diff.stageHunk) - no idea where is this menu need to be added
  • diffEditor/gutter/selection (git.diff.stageSelection) - no idea where is this menu need to be added

So it is not just adding a new sub menu, but implementing missing scm, editor and diff-editor features that IMHO should be tracked in separate enhancement issues. I would suggest to remove this issue from the epic container issue.

@JonasHelming
Copy link
Contributor

@dhuebner That makes a lot of sense, thank you for the investigation! Would you mind creating the new issue, now that you have all the details at hand? I will remove the issue from the epic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
builtins Issues related to VS Code builtin extensions git issues related to git scm issues related to the source control manager vscode issues related to VSCode compatibility
Projects
None yet
Development

No branches or pull requests

7 participants