From 0094f7a9f53bd65f36607622f34705bc907f1e7b Mon Sep 17 00:00:00 2001 From: Guillaume Lachance Date: Wed, 8 May 2019 11:29:27 -0400 Subject: [PATCH] Preference Variables Variables: LogCommandHealthEvent LogCommandLifecycleEvent LogEngineHealthEvent LogEngineLifecycleEvent LogProviderLifecycleEvent LogProviderHealthEvent InformationPreference Attributes: SupportsWildcards --- PowerShellSyntax.tmLanguage | 6 +++--- spec/testfiles/syntax_test_TheBigTestFile.ps1 | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/PowerShellSyntax.tmLanguage b/PowerShellSyntax.tmLanguage index 8b184fa..d967584 100644 --- a/PowerShellSyntax.tmLanguage +++ b/PowerShellSyntax.tmLanguage @@ -416,7 +416,7 @@ attribute begin - (\[)\s*\b(?i)(cmdletbinding|alias|outputtype|parameter|validatenotnull|validatenotnullorempty|validatecount|validateset|allownull|allowemptycollection|allowemptystring|validatescript|validaterange|validatepattern|validatelength)\b + (\[)\s*\b(?i)(cmdletbinding|alias|outputtype|parameter|validatenotnull|validatenotnullorempty|validatecount|validateset|allownull|allowemptycollection|allowemptystring|validatescript|validaterange|validatepattern|validatelength|supportswildcards)\b beginCaptures 1 @@ -1037,7 +1037,7 @@ comment Style preference variables as language variables so that they stand out. match - (\$)(?i:(ConfirmPreference|DebugPreference|ErrorActionPreference|ErrorView|FormatEnumerationLimit|MaximumAliasCount|MaximumDriveCount|MaximumErrorCount|MaximumFunctionCount|MaximumHistoryCount|MaximumVariableCount|OFS|OutputEncoding|ProgressPreference|PsCulture|PSDebugContext|PSDefaultParameterValues|PSEmailServer|PSItem|PSModuleAutoloadingPreference|PSSenderInfo|PSSessionApplicationName|PSSessionConfigurationName|PSSessionOption|VerbosePreference|WarningPreference|WhatIfPreference))((?:\.(?:\p{L}|\d|_)+)*\b)?\b + (\$)(?i:(ConfirmPreference|DebugPreference|ErrorActionPreference|ErrorView|FormatEnumerationLimit|InformationPreference|LogCommandHealthEvent|LogCommandLifecycleEvent|LogEngineHealthEvent|LogEngineLifecycleEvent|LogProviderHealthEvent|LogProviderLifecycleEvent|MaximumAliasCount|MaximumDriveCount|MaximumErrorCount|MaximumFunctionCount|MaximumHistoryCount|MaximumVariableCount|OFS|OutputEncoding|PSDefaultParameterValues|PSEmailServer|PSModuleAutoLoadingPreference|PSSessionApplicationName|PSSessionConfigurationName|PSSessionOption|ProgressPreference|VerbosePreference|WarningPreference|WhatIfPreference))((?:\.(?:\p{L}|\d|_)+)*\b)?\b captures @@ -1321,7 +1321,7 @@ comment Style preference variables as language variables so that they stand out. match - (\$)(?i:(ConfirmPreference|DebugPreference|ErrorActionPreference|ErrorView|FormatEnumerationLimit|MaximumAliasCount|MaximumDriveCount|MaximumErrorCount|MaximumFunctionCount|MaximumHistoryCount|MaximumVariableCount|OFS|OutputEncoding|ProgressPreference|PsCulture|PSDebugContext|PSDefaultParameterValues|PSEmailServer|PSItem|PSModuleAutoloadingPreference|PSSenderInfo|PSSessionApplicationName|PSSessionConfigurationName|PSSessionOption|VerbosePreference|WarningPreference|WhatIfPreference))\b + (\$)(?i:(ConfirmPreference|DebugPreference|ErrorActionPreference|ErrorView|FormatEnumerationLimit|InformationPreference|LogCommandHealthEvent|LogCommandLifecycleEvent|LogEngineHealthEvent|LogEngineLifecycleEvent|LogProviderHealthEvent|LogProviderLifecycleEvent|MaximumAliasCount|MaximumDriveCount|MaximumErrorCount|MaximumFunctionCount|MaximumHistoryCount|MaximumVariableCount|OFS|OutputEncoding|PSDefaultParameterValues|PSEmailServer|PSModuleAutoLoadingPreference|PSSessionApplicationName|PSSessionConfigurationName|PSSessionOption|ProgressPreference|VerbosePreference|WarningPreference|WhatIfPreference))((?:\.(?:\p{L}|\d|_)+)*\b)?\b captures diff --git a/spec/testfiles/syntax_test_TheBigTestFile.ps1 b/spec/testfiles/syntax_test_TheBigTestFile.ps1 index 83a1a43..3fe7ec1 100644 --- a/spec/testfiles/syntax_test_TheBigTestFile.ps1 +++ b/spec/testfiles/syntax_test_TheBigTestFile.ps1 @@ -1222,3 +1222,8 @@ get-thing | Out-WithYou > $null # destroy # ^ ^ meta.group.complex.subexpression.powershell punctuation.section.group.begin.powershell # ^ storage.type.powershell # ^ ^ meta.group.complex.subexpression.powershell punctuation.section.group.end.powershell +"This is the Debugreference variable: $DebugPreference" +# <- string.quoted.double.powershell +# ^ variable.language.powershell +$ConfirmPreference +# <- variable.language.powershell