@@ -78,11 +78,17 @@ public IList<LanguageRule> Rules
7878 { 0 , ScopeName . PowerShellVariable }
7979 } ) ,
8080 new LanguageRule (
81- @"\b(begin|break|catch|continue|data|do|dynamicparam|elseif|else|end|exit|filter|finally|foreach|for|from|function|if|in|param|process|return|switch|throw|trap|try|until|while)\b" ,
81+ @"(?i) \b(begin|break|catch|continue|data|do|dynamicparam|elseif|else|end|exit|filter|finally|foreach|for|from|function|if|in|param|process|return|switch|throw|trap|try|until|while)\b" ,
8282 new Dictionary < int , string >
8383 {
8484 { 1 , ScopeName . Keyword }
8585 } ) ,
86+ new LanguageRule (
87+ @"\b(\w+\-\w+)\b" ,
88+ new Dictionary < int , string >
89+ {
90+ { 1 , ScopeName . PowerShellCommand }
91+ } ) ,
8692 new LanguageRule (
8793 @"-(?:c|i)?(?:eq|ne|gt|ge|lt|le|notlike|like|notmatch|match|notcontains|contains|replace)" ,
8894 new Dictionary < int , string >
@@ -98,7 +104,14 @@ public IList<LanguageRule> Rules
98104 }
99105 ) ,
100106 new LanguageRule (
101- @"(?:\+=|-=|\*=|/=|%=|=|\+\+|--|\+|-|\*|/|%)" ,
107+ @"-\w+\d*\w*" ,
108+ new Dictionary < int , string >
109+ {
110+ { 0 , ScopeName . PowerShellParameter }
111+ }
112+ ) ,
113+ new LanguageRule (
114+ @"(?:\+=|-=|\*=|/=|%=|=|\+\+|--|\+|-|\*|/|%|\||,)" ,
102115 new Dictionary < int , string >
103116 {
104117 { 0 , ScopeName . PowerShellOperator }
@@ -112,7 +125,7 @@ public IList<LanguageRule> Rules
112125 }
113126 ) ,
114127 new LanguageRule (
115- @"(?s )\[(CmdletBinding )[^\]]+\]" ,
128+ @"(?is )\[(cmdletbinding|alias|outputtype|parameter|validatenotnull|validatenotnullorempty|validatecount|validateset|allownull|allowemptycollection|allowemptystring|validatescript|validaterange|validatepattern|validatelength|supportswildcards )[^\]]+\]" ,
116129 new Dictionary < int , string >
117130 {
118131 { 1 , ScopeName . PowerShellAttribute }
@@ -136,6 +149,7 @@ public bool HasAlias(string lang)
136149 {
137150 case "posh" :
138151 case "ps1" :
152+ case "pwsh" :
139153 return true ;
140154
141155 default :
0 commit comments