Skip to content

Commit

Permalink
fix #136,
Browse files Browse the repository at this point in the history
optimize single line comment
use \G in and optimize commentEmbeddedDocs matches
  • Loading branch information
msftrncs committed May 11, 2019
1 parent 44eac87 commit b0f864a
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 @@ -388,10 +388,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 @@ -556,8 +556,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 @@ -580,8 +582,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 b0f864a

Please sign in to comment.