File tree 2 files changed +20
-2
lines changed 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change 522
522
<key >function </key >
523
523
<dict >
524
524
<key >begin </key >
525
- <string >((?i: function|filter|configuration|workflow)) \s+((?:\p{L}|\d|_|-|\.)+) </string >
525
+ <string >(? < !\S) (?i)( function|filter|configuration|workflow)\s+(?:(global|local|script|private):)? ((?:\p{L}|\d|_|-|\.)+) </string >
526
526
<key >beginCaptures </key >
527
527
<dict >
528
528
<key >0 </key >
538
538
<key >2 </key >
539
539
<dict >
540
540
<key >name </key >
541
- <string >entity.name.function </string >
541
+ <string >storage.modifier.scope.powershell </string >
542
+ </dict >
543
+ <key >3 </key >
544
+ <dict >
545
+ <key >name </key >
546
+ <string >entity.name.function.powershell </string >
542
547
</dict >
543
548
</dict >
544
549
<key >end </key >
Original file line number Diff line number Diff line change @@ -473,3 +473,16 @@ function Get-EscapedPath
473
473
return $path
474
474
}
475
475
}
476
+
477
+ # TODO: "function" should not be highlighted inside a command:
478
+ # These three should highlight roughly the same:
479
+ Test-Highlight - Something StringValue
480
+ Move-Item .\AFolderForWorkflow .\ANew\Location
481
+ Test-Function - StringFilter Pattern
482
+ Test-Highlight - TestFunction StringValue
483
+ function Test-Thing { <# When broken, only this comment wasn't broken #> }
484
+
485
+ # TODO: we should support scope on function names
486
+ function global :Test-Thing { Get-Command $global :VariableName }
487
+ function local :Test-Thing { Get-Command $global :VariableName }
488
+ function script :Test-Thing { Get-Command $global :VariableName }
You can’t perform that action at this time.
0 commit comments