Skip to content

Commit

Permalink
Merge pull request #197 from theaquamarine/requires
Browse files Browse the repository at this point in the history
Add #Requires -PSEdition and -Assembly
  • Loading branch information
andyleejordan committed Mar 17, 2021
2 parents 0778739 + 069f8b0 commit c150c15
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion PowerShellSyntax.tmLanguage
Expand Up @@ -1246,7 +1246,7 @@
<array>
<dict>
<key>match</key>
<string>\-(?i:Modules|PSSnapin|RunAsAdministrator|ShellId|Version)</string>
<string>\-(?i:Modules|PSSnapin|RunAsAdministrator|ShellId|Version|Assembly|PSEdition)</string>
<key>name</key>
<string>keyword.other.powershell</string>
</dict>
Expand Down
2 changes: 2 additions & 0 deletions examples/TheBigTestFile.ps1
Expand Up @@ -10,6 +10,8 @@ using namespace System.Management.Automation
#Requires -Modules PSWorkflow, ActiveDirectory
#Requires -Modules PSWorkflow,ActiveDirectory
#Requires -ShellId MyLocalShell
#Requires -PSEdition Core
#Requires -Assembly System
#Requires -Modules PSWorkflow @{
ModuleName="PSScheduledJob"
ModuleVersion="1.0.0.0"
Expand Down
12 changes: 11 additions & 1 deletion spec/testfiles/syntax_test_TheBigTestFile.ps1
Expand Up @@ -63,6 +63,16 @@ using namespace System.Management.Automation
# ^ meta.requires.powershell keyword.control.requires.powershell
# ^^^^^^^^ meta.requires.powershell keyword.other.powershell
# ^^^^^^^^^^^^ meta.requires.powershell variable.parameter.powershell
#Requires -PSEdition Core
# <- punctuation.definition.comment.powershell
# ^ meta.requires.powershell keyword.control.requires.powershell
# ^^^^^^^^^^ meta.requires.powershell keyword.other.powershell
# ^^^^ meta.requires.powershell variable.parameter.powershell
#Requires -Assembly System
# <- punctuation.definition.comment.powershell
# ^ meta.requires.powershell keyword.control.requires.powershell
# ^^^^^^^^^ meta.requires.powershell keyword.other.powershell
# ^^^^^^ meta.requires.powershell variable.parameter.powershell
#Requires -Modules PSWorkflow, @{ModuleName="PSScheduledJob"; ModuleVersion="1.0.0.0"}
# <- punctuation.definition.comment.powershell
# ^ meta.requires.powershell keyword.control.requires.powershell
Expand Down Expand Up @@ -1259,4 +1269,4 @@ $ConfirmPreference $DebugPreference $ErrorActionPreference $ErrorView $FormatEnu
# <- variable.language.powershell
# ^ variable.language.powershell ^ variable.language.powershell ^ variable.language.powershell ^ variable.language.powershell ^ variable.language.powershell ^ variable.language.powershell ^ variable.language.powershell ^ variable.language.powershell ^ variable.language.powershell ^ variable.language.powershell ^ variable.language.powershell ^ variable.language.powershell ^ variable.language.powershell ^ variable.language.powershell ^ variable.language.powershell ^ variable.language.powershell
# ^ variable.language.powershell ^ variable.language.powershell ^ variable.language.powershell ^ variable.language.powershell ^ variable.language.powershell ^ variable.language.powershell ^ variable.language.powershell ^ variable.language.powershell ^ variable.language.powershell ^ variable.language.powershell ^ variable.language.powershell ^ variable.language.powershell ^ variable.language.powershell
# ^ variable.language.powershell ^ variable.language.powershell ^ variable.language.powershell ^ variable.language.powershell ^ variable.language.powershell
# ^ variable.language.powershell ^ variable.language.powershell ^ variable.language.powershell ^ variable.language.powershell ^ variable.language.powershell

0 comments on commit c150c15

Please sign in to comment.