Skip to content

Commit

Permalink
Merge pull request #175 from msftrncs/Issue136_FixDocKeywords
Browse files Browse the repository at this point in the history
Improvements to Comment Based Help Keywords
  • Loading branch information
andyleejordan authored Mar 17, 2021
2 parents c784ca4 + b0f864a commit 2fb86c4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions PowerShellSyntax.tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -413,10 +413,10 @@
<key>commentLine</key>
<dict>
<key>begin</key>
<string>(?&lt;![`\\-])#</string>
<string>(?&lt;![`\\-])(#)#*</string>
<key>captures</key>
<dict>
<key>0</key>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.powershell</string>
Expand Down Expand Up @@ -581,8 +581,10 @@
<string>keyword.operator.documentation.powershell</string>
</dict>
</dict>
<key>comment</key>
<string>these embedded doc keywords do not support arguments, must be the only thing on the line</string>
<key>match</key>
<string>^(?i:(?:\s?|#)+(\.)(COMPONENT|DESCRIPTION|EXAMPLE|EXTERNALHELP|FORWARDHELPCATEGORY|FORWARDHELPTARGETNAME|FUNCTIONALITY|INPUTS|LINK|NOTES|OUTPUTS|REMOTEHELPRUNSPACE|ROLE|SYNOPSIS))</string>
<string>(?:^|\G)(?i:\s*(\.)(COMPONENT|DESCRIPTION|EXAMPLE|FUNCTIONALITY|INPUTS|LINK|NOTES|OUTPUTS|ROLE|SYNOPSIS))\s*$</string>
<key>name</key>
<string>comment.documentation.embedded.powershell</string>
</dict>
Expand All @@ -605,8 +607,10 @@
<string>keyword.operator.documentation.powershell</string>
</dict>
</dict>
<key>comment</key>
<string>these embedded doc keywords require arguments though the type required may be inconsistent, they may not all be able to use the same argument match</string>
<key>match</key>
<string>(?i:\s?(\.)(PARAMETER|FORWARDHELPTARGETNAME|FORWARDHELPCATEGORY|REMOTEHELPRUNSPACE|EXTERNALHELP)\s+([a-z0-9-_]+))</string>
<string>(?:^|\G)(?i:\s*(\.)(EXTERNALHELP|FORWARDHELP(?:CATEGORY|TARGETNAME)|PARAMETER|REMOTEHELPRUNSPACE))\s+(.+?)\s*$</string>
<key>name</key>
<string>comment.documentation.embedded.powershell</string>
</dict>
Expand Down

0 comments on commit 2fb86c4

Please sign in to comment.