@@ -262,23 +262,29 @@ $properties = @{
262
262
}
263
263
# <- punctuation.section.braces.end
264
264
265
+ function Invoke-Something {}
266
+ # @@@@@@@@@@@@@@@@ definition
267
+
265
268
# Spatting
266
269
Invoke-Something @properties
267
270
# ^^^^^^^^^^^^^^^^ support.function
271
+ # @@@@@@@@@@@@@@@@ reference
268
272
# ^ punctuation.definition.variable
269
273
# ^ variable.other.readwrite
270
274
271
275
# ScriptBlock
272
276
{Invoke-Something @properties }
273
277
# ^ punctuation.section.braces.begin
274
278
# ^^^^^^^^^^^^^^^^ support.function
279
+ # @@@@@@@@@@@@@@@@ reference
275
280
# ^ punctuation.definition.variable
276
281
# ^ variable.other.readwrite
277
282
# ^ punctuation.section.braces.end
278
283
{
279
284
# <- punctuation.section.braces.begin
280
285
Invoke-Something @properties
281
286
# ^^^^^^^^^^^^^^^^ support.function
287
+ # @@@@@@@@@@@@@@@@ reference
282
288
# ^ punctuation.definition.variable
283
289
# ^ variable.other.readwrite
284
290
}
@@ -290,6 +296,7 @@ $sb = {
290
296
# ^ punctuation.section.braces.begin
291
297
Invoke-Something @properties
292
298
# ^^^^^^^^^^^^^^^^ support.function
299
+ # @@@@@@@@@@@@@@@@ reference
293
300
# ^ punctuation.definition.variable
294
301
# ^ variable.other.readwrite
295
302
}
@@ -445,6 +452,7 @@ $a3[1..2]
445
452
# ^^ punctuation.section.interpolation.begin
446
453
# ^^^^^^^^^^^^^^^^ support.function
447
454
# ^ punctuation.section.interpolation.end
455
+ # @@@@@@@@@@@@@@@@ reference
448
456
" This 'string' is nice."
449
457
# ^^^^^^^^^^^^^^^^^^^^^^^^ meta.string string.quoted.double
450
458
@@ -773,54 +781,64 @@ There is no @platting here!
773
781
# ^ punctuation.section.arguments.end
774
782
775
783
# Commands (functions)
776
- Invoke-Something - foobar
777
- # <- support.function
778
- # ^ punctuation.definition.parameter
779
- # ^^^^^^^ variable.parameter.option
780
- Invoke-Something - foobar value
781
- # <- support.function
782
- # ^ punctuation.definition.parameter
783
- # ^^^^^^^ variable.parameter.option
784
- Invoke-Something - foobar:$true
785
- # <- support.function
786
- # ^ punctuation.definition.parameter
787
- # ^^^^^^^ variable.parameter.option
788
- # ^ punctuation.definition.variable
789
- # ^^^^ constant.language
790
- Invoke-Something - foobar: $true
791
- # <- support.function
792
- # ^ punctuation.definition.parameter
793
- # ^^^^^^^ variable.parameter.option
794
- Invoke-Something - p1 v1 - p2 10 - p3 ' value' - switch - verbose
795
- # <- support.function
796
- # ^ punctuation.definition.parameter
797
- # ^^^ variable.parameter.option
798
- # ^ punctuation.definition.parameter
799
- # ^^^ variable.parameter.option
800
- # ^^ meta.number.integer.decimal constant.numeric.value
801
- # ^^^^^^ - keyword
802
- # ^ punctuation.definition.parameter
803
- # ^^^ variable.parameter.option
804
- Invoke-Something (1 .. 20 | Invoke-Something ) - p2 ' value'
805
- # <- support.function
806
- # ^^ keyword.operator.range
807
- Invoke-Something - p1 v2 - p2 30 | Invoke-Something - switch
808
- # <- support.function
809
- # ^ punctuation.definition.parameter
810
- # ^^^ variable.parameter.option
811
- # ^ punctuation.definition.parameter
812
- # ^^^ variable.parameter.option
813
- # ^^ meta.number.integer.decimal constant.numeric.value
814
- # ^ keyword.operator.logical.pipe
815
- # ^ support.function
816
- # ^ punctuation.definition.parameter
817
- # ^^^^^^^ variable.parameter.option - keyword
784
+ Invoke-Something - foobar
785
+ # ^ support.function
786
+ # ^ punctuation.definition.parameter
787
+ # ^^^^^^^ variable.parameter.option
788
+ # @@@@@@@@@@@@@@@@ reference
789
+ Invoke-Something - foobar value
790
+ # ^ support.function
791
+ # ^ punctuation.definition.parameter
792
+ # ^^^^^^^ variable.parameter.option
793
+ # @@@@@@@@@@@@@@@@ reference
794
+ Invoke-Something - foobar:$true
795
+ # ^ support.function
796
+ # @@@@@@@@@@@@@@@@ reference
797
+ # ^ punctuation.definition.parameter
798
+ # ^^^^^^^ variable.parameter.option
799
+ # ^ punctuation.definition.variable
800
+ # ^^^^ constant.language
801
+ Invoke-Something - foobar: $true
802
+ # ^ support.function
803
+ # @@@@@@@@@@@@@@@@ reference
804
+ # ^ punctuation.definition.parameter
805
+ # ^^^^^^^ variable.parameter.option
806
+ Invoke-Something - p1 v1 - p2 10 - p3 ' value' - switch - verbose
807
+ # ^ support.function
808
+ # @@@@@@@@@@@@@@@@ reference
809
+ # ^ punctuation.definition.parameter
810
+ # ^^^ variable.parameter.option
811
+ # ^ punctuation.definition.parameter
812
+ # ^^^ variable.parameter.option
813
+ # ^^ meta.number.integer.decimal constant.numeric.value
814
+ # ^^^^^^ - keyword
815
+ # ^ punctuation.definition.parameter
816
+ # ^^^ variable.parameter.option
817
+ Invoke-Something (1 .. 20 | Invoke-Something ) - p2 ' value'
818
+ # ^ support.function
819
+ # @@@@@@@@@@@@@@@@ reference
820
+ # @@@@@@@@@@@@@@@@ reference
821
+ # ^^ keyword.operator.range
822
+ Invoke-Something - p1 v2 - p2 30 | Invoke-Something - switch
823
+ # ^ support.function
824
+ # @@@@@@@@@@@@@@@@ reference
825
+ # @@@@@@@@@@@@@@@@ reference
826
+ # ^ punctuation.definition.parameter
827
+ # ^^^ variable.parameter.option
828
+ # ^ punctuation.definition.parameter
829
+ # ^^^ variable.parameter.option
830
+ # ^^ meta.number.integer.decimal constant.numeric.value
831
+ # ^ keyword.operator.logical.pipe
832
+ # ^ support.function
833
+ # ^ punctuation.definition.parameter
834
+ # ^^^^^^^ variable.parameter.option - keyword
818
835
Invoke-Something - p1 {
819
836
# <- support.function
820
837
# ^ punctuation.definition.parameter
821
838
# ^^^ variable.parameter.option
822
839
Invoke-Something - foobar:$true
823
840
# ^ support.function
841
+ # @@@@@@@@@@@@@@@@ reference
824
842
# ^ punctuation.definition.parameter
825
843
# ^^^^^^^ variable.parameter.option
826
844
# ^ punctuation.definition.variable
@@ -829,11 +847,13 @@ Invoke-Something -p1 {
829
847
# <- punctuation.section.braces.end
830
848
# ^ keyword.operator.logical.pipe
831
849
# ^ support.function
832
- Invoke-Something - p1 value `
833
- # <- support.function
834
- # ^ punctuation.definition.parameter
835
- # ^^^ variable.parameter.option
836
- # ^ punctuation.separator.continuation
850
+ # @@@@@@@@@@@@@@@@ reference
851
+ Invoke-Something - p1 value `
852
+ # ^ support.function
853
+ # @@@@@@@@@@@@@@@@ reference
854
+ # ^ punctuation.definition.parameter
855
+ # ^^^ variable.parameter.option
856
+ # ^ punctuation.separator.continuation
837
857
- p2 14.4 `
838
858
# ^ punctuation.definition.parameter
839
859
# ^^^ variable.parameter.option
@@ -842,6 +862,7 @@ Invoke-Something -p1 value `
842
862
- p3 $value | Invoke-Something - verbose
843
863
# ^ punctuation.definition.parameter
844
864
# ^^^ variable.parameter.option
865
+ # @@@@@@@@@@@@@@@@ reference
845
866
# ^ punctuation.definition.parameter
846
867
# ^^^^^^^^ variable.parameter.option
847
868
# ^ punctuation.definition.variable
@@ -1523,19 +1544,29 @@ $b -cLike $c
1523
1544
# ^ string.quoted.single
1524
1545
# ^ keyword.operator.string-format
1525
1546
1547
+ function Test-Function {}
1548
+ # @@@@@@@@@@@@@ definition
1549
+ function New-Object {}
1550
+ # @@@@@@@@@@ definition
1526
1551
# Misc test cases
1527
- Test-Function - Class ClassName
1528
- # ^^^^^ - storage.type
1529
- New-Object - TypeName System.Diagnostics.Process
1530
- # ^^^^^^^ - keyword.control
1531
- New-Object - TypeName System.Data
1532
- # ^^^^ - keyword.control
1533
- New-Object - TypeName Sy- stem.if
1534
- # ^^ - keyword.control
1535
- New-Object - TypeName S_ystem.Clean
1536
- # ^^^^^ - keyword.control
1537
- New-Object - TypeName Sy_stem- .Throw
1552
+ Test-Function - Class ClassName
1553
+ # ^^^^^ - storage.type
1554
+ # @@@@@@@@@@@@@ reference
1555
+ New-Object - TypeName System.Diagnostics.Process
1556
+ # ^^^^^^^ - keyword.control
1557
+ # @@@@@@@@@@ reference
1558
+ New-Object - TypeName System.Data
1559
+ # ^^^^ - keyword.control
1560
+ # @@@@@@@@@@ reference
1561
+ New-Object - TypeName Sy- stem.if
1562
+ # ^^ - keyword.control
1563
+ # @@@@@@@@@@ reference
1564
+ New-Object - TypeName S_ystem.Clean
1538
1565
# ^^^^^ - keyword.control
1566
+ # @@@@@@@@@@ reference
1567
+ New-Object - TypeName Sy_stem- .Throw
1568
+ # ^^^^^ - keyword.control
1569
+ # @@@@@@@@@@ reference
1539
1570
echo `" test`"
1540
1571
# ^^^^^^^^^ - string.quoted
1541
1572
# ^^ constant.character.escape
@@ -1560,16 +1591,22 @@ echo `"test`"
1560
1591
# ^ meta.group.array-expression
1561
1592
# ^ keyword.control
1562
1593
# ^ meta.block
1594
+ function join-path {}
1595
+ # @@@@@@@@@ definition
1563
1596
$file = join-path $env: SystemDrive " $ ( [System.io.path ]::GetRandomFileName()) .ps1"
1564
1597
# <- punctuation.definition.variable
1598
+ # @@@@@@@@@ reference
1565
1599
# ^ support.function
1566
1600
# ^ support.variable.drive
1567
1601
# ^ variable.other.readwrite
1568
1602
# ^^ meta.string meta.interpolation punctuation.section.interpolation.begin
1569
1603
# ^ storage.type
1570
1604
# @@@@@@@@@@@@@@@@@ reference
1605
+ function out-file {}
1606
+ # @@@@@@@@ definition
1571
1607
$ScriptBlock | Out-File $file - Force
1572
1608
# <- punctuation.definition.variable
1609
+ # @@@@@@@@ reference
1573
1610
# ^ keyword.operator.logical.pipe
1574
1611
# ^ punctuation.definition.variable
1575
1612
# ^ punctuation.definition.parameter
@@ -1589,15 +1626,21 @@ Workflow work { sequence {} }
1589
1626
# ^ punctuation.section.braces.begin
1590
1627
# ^ punctuation.section.braces.end
1591
1628
# ^ punctuation.section.braces.end
1592
- get-thing | Out-WithYou > $null # destroy
1593
- # ^^^^^^^ support.function
1594
- # ^^^^^^^^^^^ support.function
1595
- # ^ keyword.operator.logical.pipe
1596
- # ^ keyword.operator.redirection
1597
- # ^ punctuation.definition.variable
1598
- # ^ constant.language
1599
- # ^ punctuation.definition.comment
1600
- # ^^^^^^^^^ comment.line
1629
+ function get-something {}
1630
+ # @@@@@@@@@@@@@ definition
1631
+ function Out-WithYou {}
1632
+ # @@@@@@@@@@@ definition
1633
+ get-thing | Out-WithYou > $null # destroy
1634
+ # ^^^^^^^^^ support.function
1635
+ # @@@@@@@@@ reference
1636
+ # ^^^^^^^^^^^ support.function
1637
+ # @@@@@@@@@@@ reference
1638
+ # ^ keyword.operator.logical.pipe
1639
+ # ^ keyword.operator.redirection
1640
+ # ^ punctuation.definition.variable
1641
+ # ^ constant.language
1642
+ # ^ punctuation.definition.comment
1643
+ # ^^^^^^^^^ comment.line
1601
1644
" Escaped chars: `" , `n , `$ , `b , `t , `e , `u{10ffff} , `" "
1602
1645
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.quoted.double
1603
1646
# ^^ constant.character.escape
@@ -1611,8 +1654,12 @@ get-thing | Out-WithYou > $null # destroy
1611
1654
' But here they'' re not escape chars: `", `n, `$, `b, `"'
1612
1655
# ^^ constant.character.escape
1613
1656
# ^^^^^^^^^^^^^^^^^^^ - constant
1657
+ function get-number {}
1658
+ # @@@@@@@@@@ definition
1614
1659
" When you call a method: $ ( get-number | % { invoke-command $ ( [string ]::format(" Like (this{0})" , " what?" ) ) $var } ) "
1615
1660
# ^^ punctuation.section.interpolation.begin - source.powershell.embedded
1661
+ # @@@@@@@@@@ reference
1662
+ # @@@@@@@@@@@@@@ reference
1616
1663
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.powershell.embedded
1617
1664
# ^ keyword.operator.logical.pipe
1618
1665
# ^ meta.group.complex.subexpression punctuation.section.group.begin
0 commit comments