From 4d64a84818ace825cbf19e54adfaad7323f591fc Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Fri, 16 Jul 2021 15:31:19 -0700 Subject: [PATCH] Add syntax highlighting for 'clean {}' --- PowerShellSyntax.tmLanguage | 2 +- examples/advancedFunction.ps1 | 3 +++ spec/testfiles/syntax_test_Function.ps1 | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/PowerShellSyntax.tmLanguage b/PowerShellSyntax.tmLanguage index 45db1b8..e5318df 100644 --- a/PowerShellSyntax.tmLanguage +++ b/PowerShellSyntax.tmLanguage @@ -288,7 +288,7 @@ match - (?<!\w|-|\.)((?i:begin|break|catch|continue|data|default|define|do|dynamicparam|else|elseif|end|exit|finally|for|from|if|in|inlinescript|parallel|param|process|return|sequence|switch|throw|trap|try|until|var|while)|%|\?)(?!\w) + (?<!\w|-|\.)((?i:begin|break|catch|clean|continue|data|default|define|do|dynamicparam|else|elseif|end|exit|finally|for|from|if|in|inlinescript|parallel|param|process|return|sequence|switch|throw|trap|try|until|var|while)|%|\?)(?!\w) name keyword.control.powershell diff --git a/examples/advancedFunction.ps1 b/examples/advancedFunction.ps1 index 1862e9b..4bd6c56 100644 --- a/examples/advancedFunction.ps1 +++ b/examples/advancedFunction.ps1 @@ -90,4 +90,7 @@ function Verb-Noun End { } + Clean + { + } } diff --git a/spec/testfiles/syntax_test_Function.ps1 b/spec/testfiles/syntax_test_Function.ps1 index 187dab1..f527630 100644 --- a/spec/testfiles/syntax_test_Function.ps1 +++ b/spec/testfiles/syntax_test_Function.ps1 @@ -370,4 +370,7 @@ function Verb-Noun { # <- keyword.control.powershell } + Clean { + # <- keyword.control.powershell + } }