@@ -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,65 @@ 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
818
- Invoke-Something - p1 {
819
- # <- support.function
820
- # ^ punctuation.definition.parameter
821
- # ^^^ variable.parameter.option
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
835
+ Invoke-Something - p1 {
836
+ # ^ support.function
837
+ # @@@@@@@@@@@@@@@@ reference
838
+ # ^ punctuation.definition.parameter
839
+ # ^^^ variable.parameter.option
822
840
Invoke-Something - foobar:$true
823
841
# ^ support.function
842
+ # @@@@@@@@@@@@@@@@ reference
824
843
# ^ punctuation.definition.parameter
825
844
# ^^^^^^^ variable.parameter.option
826
845
# ^ punctuation.definition.variable
@@ -829,11 +848,13 @@ Invoke-Something -p1 {
829
848
# <- punctuation.section.braces.end
830
849
# ^ keyword.operator.logical.pipe
831
850
# ^ support.function
832
- Invoke-Something - p1 value `
833
- # <- support.function
834
- # ^ punctuation.definition.parameter
835
- # ^^^ variable.parameter.option
836
- # ^ punctuation.separator.continuation
851
+ # @@@@@@@@@@@@@@@@ reference
852
+ Invoke-Something - p1 value `
853
+ # ^ support.function
854
+ # @@@@@@@@@@@@@@@@ reference
855
+ # ^ punctuation.definition.parameter
856
+ # ^^^ variable.parameter.option
857
+ # ^ punctuation.separator.continuation
837
858
- p2 14.4 `
838
859
# ^ punctuation.definition.parameter
839
860
# ^^^ variable.parameter.option
@@ -842,6 +863,7 @@ Invoke-Something -p1 value `
842
863
- p3 $value | Invoke-Something - verbose
843
864
# ^ punctuation.definition.parameter
844
865
# ^^^ variable.parameter.option
866
+ # @@@@@@@@@@@@@@@@ reference
845
867
# ^ punctuation.definition.parameter
846
868
# ^^^^^^^^ variable.parameter.option
847
869
# ^ punctuation.definition.variable
@@ -1523,19 +1545,29 @@ $b -cLike $c
1523
1545
# ^ string.quoted.single
1524
1546
# ^ keyword.operator.string-format
1525
1547
1548
+ function Test-Function {}
1549
+ # @@@@@@@@@@@@@ definition
1550
+ function New-Object {}
1551
+ # @@@@@@@@@@ definition
1526
1552
# 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
1553
+ Test-Function - Class ClassName
1554
+ # ^^^^^ - storage.type
1555
+ # @@@@@@@@@@@@@ reference
1556
+ New-Object - TypeName System.Diagnostics.Process
1557
+ # ^^^^^^^ - keyword.control
1558
+ # @@@@@@@@@@ reference
1559
+ New-Object - TypeName System.Data
1560
+ # ^^^^ - keyword.control
1561
+ # @@@@@@@@@@ reference
1562
+ New-Object - TypeName Sy- stem.if
1563
+ # ^^ - keyword.control
1564
+ # @@@@@@@@@@ reference
1565
+ New-Object - TypeName S_ystem.Clean
1538
1566
# ^^^^^ - keyword.control
1567
+ # @@@@@@@@@@ reference
1568
+ New-Object - TypeName Sy_stem- .Throw
1569
+ # ^^^^^ - keyword.control
1570
+ # @@@@@@@@@@ reference
1539
1571
echo `" test`"
1540
1572
# ^^^^^^^^^ - string.quoted
1541
1573
# ^^ constant.character.escape
@@ -1560,16 +1592,22 @@ echo `"test`"
1560
1592
# ^ meta.group.array-expression
1561
1593
# ^ keyword.control
1562
1594
# ^ meta.block
1595
+ function join-path {}
1596
+ # @@@@@@@@@ definition
1563
1597
$file = join-path $env: SystemDrive " $ ( [System.io.path ]::GetRandomFileName()) .ps1"
1564
1598
# <- punctuation.definition.variable
1599
+ # @@@@@@@@@ reference
1565
1600
# ^ support.function
1566
1601
# ^ support.variable.drive
1567
1602
# ^ variable.other.readwrite
1568
1603
# ^^ meta.string meta.interpolation punctuation.section.interpolation.begin
1569
1604
# ^ storage.type
1570
1605
# @@@@@@@@@@@@@@@@@ reference
1606
+ function out-file {}
1607
+ # @@@@@@@@ definition
1571
1608
$ScriptBlock | Out-File $file - Force
1572
1609
# <- punctuation.definition.variable
1610
+ # @@@@@@@@ reference
1573
1611
# ^ keyword.operator.logical.pipe
1574
1612
# ^ punctuation.definition.variable
1575
1613
# ^ punctuation.definition.parameter
@@ -1589,15 +1627,21 @@ Workflow work { sequence {} }
1589
1627
# ^ punctuation.section.braces.begin
1590
1628
# ^ punctuation.section.braces.end
1591
1629
# ^ 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
1630
+ function get-something {}
1631
+ # @@@@@@@@@@@@@ definition
1632
+ function Out-WithYou {}
1633
+ # @@@@@@@@@@@ definition
1634
+ get-thing | Out-WithYou > $null # destroy
1635
+ # ^^^^^^^^^ support.function
1636
+ # @@@@@@@@@ reference
1637
+ # ^^^^^^^^^^^ support.function
1638
+ # @@@@@@@@@@@ reference
1639
+ # ^ keyword.operator.logical.pipe
1640
+ # ^ keyword.operator.redirection
1641
+ # ^ punctuation.definition.variable
1642
+ # ^ constant.language
1643
+ # ^ punctuation.definition.comment
1644
+ # ^^^^^^^^^ comment.line
1601
1645
" Escaped chars: `" , `n , `$ , `b , `t , `e , `u{10ffff} , `" "
1602
1646
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.quoted.double
1603
1647
# ^^ constant.character.escape
@@ -1611,8 +1655,12 @@ get-thing | Out-WithYou > $null # destroy
1611
1655
' But here they'' re not escape chars: `", `n, `$, `b, `"'
1612
1656
# ^^ constant.character.escape
1613
1657
# ^^^^^^^^^^^^^^^^^^^ - constant
1658
+ function get-number {}
1659
+ # @@@@@@@@@@ definition
1614
1660
" When you call a method: $ ( get-number | % { invoke-command $ ( [string ]::format(" Like (this{0})" , " what?" ) ) $var } ) "
1615
1661
# ^^ punctuation.section.interpolation.begin - source.powershell.embedded
1662
+ # @@@@@@@@@@ reference
1663
+ # @@@@@@@@@@@@@@ reference
1616
1664
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.powershell.embedded
1617
1665
# ^ keyword.operator.logical.pipe
1618
1666
# ^ meta.group.complex.subexpression punctuation.section.group.begin
0 commit comments