diff --git a/.gitignore b/.gitignore index 12dd925..e3c9d29 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # Editor files *.sublime-workspace +*.sublime-project # Other .idea diff --git a/PowerShell.sublime-project b/PowerShell.sublime-project deleted file mode 100644 index 9d0052b..0000000 --- a/PowerShell.sublime-project +++ /dev/null @@ -1,9 +0,0 @@ -{ - "folders": - [ - { - "follow_symlinks": true, - "path": ".", - }, - ], -} diff --git a/PowerShell.sublime-syntax b/PowerShell.sublime-syntax index 8979372..b568e5d 100644 --- a/PowerShell.sublime-syntax +++ b/PowerShell.sublime-syntax @@ -837,6 +837,8 @@ contexts: - match: \] scope: punctuation.section.brackets.end.powershell pop: 1 + - match: \b(?:in|out|ref)\b + scope: storage.modifier.powershell - match: \p{L}[\p{L}\p{N}]+(\.) scope: meta.generic-name.powershell captures: diff --git a/tests/syntax_test_PowerShell.ps1 b/tests/syntax_test_PowerShell.ps1 index 5929af5..96a4e10 100644 --- a/tests/syntax_test_PowerShell.ps1 +++ b/tests/syntax_test_PowerShell.ps1 @@ -2451,3 +2451,20 @@ function Process-DeploymentConfig { Resolve-ConfigPath -Path "Foo" -PathVariables $PathVariables # @@@@@@@@@@@@@@@@@@ reference } + + # https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_ref?view=powershell-7.6 + # Create a value type variable. + $i = 0 + # Create a reference type variable. + $iRef = [ref]0 +# ^^^ storage.modifier.powershell + # Invoke a scriptblock to attempt to change both values. + &{$i++;$iRef.Value++} + # Output the results. + "`$i = $i;`$iRef = $($iRef.Value)" + + [int]::TryParse("15", ([ref]$number)) +# ^^^ storage.type.powershell +# ^^ punctuation.accessor.double-colon.powershell +# @@@@@@@@ reference +# ^^^ storage.modifier.powershell