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

User configurable menus #9285

Open
jrieken opened this issue Jul 14, 2016 · 31 comments
Open

User configurable menus #9285

jrieken opened this issue Jul 14, 2016 · 31 comments
Assignees
Labels
api feature-request Request for new features or functionality menus Menu items and widget issues
Milestone

Comments

@jrieken
Copy link
Member

jrieken commented Jul 14, 2016

We now allows extension writer to contribute menu items. The next logical step is to allow user to configure their menus - this is analog to the keybindings-story. One idea is to have a menus.json file which defines your menus:

{
  "editor/context": [
  {
    "command": "my command",
    "when": "editorHasSelection"
  },
  {
   // more..
  }
  ],
 "explorer/context": [
   // more ...
  ]
}
@jrieken jrieken added feature-request Request for new features or functionality api labels Jul 14, 2016
@jrieken
Copy link
Member Author

jrieken commented Jul 14, 2016

fyi - @egamma @chrisdias @seanmcbreen

@jrieken jrieken self-assigned this Jul 14, 2016
@jrieken
Copy link
Member Author

jrieken commented Jul 28, 2016

related to microsoft/vscode-python#9827

@ydcoming
Copy link

ydcoming commented Sep 8, 2016

This extension adds two new context menus to the Explorer Viewlet:

  • Open New Workbench Here: Opens a new instance of VS Code scoped to the selected folder OR to the folder containing the selected file.
  • Reopen Workbench Here: Reopens VS Code scoped to the selected folder. This feature only works on folders, it has no effect when a file is selected.
    now i want to add two new context menus to the Open New Workbench Here how do i do

@ydcoming
Copy link

ydcoming commented Sep 8, 2016

@jrieken
This extension adds two new context menus to the Explorer Viewlet:

Open New Workbench Here: Opens a new instance of VS Code scoped to the selected folder OR to the folder containing the selected file.
Reopen Workbench Here: Reopens VS Code scoped to the selected folder. This feature only works on folders, it has no effect when a file is selected.
now i want to add two new context menus to the Open New Workbench Here how do i do

@BillDenton
Copy link

I was just about to add a request to add this feature. It would be very useful to be able to extend the file tab menu, or add an additional menu bar. Any idea when this will be done? Thanks.

@manad777
Copy link

manad777 commented Apr 6, 2017

This feature would be really good.

Most plugin authors don't use the context menu at all. They expect you to memorize their keyboard shortcuts, or bring up the command palette, search for a command, navigate to it, and press Enter.

It's way better if you put the power in the hands of the user and let them create their own context menu entries for when plugin devs come up short. That way, you don't need to remember anything, you right-click and select the command you want.

This especially helps for infrequently used plugins where you can't remember the plugin name or the command name.

@JFDu
Copy link

JFDu commented Apr 8, 2017

Great ...

@ronnyek
Copy link

ronnyek commented Aug 16, 2017

I really don't understand how this isn't like priority 1 in vs code. There are like 5 other open requests that seem to suggest the same thing. Debug toolbar placement is just down right infuriating, and placing buttons/other action items down in the status bar is just.... not good.

@Xanewok
Copy link
Contributor

Xanewok commented Jul 19, 2018

While trying to include the officially supported „Go to Implementation” in the context menu (in #54317) this came up as a way this should be solved instead.

@jrieken Would you be willing to provide more mentoring instructions for the feature? I’d like to tackle this, but I mostly made miniscule PRs against vscode and I’m not that familiar with the codebase. Thanks!

@jrieken
Copy link
Member Author

jrieken commented Jul 19, 2018

Well, there are two kind of PRs. One is that "I kinda know how it should be done but I don't have the time to do it" and others are "I have no clue how to do it". User configurable menus is one of the latter and 'yes' I can coach a PR here but it requires planning on my side. It doesn't make sense for you to start on this while I am super booked with other things because I won't be able to provide useful advise then.

@TomasHubelbauer
Copy link
Contributor

I'd like to suggest that Go To Implementation be returned to the context menu. The argument in #27403 (silenced) about it being useful only in a handful of places in a file is not true for C# projects which utilize dependency injection, which is very common for ASP .NET Core and similar.

I am happy to learn that this option is available in the Go menu, but had it been in the context menu, I would have discovered it months ago. Instead I just assumed it was an OmniSharp limitation.

Xanewok added a commit to Xanewok/rls-vscode that referenced this issue Apr 6, 2019
This was used before LSP has considered (and now stabilised)
a 'go to implementation' request. Handling this via LSP,
even at the cost of command disappearing from the context menu [1],
is preferred than using a global command. We'd have to maintain an
extra mapping and guess which RLS server is responsible for the file
for which a request has been made. This is hacky and not guaranteed
to be correct; meanwhile we get errors in multi-root workspaces
whenever we open more than one folder due to each instance trying to
register a global command under the same identifier.

The clean solution is to remove this extra command and use the standard
Go to Implementation (under Go > Go to Implementation [Ctrl + F12])
while we wait for the user configurable menus [2] to land.

[1]: microsoft/vscode#54317
[2]: microsoft/vscode#9285
@velara3
Copy link

velara3 commented May 20, 2019

I've added a related feature request here.

@dhanvikapila
Copy link
Member

I would also agree with @TomasHubelbauer and @Xanewok that "Go to implementation" should be in the context menu or better yet provide the end user (of VS Code) the capability to update keybindings to whatever they want.

For e.g. if you take Typescript and you ctrl-click on a function for a class that implements an interface, VS Code will take you to the definition of that interface. This is useless in almost all cases. I would rather present a choice to the user where he wants to go or have a option to choose the behavior by default.

@thakkarparth007
Copy link

I never knew a "Go To implementation" existed because I'd always used the context menu. Today I when I was reading through the release notes I found out there's such a thing. I found it strange that such a useful thing is not there in the context menu. It'd be great to have it there as I use context menu a lot while code browsing!

@ghost
Copy link

ghost commented Apr 5, 2021

VSCode cannot count on extensions to behave reasonably. In the python/jupyter extensions, there is a very old issue from @isidorn that was completely ignored, and for "normal" (non microsoft) users, all kinds of feedback about the extension's menu is quickly and summarily shut down. If the user is more vocal, they get tagged as "spam" or "disruptive", but with msft employees they get more privilege, and instead only get edited like @brettcannon did here:

image

@The-Compiler
Copy link

FWIW as a possible alternative solution (or perhaps also inspiration) for something like this, check VSpaceCode, which gives you configurable and discoverable/hierarchical keyboard menus:

VSpaceCode demo gif

(I'm not affiliated with the project, just a very happy user of it)

@ronnyek
Copy link

ronnyek commented Jun 11, 2021

@The-Compiler I'd say that appears to be probably one of the better suggestions/workarounds I've seen. I still think there is plenty of justification to have a toolbar... but that ship has sailed...

@icetbr

This comment was marked as outdated.

@tjx666

This comment was marked as spam.

@mhwombat

This comment was marked as spam.

@ronnyek

This comment was marked as spam.

@ronnyek
Copy link

ronnyek commented Aug 3, 2022

Jetbrains fleet is already looking very good... But looks like fleet is doing away with toolbars as well. I wish companies would stop doing things to ui nobody wants or needs. Toolbars work. People are used to them.

Also the moving the menu to the titlebar so we have limited area to drag windows around. Just stop.

@alefragnani
Copy link

I would say: "It is Sublime's fault" 😆

@gmccullo

This comment was marked as spam.

@jrieken
Copy link
Member Author

jrieken commented Dec 9, 2022

FYI and yes it isn't the full deal yet but since a few milestones you can hide menu items from toolbar. That helps to main a clean and custom look. See https://code.visualstudio.com/updates/v1_72#_hide-actions-from-tool-bars for the announcement.

Screenshot 2022-12-09 at 16 08 55

@yiliang114
Copy link
Contributor

FYI and yes it isn't the full deal yet but since a few milestones you can hide menu items from toolbar. That helps to main a clean and custom look. See https://code.visualstudio.com/updates/v1_72#_hide-actions-from-tool-bars for the announcement.

Screenshot 2022-12-09 at 16 08 55

hi @jrieken, In addition to the actions in the editor that can be hidden, the right-click menu on the file tree or other places can hide this matter. Is there any progress?

@starball5
Copy link

starball5 commented Oct 29, 2023

#111163 and #106483 got closed as a duplicate of this, but #75930 isn't (instead closed as "out of scope"). Is removing context menu items in or out of scope for this feature request? If it's out of scope here, why is 111163 closed as a duplicate of this? If it's in-scope, why isn't 75930 closed as a duplicate of this?

And if it's in-scope, how would this feature request support it? Would it be like keybindings.json, where you can prefix something with a "-" to say that that keybinding should be unbound?

Also, how is the text shown for the item in the context menu configured? Or is it just taken from the command's display name?


Related on Stack Overflow:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api feature-request Request for new features or functionality menus Menu items and widget issues
Projects
None yet
Development

No branches or pull requests