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

menu bar extensions #7704

Merged
merged 16 commits into from
Jun 16, 2016
Merged

menu bar extensions #7704

merged 16 commits into from
Jun 16, 2016

Conversation

jrieken
Copy link
Member

@jrieken jrieken commented Jun 15, 2016

The PR is the start to implement #3192 by allowing extensions to add primary and secondary actions to the editor action bar. The approach we take will also allow to add action in other places, like viewlets or context menus.

The current thinking goes like this: In the commands contribution point will get an additional context property (better name to be found) that allows to define where to show the command under what condition.

{
    "command": "v.sayHello",
    "title": "Hello World",
    "icon": "./media/Preview.svg",
    "context": {
        "where": "editor/primary",
        "when": "typescript"
    }
}

The sample above makes the command show up in the primary editor tool bar when it shows a typescript file. The path will be a finite enumeration of locations, like editor/primary, editor/secondary, explorer/primary etc. The when condition is the trustworthy DocumentSelector always being applied on an Uri.

The big concern is UI scalability wrt the amount of actions/menu entries accumulating over time. I don't think being restrictive is the right approach but we should give users the change to customise menus like we allow to customise keybindings. Customisation from extensions should be treated as proposed customisation which the user accepts or denies. Analog to keybindings, there should be a file like menus.json which allows to manually change the menu layout.

@jrieken jrieken added this to the June 2016 milestone Jun 15, 2016
@jrieken jrieken self-assigned this Jun 15, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants