-
Notifications
You must be signed in to change notification settings - Fork 27.9k
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
Regardless of order, new context menu entries on document show above 'Command Palette'. #43892
Comments
@jrieken This does not help with the ability of having my extensions commands appear below the 'Command Palette...' option within the editors context menu. As per https://code.visualstudio.com/docs/extensionAPI/extension-points#_sorting-of-groups
Yet none of these contain the Command Palette and thus, no extensions commands can come after/below the command palette option in the context menu, but be ordered via a inside-group order. Currently, the only way of having a command appear below the command palette option, is to not give it any at all. If you give it either/both a group or inside-group group, the option will appear right above the command palette option as its own group, or in the group order you define prior to the underscore. This is inconsistent behaviour and does not give us control on ordering extension commands below the command palette option. Examples; "group": "@1" "group": "8_@1" "group": "89_@1" "group": "99_@1" This ordering may be an issue with putting things at the top of the context menu too as according to the docs navigation does not have a {x}_ group order. (None of the navigation commands are showing due to not being implemented for the language we use so I can not verify this). Out of curiosity and as per your response of '9' > 'z' being false, I tried combinations of 'z_' and '@z' - Still always above the command palette options in the context menu. Even though it is not a huge issue in terms of functionality as people will get used to where they are, having the ability to completely control the order the context menu between the default options and extension contributions would be nice. |
Hm, maybe prefix a number like |
@jrieken shouldn't it be |
@bpasero That is how I would imagine it should be too, but as per my examples above, "89_@1" was still above "9_" cut/copy/paste group which again contributed to the inconsistent/unexpected behaviour of command ordering. |
I just gave one of my extensions commands the group In this case, the only command I am showing is 'Compile Logic' and it is above the cut/copy/paste command section. Maybe internal commands work differently but extensions seem to be driven off the first character only for the main grouping? |
Yeah, it sort alphabetically... So 10 < 2 etc. Maybe |
Either that, or 'A' so it is below VSCode internal commands but extensions can have commands in the context menu below it. |
Hey, I tried verifying this but still wasn't able to get a custom command to show below the command palette item. Is this expected? What group ids should I be using to test this? |
@mjbvz Because the Command Palette was given a group of 'z_commands' you need to give your extension commands a higher grouping for it to appear below the 'Command Palette' group. For instance I have now given some of my extensions command contributions the group 'z1_' with '@1', '@2' used for their in-group ordering, and they all appear below the Command Palette's 'z' group in the order I want. (This is on the latest insiders build) It could be argued that it would be better to have 'a-' assigned to the commands group in which the command palette has been placed, so that extension commands can be given b_ through z_ as their groups if they are required to appear below the command palette option. |
Thanks @JokerDan! Verified this works using that group |
Steps to Reproduce:
Does this issue occur when all extensions are disabled?: Yes/No - N/A, Need extension
Even with a ridiculously high group order set, my option appears above the 'Command Palette' 'group'.
"group": "9999999_command@1"
Here is with the group set on the command to 9999999_;
And without;
I raise this because, I would like my commands to show below the Palette option.
I am using this as a reference, which does not state the group of the Command Palette.
VSCode Extension API - Sorting of groups.
I am unsure if this is more of an issue, or feature request that the 'Command Palette' option is given a group order that can be worked around?
Also to note, even when left out of a group but given an in-group order, they then appear in their own group above the Command Palette option.
The text was updated successfully, but these errors were encountered: