Skip to content

Commit d83caa6

Browse files
committed
Tinker with support files
1 parent 1aca5da commit d83caa6

7 files changed

+33
-30
lines changed

CONTRIBUTING.md

+11-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Contributing
22

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

66

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

1818
This file must contain the following information:
1919

20-
{
21-
"pathToSublimeText": "...\sublime_text.exe",
22-
"pathToSublimeTextData": "...\
23-
}
20+
``` json
21+
{
22+
"pathToSublimeText": "...\\sublime_text.exe",
23+
"pathToSublimeTextData": "...\\"
24+
}
25+
```
2426

2527

2628
#### Using Sublime Text
2729

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

3133

3234
#### Using the Command Line
3335

3436
From the project's root:
3537

36-
.\bin\BuildFolder.ps1 -verbose
37-
38+
``` pwsh
39+
.\bin\BuildFolder.ps1 -verbose
40+
```
3841

3942
#### Running Tests
4043

PowerShell.sublime-project

+2-9
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,7 @@
33
[
44
{
55
"follow_symlinks": true,
6-
"path": "."
7-
}
6+
"path": ".",
7+
},
88
],
9-
10-
"build_systems": [
11-
{
12-
"name": "PowerShell: Build Dev Version",
13-
"shell_cmd": "powershell.exe -noninteractive -file $project_path/bin/BuildFolder.ps1"
14-
}
15-
]
169
}

PowerShell.sublime-syntax

+5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ file_extensions:
99
- psm1
1010
- psd1
1111

12+
first_line_match: |
13+
(?x)
14+
^\#!.*\b(?:pwsh|powershell)\b
15+
| ^\# \s* -\*- [^*]* mode: \s* powershell [^*]* -\*-
16+
1217
variables:
1318
dec_digits: (?:[\d_]*\d)
1419
dec_exponent: (?:[eE][-+]?{{dec_digits}})

README.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Adds support for the MS PowerShell programming language.
99
1. Install [package control][package_control] for Sublime Text.
1010
1. Install the **PowerShell** package:
1111

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

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

2121
### EditorSyntax
2222

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

2625
[package_control]: https://sublime.wbond.net/installation
2726
[EditorSyntax]: https://github.com/PowerShell/EditorSyntax

Snippets/Powershell.sublime-completions

+8-8
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
"scope": "source.powershell",
33

44
"completions": [
5-
{ "trigger": "dict", "contents": "@{$1$0}" },
6-
{ "trigger": "arr", "contents": "@($0)" },
7-
{ "trigger": "req", "contents": "#requires -$0" },
8-
{ "trigger": "reqp", "contents": "#requires -pssnapin $0" },
9-
{ "trigger": "reqv", "contents": "#requires -version ${0:2}" },
5+
{ "trigger": "dict\thashtable", "contents": "@{$1$0}" },
6+
{ "trigger": "arr\tarray", "contents": "@($0)" },
7+
{ "trigger": "req\trequires", "contents": "#requires -$0" },
8+
{ "trigger": "reqp\trequires", "contents": "#requires -pssnapin $0" },
9+
{ "trigger": "reqv\trequires", "contents": "#requires -version ${0:2}" },
1010
{ "trigger": "void", "contents": "[void] ($1)$0" },
1111
{ "trigger": "sb", "contents": "\\${$1}$0" },
12-
{ "trigger": "wd", "contents": "write-debug -message \"$1\"$0" },
13-
{ "trigger": "wh", "contents": "write-host \"$1\"" },
14-
{ "trigger": "ww", "contents": "write-warning $0" },
12+
{ "trigger": "wd\twrite-debug", "contents": "write-debug -message \"$1\"$0" },
13+
{ "trigger": "wh\twrite-host", "contents": "write-host \"$1\"" },
14+
{ "trigger": "ww\twrite-warning", "contents": "write-warning $0" },
1515
{ "trigger": "param", "contents": "param(\\$${1:paramName})" }
1616
]
1717
}

Support/PowerShell.sublime-settings

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
{
22
"word_wrap": false,
3-
"translate_tabs_to_spaces": true
4-
}
3+
"translate_tabs_to_spaces": true,
4+
// Skip `-` in word separators
5+
"word_separators": "./\\()\"':,.;<>~!@#$%^&*|+=[]{}`~?",
6+
}

Tests/syntax_test_PowerShell.ps1

+1
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,7 @@ Invoke-Something -p1 v1 -p2 10 -p3 'value' -switch -verbose
618618
# ^^^ variable.parameter.option
619619
Invoke-Something (1..20 | Invoke-Something) -p2 'value'
620620
# <- support.function
621+
# ^^ keyword.operator.range
621622
Invoke-Something -p1 v2 -p2 30 | Invoke-Something -switch
622623
# <- support.function
623624
# ^ punctuation.definition.parameter

0 commit comments

Comments
 (0)