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

[SCM] Fix SCM status bar commands #6208

Closed
wants to merge 0 commits into from
Closed

[SCM] Fix SCM status bar commands #6208

wants to merge 0 commits into from

Conversation

vinokurig
Copy link
Contributor

@vinokurig vinokurig commented Sep 18, 2019

What it does

Pass command arguments to SCM status bar commands. Pass Command.id to SCM status bar commands if Command.command is undefined.

How to test

  1. Clone the test plugin: https://github.com/vinokurig/Test.git
  2. Compile the plugin and start it as a hosted instance.
  3. Select the / SCM repository (this is a view of a dummy SCM repository):
    screenshot-localhost-3030-2019 09 06-17-34-24
  4. Click title button in the status bar:
    screenshot-localhost-3030-2019 09 18-15-18-52

See the notification

fixes eclipse-che/che#13974

Review checklist

Reminder for reviewers

@vinokurig vinokurig added the scm issues related to the source control manager label Sep 18, 2019
@@ -64,6 +64,7 @@ export interface ScmResourceDecorations {
export interface ScmCommand {
title: string;
tooltip?: string;
id?: string;
Copy link
Member

@akosyakov akosyakov Sep 19, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it not it confusing that id is used as command as well? Can we instead fix it in the plugin system, that id is assigned to a command. I don't think we should pull deprected apis in the plugin system into other extensions.

Also command and title are not optional in vscode.d.ts: https://github.com/microsoft/vscode/blob/6de911e3298424cfb6dd6792bff5499f1cd6a230/src/vs/vscode.d.ts#L19-L29

I wonder why there are optional for us? Can we fix it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it not it confusing that id is used as command as well? Can we instead fix it in the plugin system, that id is assigned to a command.

done

Also command and title are not optional in vscode.d.ts: https://github.com/microsoft/vscode/blob/6de911e3298424cfb6dd6792bff5499f1cd6a230/src/vs/vscode.d.ts#L19-L29

I wonder why there are optional for us? Can we fix it?

The Git extension may set an SCM command item without an action:

if (this.syncService.isSyncing()) {
return {
title: '$(refresh~spin)',
tooltip: 'Synchronizing Changes...'
};
}

@akosyakov akosyakov added the plug-in system issues related to the plug-in system label Sep 19, 2019
id: string;
command?: string;
Copy link
Member

@akosyakov akosyakov Sep 20, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after looking closer, actually it has to be id here, because this Command should be aligned with monaco command: https://github.com/microsoft/monaco-editor/blob/dc793af0020b9878b798b45fdcaf31e1b263c40b/monaco.d.ts#L5536-L5541, even though that vscode APIs are using command not id

I think we should fix typings here:

acceptInputCommand?: ScmCommand;
statusBarCommands?: ScmCommand[];
}

i.e.:

acceptInputCommand?: Command;
statusBarCommands?: Command[];

since we actually send plugin commands not scm commands and then do adjustment in scm-main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plug-in system issues related to the plug-in system scm issues related to the source control manager
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Redundant dialog appears on git checkout from status bar
2 participants