-
Notifications
You must be signed in to change notification settings - Fork 236
Add New-EditorFile #622
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
Merged
TylerLeonhardt
merged 4 commits into
PowerShell:master
from
TylerLeonhardt:psedit-new-files
Feb 20, 2018
Merged
Add New-EditorFile #622
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
1a31c75
add new file capabilities to psedit
TylerLeonhardt 9cd7901
Add New-EditorFile and dynamically load functions in module
TylerLeonhardt ddf3bb0
Support no path opening an Untitled file
TylerLeonhardt 484c6c5
add preview to open file
TylerLeonhardt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As long as this parameter supports this scenario
Get-ChildItem *.ps1 -r -file | Open-EditorFile
, I'm good.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So @rkeithhill ... as it turns out, this will proceed to open the file temporarily (with the italicized file name)... so what ends up happening is, it opens the file temporarily and then the next file opens and replaces the file temporarily.
I'm not sure how to durably open files - if that's possible. I'll have to dig around.
@daviwil any thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yes. That's why I double-click the editor window tab. That converts it from a temp (resuable) window to a permanent one. Not sure how you do that programmatically though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly. Maybe if @SeeminglyScience or @daviwil know? Otherwise, can I convince you to call this out of scope 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use the
vscode.window.showTextDocument()
overload that takes aTextDocumentShowOptions
object. One of the fields of that object ispreview?
. That should allow you to create each window in a "non-preview" window.https://code.visualstudio.com/docs/extensionAPI/vscode-api#_a-nametextdocumentshowoptionsaspan-classcodeitem-id239textdocumentshowoptionsspan
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be my preference. Later we could update the openFile() method to take an optional "preview" Boolean parameter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if I already have this working? Is it worth adding it now or saving it for when someone actually asks for that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll just push and you can judge whether we should keep it in or not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to have that option, so yeah, if it's working - go for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rkeithhill pushed that. Here's the vscode-powershell PR as well:
PowerShell/vscode-powershell#1197