Skip to content

Fix #83; standardize snippet formatting; remove duplicates #90

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
merged 2 commits into from
Feb 26, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Snippets/(catch) catch {...}.sublime-snippet
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!-- See http://www.sublimetext.com/docs/snippets for more information -->
<snippet>
<content><![CDATA[catch ${1:[Exception]}{
$2
Expand Down
1 change: 1 addition & 0 deletions Snippets/(fin) finally {...}.sublime-snippet
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!-- See http://www.sublimetext.com/docs/snippets for more information -->
<snippet>
<content><![CDATA[finally {
$1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!-- See http://www.sublimetext.com/docs/snippets for more information -->
<snippet>
<content><![CDATA[function ${1:funcName} {
$2
}]]></content>
<!-- Optional: Tab trigger to activate the snippet -->
<tabTrigger>fun</tabTrigger>
<!-- Optional: Scope the tab trigger will be active in -->
<scope>source.powershell</scope>
</snippet>
<!-- See http://www.sublimetext.com/docs/snippets for more information -->
Copy link
Member

Choose a reason for hiding this comment

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

What's changed here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed the file to standardize snippet names

<snippet>
<content><![CDATA[function ${1:funcName} {
$2
}]]></content>
<!-- Optional: Tab trigger to activate the snippet -->
<tabTrigger>fun</tabTrigger>
<!-- Optional: Scope the tab trigger will be active in -->
<scope>source.powershell</scope>
</snippet>
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!-- See http://www.sublimetext.com/docs/snippets for more information -->
<snippet>
<content><![CDATA[${1:\$mydocs} = [environment]::GetFolderPath([environment+specialfolder]::MyDocuments)]]></content>
<!-- Optional: Tab trigger to activate the snippet -->
<tabTrigger>mydocs</tabTrigger>
<!-- Optional: Scope the tab trigger will be active in -->
<scope>source.powershell</scope>
</snippet>
<!-- See http://www.sublimetext.com/docs/snippets for more information -->
<snippet>
<content><![CDATA[${1:\$MyDocs} = [Environment]::GetFolderPath([Environment+SpecialFolder]::MyDocuments)]]></content>
<!-- Optional: Tab trigger to activate the snippet -->
<tabTrigger>mydocs</tabTrigger>
<!-- Optional: Scope the tab trigger will be active in -->
<scope>source.powershell</scope>
</snippet>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed the file to standardize snippet names

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<snippet>
<content><![CDATA[set-psdebug ${1:-${2:Step}}$0]]></content>
<tabTrigger>sd</tabTrigger>
<scope>source.powershell</scope>
</snippet>
<!-- See http://www.sublimetext.com/docs/snippets for more information -->
<snippet>
<content><![CDATA[set-psdebug ${1:-${2:Step}}$0]]></content>
<tabTrigger>sd</tabTrigger>
<scope>source.powershell</scope>
</snippet>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed the file to standardize snippet names

6 changes: 6 additions & 0 deletions Snippets/(thisdir) path to current script.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!-- See http://www.sublimetext.com/docs/snippets for more information -->
<snippet>
<content><![CDATA[\$Script:thisDir = Split-Path \$MyInvocation.MyCommand.Path -Parent]]></content>
Copy link
Member

Choose a reason for hiding this comment

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

Should it be simple $PSScriptRoot ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here was my comment on the commit:

This was needed for PS 2.0 in order to get the path to the current script, but since 3.0, you can use $PSScriptRoot or $PSCommandPath with scripts and modules. In 2.0, $PSScriptRoot worked for modules but not scripts. Do we want to keep this snippet in here for getting the script path in 2.0, or should we change 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.

I completely agree with @vors. I think we should remove this snippet in favor of using $PSScriptRoot and $PSCommandPath.

<tabTrigger>thisdir</tabTrigger>
<scope>source.powershell</scope>
</snippet>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- See http://www.sublimetext.com/docs/snippets for more information -->
<snippet>
<content><![CDATA[\$tmpfile = [io.path]::GetTempFileName()
<content><![CDATA[\$tmpFile = [IO.Path]::GetTempFileName()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct to standard capitalization

]]></content>
<!-- Optional: Tab trigger to activate the snippet -->
<tabTrigger>tmp</tabTrigger>
Expand Down
1 change: 1 addition & 0 deletions Snippets/(try) try {...}.sublime-snippet
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!-- See http://www.sublimetext.com/docs/snippets for more information -->
<snippet>
<content><![CDATA[try {
$1
Expand Down
7 changes: 0 additions & 7 deletions Snippets/Heredoc single quote for real.sublime-snippet

This file was deleted.

7 changes: 0 additions & 7 deletions Snippets/Heredoc single quote.sublime-snippet

This file was deleted.

5 changes: 0 additions & 5 deletions Snippets/Path to Current Module.sublime-snippet

This file was deleted.