Skip to content

Commit b915a7c

Browse files
committed
Fix CLI args with assignment
1 parent aec86c0 commit b915a7c

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

PowerShell.sublime-syntax

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -403,10 +403,12 @@ contexts:
403403

404404
cli-parameters:
405405
# Flags/Options/Parameters
406-
- match: \B(--?|[/+])\p{L}(?:[\w-]*\w)?
407-
scope: variable.parameter.option.powershell
406+
- match: \B((--?|[/+])\p{L}(?:[\w-]*\w)?)([=:])?
407+
scope:
408408
captures:
409-
1: punctuation.definition.parameter.powershell
409+
1: variable.parameter.option.powershell
410+
2: punctuation.definition.parameter.powershell
411+
3: keyword.operator.assignment.powershell
410412

411413
###[ DIRECTIVES ]##############################################################
412414

Tests/syntax_test_PowerShell.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@ $a3[1..2]
840840
# ^^^^^^^^^^^^^^ meta.function-call.arguments.powershell
841841
# ^^^^^^^ variable.parameter.option.powershell
842842
# ^ punctuation.definition.parameter.powershell
843-
# ^ keyword.operator.ternary.powershell
843+
# ^ keyword.operator.assignment.powershell
844844
# ^^^^^ constant.language.boolean.true.powershell
845845
# ^ punctuation.definition.variable.powershell
846846
Invoke-Something -foobar: $true
@@ -849,7 +849,7 @@ $a3[1..2]
849849
# ^^^^^^^^^^^^^^^ meta.function-call.arguments.powershell
850850
# ^^^^^^^ variable.parameter.option.powershell
851851
# ^ punctuation.definition.parameter.powershell
852-
# ^ keyword.operator.ternary.powershell
852+
# ^ keyword.operator.assignment.powershell
853853
# ^^^^^ constant.language.boolean.true.powershell
854854
# ^ punctuation.definition.variable.powershell
855855
Invoke-Something -p1 v1 -p2 10 -p3 'value' -switch -verbose
@@ -919,7 +919,7 @@ $a3[1..2]
919919
# ^^^^^^^^^^^^^^ meta.function-call.arguments.powershell
920920
# ^^^^^^^ variable.parameter.option.powershell
921921
# ^ punctuation.definition.parameter.powershell
922-
# ^ keyword.operator.ternary.powershell
922+
# ^ keyword.operator.assignment.powershell
923923
# ^^^^^ constant.language.boolean.true.powershell
924924
# ^ punctuation.definition.variable.powershell
925925
} | Invoke-Something

0 commit comments

Comments
 (0)