Skip to content

Commit

Permalink
Tinker with support files
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Lyons committed Feb 1, 2020
1 parent 35dc7c4 commit 1e1672e
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 30 deletions.
19 changes: 11 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Contributing

Thanks for taking an insterest in contributing to the PowerShell package for
Thanks for taking an interest in contributing to the PowerShell package for
Sublime Text 3!


Expand All @@ -17,24 +17,27 @@ To build development versions, first you need a configuration file in

This file must contain the following information:

{
"pathToSublimeText": "...\sublime_text.exe",
"pathToSublimeTextData": "...\
}
``` json
{
"pathToSublimeText": "...\\sublime_text.exe",
"pathToSublimeTextData": "...\\"
}
```


#### Using Sublime Text

1. Press <kbd>Ctrl+Shift+B</kbd> to open the build systems menu.
1. Press <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>B</kbd> to open the build systems menu.
2. Select 'PowerShell: Build Dev Version'


#### Using the Command Line

From the project's root:

.\bin\BuildFolder.ps1 -verbose

``` pwsh
.\bin\BuildFolder.ps1 -verbose
```

#### Running Tests

Expand Down
11 changes: 2 additions & 9 deletions PowerShell.sublime-project
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,7 @@
[
{
"follow_symlinks": true,
"path": "."
}
"path": ".",
},
],

"build_systems": [
{
"name": "PowerShell: Build Dev Version",
"shell_cmd": "powershell.exe -noninteractive -file $project_path/bin/BuildFolder.ps1"
}
]
}
5 changes: 5 additions & 0 deletions PowerShell.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ file_extensions:
- psm1
- psd1

first_line_match: |
(?x)
^\#!.*\b(?:pwsh|powershell)\b
| ^\# \s* -\*- [^*]* mode: \s* powershell [^*]* -\*-
variables:
dec_digits: (?:[\d_]*\d)
dec_exponent: (?:[eE][-+]?{{dec_digits}})
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Adds support for the MS PowerShell programming language.
1. Install [package control][package_control] for Sublime Text.
1. Install the **PowerShell** package:

1. Press <kbd>Ctrl + Shift + P</kbd> (<kbd>Cmd + Shift + P</kbd> on Mac)
1. Press <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd> (<kbd>Cmd</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd> on Mac)
1. Select 'Install Package'
1. Select 'PowerShell'

Expand All @@ -20,8 +20,7 @@ You want to contribute? Awesome! Take a look at [CONTRIBUTING.md](CONTRIBUTING.m

### EditorSyntax

Syntax highlighting is provided by the project [EditorSyntax][].
Issues about the grammar should be opened in **EditorSyntax** instead of this repo.
Syntax highlighting is adapted from the [EditorSyntax][] project.

[package_control]: https://sublime.wbond.net/installation
[EditorSyntax]: https://github.com/PowerShell/EditorSyntax
16 changes: 8 additions & 8 deletions Snippets/Powershell.sublime-completions
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
"scope": "source.powershell",

"completions": [
{ "trigger": "dict", "contents": "@{$1$0}" },
{ "trigger": "arr", "contents": "@($0)" },
{ "trigger": "req", "contents": "#requires -$0" },
{ "trigger": "reqp", "contents": "#requires -pssnapin $0" },
{ "trigger": "reqv", "contents": "#requires -version ${0:2}" },
{ "trigger": "dict\thashtable", "contents": "@{$1$0}" },
{ "trigger": "arr\tarray", "contents": "@($0)" },
{ "trigger": "req\trequires", "contents": "#requires -$0" },
{ "trigger": "reqp\trequires", "contents": "#requires -pssnapin $0" },
{ "trigger": "reqv\trequires", "contents": "#requires -version ${0:2}" },
{ "trigger": "void", "contents": "[void] ($1)$0" },
{ "trigger": "sb", "contents": "\\${$1}$0" },
{ "trigger": "wd", "contents": "write-debug -message \"$1\"$0" },
{ "trigger": "wh", "contents": "write-host \"$1\"" },
{ "trigger": "ww", "contents": "write-warning $0" },
{ "trigger": "wd\twrite-debug", "contents": "write-debug -message \"$1\"$0" },
{ "trigger": "wh\twrite-host", "contents": "write-host \"$1\"" },
{ "trigger": "ww\twrite-warning", "contents": "write-warning $0" },
{ "trigger": "param", "contents": "param(\\$${1:paramName})" }
]
}
6 changes: 4 additions & 2 deletions Support/PowerShell.sublime-settings
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"word_wrap": false,
"translate_tabs_to_spaces": true
}
"translate_tabs_to_spaces": true,
// Skip `-` in word separators
"word_separators": "./\\()\"':,.;<>~!@#$%^&*|+=[]{}`~?",
}
1 change: 1 addition & 0 deletions Tests/syntax_test_PowerShell.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,7 @@ Invoke-Something -p1 v1 -p2 10 -p3 'value' -switch -verbose
# ^^^ variable.parameter.option
Invoke-Something (1..20 | Invoke-Something) -p2 'value'
# <- support.function
# ^^ keyword.operator.range
Invoke-Something -p1 v2 -p2 30 | Invoke-Something -switch
# <- support.function
# ^ punctuation.definition.parameter
Expand Down

0 comments on commit 1e1672e

Please sign in to comment.