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 "Open File" Feature #346

Merged
merged 9 commits into from
Jan 27, 2020
Merged

Add "Open File" Feature #346

merged 9 commits into from
Jan 27, 2020

Conversation

vexx32
Copy link
Owner

@vexx32 vexx32 commented Jan 14, 2020

PR Summary

Add functionality for opening current koan file instead of just the overall PSKoanLocation from Show-Karma

Context

This PR supersedes #317, all credit for initial idea goes to @arefg -- thank you so much for the work you put in on this already, it really made this a hundred times easier. 😊 💖

Changes

  • Moves the "open koan folder" functionality to -Library switch.
  • Modifies -Contemplate switch to work as an "open current file in the set editor" with capability to recognise code and code-insiders as well as atom and pass correct arguments for these editors to also go to the relevant line in the file.
  • Updates tests to verify new functionality.

Checklist

  • Pull Request has a meaningful title.
  • Summarised changes.
  • Pull Request is ready to merge & is not WIP.
  • Added tests / only testable interactively.
    • Make sure you add a new test if old tests do not effectively test the code changed.
  • Added documentation / opened issue to track adding documentation at a later date.

@vexx32 vexx32 added PR-Needs-Review 🔍 Let's take a closer look! Category-Module Pertaining to the module's functionality itself. labels Jan 14, 2020
@vexx32 vexx32 force-pushed the Feature/OpenFile branch 2 times, most recently from a9198c6 to dc4ba7f Compare January 15, 2020 17:53
- Move `-Meditate` to open the current file
- Add `-Library` to open the folder.
When Get-PSKoan is called with the user scope it needs to check if the
folder actually exists.
- Use temp dir in show-karma test

- Restructure tests to avoid duplication
Copy link
Collaborator

@steviecoaster steviecoaster left a comment

Choose a reason for hiding this comment

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

This looks OK to me, provided the default option in the switch for picking an editor allows for powershell ise for folks still beholden to it?

@vexx32
Copy link
Owner Author

vexx32 commented Jan 23, 2020

@steviecoaster yeah, PS ISE doesn't support a great deal of flexibility really, all it supports as far as I could find is a file path argument, much like most other editors will.

We can always add new ones and reevaluate the solution as we go if we need to ^^

@arefg
Copy link

arefg commented Jan 23, 2020

@vexx32 Hi Joel, sorry for the long delay, I've been super busy lately, and since I didn't have much experience with Pester I needed time to fix the tests. anyway, I'm happy you guys picked it up, I'm going to do the PSKoans test from the start and I'll let you know if I find any problem. 😊

@vexx32
Copy link
Owner Author

vexx32 commented Jan 23, 2020

@arefg not a problem! Hopefully everything works as expected! I'm looking to get this and other recent changes packed into a new release soon. 😊💖

@vexx32 vexx32 mentioned this pull request Jan 23, 2020
@vexx32 vexx32 removed the PR-Needs-Review 🔍 Let's take a closer look! label Jan 27, 2020
@vexx32 vexx32 merged commit c450201 into master Jan 27, 2020
@vexx32 vexx32 deleted the Feature/OpenFile branch January 27, 2020 03:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category-Module Pertaining to the module's functionality itself.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants