Skip to content

Commit 8b530af

Browse files
committed
Syntax test references
1 parent 562711f commit 8b530af

5 files changed

+35
-25
lines changed

PowerShell.sublime-syntax

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# http://www.sublimetext.com/docs/3/syntax.html
44
name: PowerShell
55
scope: source.powershell
6+
version: 2
67

78
file_extensions:
89
- ps1

Support/Symbol List Classes.tmPreferences

Lines changed: 0 additions & 17 deletions
This file was deleted.

Tests/syntax_test_Class.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ using namespace system.management.automation
77
# Define a class
88
class TypeName
99
# <- storage.type
10-
# ^ entity.name.class
10+
# ^^^^^^^^ entity.name.class
11+
# @@@@@@@@ definition
1112
{
1213
# Property with validate set
1314
# <- punctuation.definition.comment

Tests/syntax_test_Function.ps1

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,10 @@ using module Microsoft.Management
5353
#>
5454
# <- punctuation.definition.comment.block.end
5555
function Verb-Noun {
56-
# <- meta.function storage.type
57-
# ^ meta.function entity.name.function
56+
#^^^^^^^^^^^^^^^^^ meta.function
57+
#^^^^^^^ storage.type
58+
# ^^^^^^^^^ entity.name.function
59+
# @@@@@@@@@ definition
5860
[CmdletBinding(DefaultParameterSetName = 'Parameter Set 1',
5961
# <- meta.attribute punctuation.section.brackets.begin
6062
# ^ meta.attribute support.function.attribute
@@ -381,6 +383,7 @@ function Verb-Noun {
381383
# ^ punctuation.definition.variable
382384
# ^^^^^^^^ variable.language
383385
# ^^^^^^^^^^^^^ variable.function
386+
# @@@@@@@@@@@@@ reference
384387
# ^ punctuation.section.arguments.begin
385388
# ^^^^^^^^ string.quoted.double
386389
# ^ punctuation.separator

Tests/syntax_test_PowerShell.ps1

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ $variable.Name.Method( )
155155
# ^^^^ variable.other.member
156156
# ^ punctuation.accessor.dot
157157
# ^^^^^^ meta.function-call variable.function
158+
# @@@@@@ reference
158159
# ^^^ meta.function-call.arguments
159160
# ^^^^^^^^^^^^^^^ - variable.other.readwrite
160161
# ^ - meta.function-call
@@ -606,6 +607,7 @@ There is no @platting here!
606607
# ^ punctuation.section.brackets.end
607608
# ^^ punctuation.accessor.double-colon
608609
# ^^^^^ meta.function-call variable.function
610+
# @@@@@ reference
609611
# ^^^^^^^^^^^^^^ meta.function-call.arguments
610612
# ^ punctuation.section.arguments.begin
611613
# ^ punctuation.section.arguments.end
@@ -828,46 +830,55 @@ switch ('this') {
828830
functioN MyFunction{}
829831
# <- storage.type
830832
# ^^^^^^^^^^ entity.name.function
833+
# @@@@@@@@@@ definition
831834
# ^ punctuation.section.braces.begin
832835
# ^ punctuation.section.braces.end
833836
function My-Function {}
834837
# <- storage.type
835838
# ^^^^^^^^^^^ entity.name.function
839+
# @@@@@@@@@@@ definition
836840
# ^ punctuation.section.braces.begin
837841
# ^ punctuation.section.braces.end
838842
Function My.Function{}
839843
# <- storage.type
840844
# ^^^^^^^^^^^ entity.name.function
845+
# @@@@@@@@@@@ definition
841846
# ^ punctuation.section.braces.begin
842847
# ^ punctuation.section.braces.end
843848
function My-Function.Other{}
844849
# <- storage.type
845850
# ^^^^^^^^^^^^^^^^^ entity.name.function
851+
# @@@@@@@@@@@@@@@@@ definition
846852
# ^ punctuation.section.braces.begin
847853
# ^ punctuation.section.braces.end
848854
function Some.other.function{}
849855
# <- storage.type
850856
# ^^^^^^^^^^^^^^^^^^^ entity.name.function
857+
# @@@@@@@@@@@@@@@@@@@ definition
851858
# ^ punctuation.section.braces.begin
852859
# ^ punctuation.section.braces.end
853860
FUNCTION MyFunction2 {}
854861
# <- storage.type
855862
# ^^^^^^^^^^^ entity.name.function
863+
# @@@@@@@@@@ definition
856864
# ^ punctuation.section.braces.begin
857865
# ^ punctuation.section.braces.end
858866
function New-File { }
859867
# <- storage.type
860868
# ^^^^^^^^ entity.name.function
869+
# @@@@@@@@ definition
861870
# ^ punctuation.section.braces.begin
862871
# ^ punctuation.section.braces.end
863872
function New-File ($Name) { }
864873
# <- storage.type
865874
# ^^^^^^^^ entity.name.function
875+
# @@@@@@@@ definition
866876
# ^ punctuation.section.braces.begin
867877
# ^ punctuation.section.braces.end
868878
function NewFile($Name) { }
869879
# <- storage.type
870880
# ^^^^^^^ entity.name.function
881+
# @@@@@@@ definition
871882
# ^ punctuation.section.group.begin
872883
# ^ punctuation.definition.variable
873884
# ^ variable.other.readwrite
@@ -877,6 +888,7 @@ function NewFile($Name) { }
877888
filter myfilter($param) {}
878889
# <- storage.type
879890
# ^^^^^^^^ entity.name.function
891+
# @@@@@@@@ definition
880892
# ^ punctuation.section.group.begin
881893
# ^ punctuation.definition.variable
882894
# ^ variable.other.readwrite
@@ -886,6 +898,7 @@ filter myfilter($param) {}
886898
Filter my-Filter ($param){}
887899
# <- storage.type
888900
# ^^^^^^^^^ entity.name.function
901+
# @@@@@@@@@ definition
889902
# ^ punctuation.section.group.begin
890903
# ^ punctuation.definition.variable
891904
# ^ variable.other.readwrite
@@ -897,6 +910,7 @@ Filter my-Filter ($param){}
897910
function Test-Drive([string]$roman) {
898911
# <- storage.type
899912
# ^^^^^^^^^^ entity.name.function
913+
# @@@@@@@@@@ definition
900914
# ^ punctuation.section.group.begin
901915
# ^ punctuation.section.brackets.begin
902916
# ^^^^^^ storage.type
@@ -915,8 +929,10 @@ function Test-Drive([string]$roman) {
915929
# <- punctuation.section.braces.end
916930

917931
function Verb-Noun
918-
# <- meta.function storage.type
919-
# ^ meta.function entity.name.function
932+
#^^^^^^^^^^^^^^^^^ meta.function
933+
#^^^^^^^ storage.type
934+
# ^^^^^^^^^ meta.function entity.name.function
935+
# @@@@@@@@@ definition
920936
{
921937
# <- punctuation.section.braces.begin
922938

@@ -1042,6 +1058,7 @@ function Verb-Noun
10421058
class Vehicle {
10431059
# <- storage.type.class
10441060
# ^^^^^^^ entity.name.class
1061+
# @@@@@@@ definition
10451062
# ^ punctuation.section.braces.begin
10461063
Vehicle() {}
10471064
# ^ punctuation.section.group.begin
@@ -1109,7 +1126,8 @@ catch { }
11091126
# Reserved words
11101127
Configuration Crazyness {
11111128
# <- storage.type
1112-
# ^ entity.name.function
1129+
# ^^^^^^^^^ entity.name.function
1130+
# @@@@@@@@@ definition
11131131
# ^ punctuation.section.braces.begin
11141132
Node Whatever {
11151133
# ^ punctuation.section.braces.begin
@@ -1360,6 +1378,7 @@ $file = join-path $env:SystemDrive "$([System.io.path]::GetRandomFileName()).ps1
13601378
# ^ variable.other.readwrite
13611379
# ^ string.quoted.double punctuation.definition.variable
13621380
# ^ storage.type
1381+
# @@@@@@@@@@@@@@@@@ reference
13631382
$ScriptBlock | Out-File $file -Force
13641383
# <- punctuation.definition.variable
13651384
# ^ keyword.operator.logical.pipe
@@ -1368,12 +1387,14 @@ $ScriptBlock | Out-File $file -Force
13681387
# ^^^^^^ variable.parameter.option
13691388
workflow w1 {}
13701389
# <- storage.type
1371-
# ^ entity.name.function
1390+
# ^^ entity.name.function
1391+
# @@ definition
13721392
# ^ punctuation.section.braces.begin
13731393
# ^ punctuation.section.braces.end
13741394
Workflow work { sequence {} }
13751395
# <- storage.type
1376-
# ^ entity.name.function
1396+
# ^^^^ entity.name.function
1397+
# @@@@ definition
13771398
# ^ punctuation.section.braces.begin
13781399
# ^^^^^^^^ keyword.control
13791400
# ^ punctuation.section.braces.begin
@@ -1408,6 +1429,7 @@ get-thing | Out-WithYou > $null # destroy
14081429
# ^^^^^^ storage.type
14091430
# ^^ punctuation.accessor.double-colon
14101431
# ^^^^^^ meta.function-call variable.function
1432+
# @@@@@@ reference
14111433
# ^ meta.group.complex.subexpression punctuation.section.arguments.begin
14121434
# ^ meta.group.complex.subexpression punctuation.section.arguments.end
14131435
# ^ meta.group.complex.subexpression punctuation.section.group.end

0 commit comments

Comments
 (0)