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

Add back id in context menu or remove submenu #1983

Open
jwortmann opened this issue Jul 3, 2022 · 0 comments
Open

Add back id in context menu or remove submenu #1983

jwortmann opened this issue Jul 3, 2022 · 0 comments

Comments

@jwortmann
Copy link
Member

LSP-* packages may want to extend the context menu with additional server-specific commands.

Example from VS Code:

example1

The "LSP" submenu was introduced in 8491948 and the "id" for the LSP menu entries was removed in this commit. Extending a submenu from other packages is only possible if the submenu label has an "id". It would work, but then it will be at the bottom of the context menu, because all entries with "id" are appended to the bottom, after the native entries from the Default package (see https://docs.sublimetext.io/guide/customization/menus.html#menu-merging).

example2

(Specific entries from LSP-* helper packages could be hidden for not applicable files via the is_visible method of the command)

Alternative

We could also remove the "LSP" submenu again, and add back all menu items to the top-level context menu (without "id"). Then they will still be at the top, and LSP-* packages could just add their own items in a similar way. Due to ST's ordering by package name when merging resource files, they would immediately follow the LSP standard items then. To save space, we could also hide all disabled standard items via is_visible(), rather than just disable/grey out them via is_enabled().

Alternative 2

LSP-* packages could also add their own submenu under the "LSP" submenu. But this is super ugly and also I think there is no way to hide this, even when all submenu items are hidden via is_visible(). So in this case you would end up with a non-functional submenu without any items even for unrelated files:

example3


Note that currently I don't have any concrete implementation, I'm just experimenting a bit. So this request isn't super urgent, but it would be useful to find a better solution for the future. Any opinions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants