From 757f3fe003ffa4a2333b28de8ecca4a8506c2f4d Mon Sep 17 00:00:00 2001 From: vexx32 <32407840+vexx32@users.noreply.github.com> Date: Sat, 12 Oct 2019 10:55:44 -0400 Subject: [PATCH] :sparkles: Add recognition for Dispose{} Add dispose{} named block keyword to language files. Yay, editor highlighting! --- PowerShellSyntax.tmLanguage | 2 +- examples/advancedFunction.ps1 | 3 +++ spec/testfiles/syntax_test_Function.ps1 | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/PowerShellSyntax.tmLanguage b/PowerShellSyntax.tmLanguage index 60dd69d..e076e51 100644 --- a/PowerShellSyntax.tmLanguage +++ b/PowerShellSyntax.tmLanguage @@ -258,7 +258,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|continue|data|default|define|dispose|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..21f9334 100644 --- a/examples/advancedFunction.ps1 +++ b/examples/advancedFunction.ps1 @@ -90,4 +90,7 @@ function Verb-Noun End { } + Dispose + { + } } diff --git a/spec/testfiles/syntax_test_Function.ps1 b/spec/testfiles/syntax_test_Function.ps1 index 187dab1..6d06471 100644 --- a/spec/testfiles/syntax_test_Function.ps1 +++ b/spec/testfiles/syntax_test_Function.ps1 @@ -370,4 +370,8 @@ function Verb-Noun { # <- keyword.control.powershell } + Dispose{ + # <- keyword.control.powershell + } + }