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

[plugin] Implement SCM Repository selected event #6150

Merged
merged 1 commit into from
Sep 12, 2019
Merged

Conversation

vinokurig
Copy link
Contributor

@vinokurig vinokurig commented Sep 10, 2019

What it does

Implement SCM Repository selected event: https://github.com/microsoft/vscode/blob/a50cf110d96fbe50fc460a6de14ade5b6b060dd4/src/vs/vscode.proposed.d.ts#L673-L684
Removed duplicated SourceControlResourceDecorations interface.

How to test

  1. Open a workspace with more than one Git repositories.
  2. Clone to the workspace folder and compile the test plugin: https://github.com/vinokurig/Test.git
  3. Start hosted instance with the plugin.
  4. Select the / SCM repository (this is a view of a dummy SCM repository):
    screenshot-localhost-3030-2019 09 06-17-34-24

See the notification that is fired inside the event handler.
Select other repository again.
See the notification that the repository is NOT selected.

Review checklist

Reminder for reviewers

@vinokurig vinokurig added plug-in system issues related to the plug-in system vscode issues related to VSCode compatibility labels Sep 10, 2019
@vinokurig vinokurig requested review from akosyakov and a team September 10, 2019 09:12
@akosyakov
Copy link
Member

@vinokurig I could not figure out how I can test that a source control is properly unselected with the proposed extension. We need an extensions which has several source controls and show notifications when one get unselected or selected. @theia/git extension should be removed during testing.

@vinokurig
Copy link
Contributor Author

@akosyakov I think I've understood your point, I've reworked the logic and now you can test this against the plugin provided above that I've changed as well. To apply the plugin you need to disable built in Git extension and paste any folder paths as a repository url: https://github.com/vinokurig/Test/blob/2f48915bab1487d5998ceed06c68d60c898f5ffc/src/scm-plugin-backend.ts#L9-L11

@akosyakov
Copy link
Member

@vinokurig it looks better now! but i don't see initial notification and after i switch to another repo there is no notification that an initial repository is unselected.

@vinokurig
Copy link
Contributor Author

@akosyakov

@vinokurig it looks better now! but i don't see initial notification and after i switch to another repo there is no notification that an initial repository is unselected.

I've fixed that by extracting the logic to a method as you recommended.

Copy link
Member

@akosyakov akosyakov left a comment

Choose a reason for hiding this comment

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

it works very nice now!

@akosyakov
Copy link
Member

@vinokurig please rebase and if ci is green please merge, don't forget to address the outstanding comments

@vinokurig vinokurig force-pushed the scmSelection branch 2 times, most recently from 3dea264 to c7b5a19 Compare September 12, 2019 07:05
Signed-off-by: Igor Vinokur <ivinokur@redhat.com>
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 vscode issues related to VSCode compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants