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 explorer context menus for 'Run/Debug Pester tests' #2445

Merged

Conversation

bergmeister
Copy link
Collaborator

@bergmeister bergmeister commented Jan 28, 2020

PR Summary

Similar to the existing context menu for the files tab. Manually tested that it works

image

cc @JustinGrote @nohwnd

PR Checklist

Note: Tick the boxes below that apply to this pull request by putting an x between the square brackets.
Please mark anything not applicable to this PR NA.

  • PR has a meaningful title
  • Summarized changes
  • PR has tests
  • This PR is ready to merge and is not work in progress
    • If the PR is work in progress, please add the prefix WIP: to the beginning of the title and remove the prefix when the PR is ready

@bergmeister
Copy link
Collaborator Author

@PoshChan restart ci please

@PoshChan
Copy link

@bergmeister, all requests start with the magic word: Please

Commands available in this repo for you:
  • get failures this will attempt to get the latest failures for all of the target pipelines
  • remind me in <value> <units> this will create a reminder that will be posted after the specified duration <value> is a number, and <units> can be minutes, hours, or days (singular or plural)

@bergmeister
Copy link
Collaborator Author

@PoshChan please restart ci!

@PoshChan
Copy link

@bergmeister, you are not authorized to request a rebuild

@TylerLeonhardt
Copy link
Member

you can ignore the macos failure

Copy link
Member

@TylerLeonhardt TylerLeonhardt left a comment

Choose a reason for hiding this comment

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

LGTM thanks for this!

@bergmeister
Copy link
Collaborator Author

@TylerLeonhardt Just something that is worthwhile noting is that it depends on the currently displayed and focused file in the editor, i.e. one needs to click on the item in explorer first and then do the right click. If a different file has the focus then that file would be chosen for the test run. Also, if someone never opened any ps1 file, then it would just silently fail because the PSIC is not up and running.

@nohwnd
Copy link
Contributor

nohwnd commented Jan 29, 2020

Hmm that’s a bit unfortunate, I know I never left-click, right-click, I just right-click.

@bergmeister
Copy link
Collaborator Author

bergmeister commented Jan 29, 2020

Currently we get the path from const uriString = vscode.window.activeTextEditor.document.uri.toString(); in all use cases (file tab and explorer context menu). Maybe we need to enhance to check if we were called from explorer or from the file tab menu (or pass a parameter to the method with that info) so that we can conditionally use a more appropriate property for the file explorer use case. Let me see if I can do something.

@bergmeister bergmeister changed the title Add explorer context menus for 'Run/Debug Pester tests' WIP Add explorer context menus for 'Run/Debug Pester tests' Jan 29, 2020
@bergmeister
Copy link
Collaborator Author

I could fix it to pass the fileUri of the right-clicked explorer menu through (which works even if that explorer item is not selected) and tested the file tab context menu still works as well. Therefore this issue is gone.

@bergmeister bergmeister changed the title WIP Add explorer context menus for 'Run/Debug Pester tests' Add explorer context menus for 'Run/Debug Pester tests' Jan 29, 2020
Copy link
Member

@TylerLeonhardt TylerLeonhardt left a comment

Choose a reason for hiding this comment

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

LGTM

@TylerLeonhardt TylerLeonhardt merged commit bf0c48b into PowerShell:master Feb 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants