@@ -806,33 +806,30 @@ contexts:
806806 - include : comment-embedded-docs
807807
808808 comment-embedded-docs :
809- # TODO
810809 # https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_comment_based_help
811- - match : |-
812- (?xi:
813- ^\s*(\.)
814- (
815- Component | Description | Example | ExternalHelp | ForwardHelpCategory | ForwardHelpTargetName
816- | Functionality | Inputs | Link | Notes | Outputs | Parameter | RemoteHelpRunSpace
817- | Role | Synopsis
818- )
819- )
820- scope: comment.documentation.embedded.powershell
821- captures:
822- 1: punctuation.definition.keyword.documentation.powershell
823- 2: keyword.other.documentation.powershell
824810 - match : ^\s*(\.)(?i:(Parameter)\s+([a-z0-9-_]+))
825811 scope : comment.documentation.embedded.powershell
826812 captures :
827813 1 : punctuation.definition.keyword.documentation.powershell
828814 2 : keyword.other.documentation.param.powershell
829815 3 : variable.parameter.powershell
830- - match : ^\s*(\.)(?i:(ForwardHelpTargetName|ForwardHelpCategory| ExternalHelp|Link)\s+([a-z0-9-_]+))
816+ - match : ^\s*(\.)(?i:(ForwardHelpTargetName|ExternalHelp|Link)\s+([a-z0-9-_:/.& ]+))
831817 scope : comment.documentation.embedded.powershell
832818 captures :
833819 1 : punctuation.definition.keyword.documentation.powershell
834820 2 : keyword.other.documentation.powershell
835821 3 : markup.underline.link.powershell
822+ - match : ^\s*(\.)(?i:(ForwardHelpCategory)\s+({{doc_fwdhelp_cat}}))
823+ scope : comment.documentation.embedded.powershell
824+ captures :
825+ 1 : punctuation.definition.keyword.documentation.powershell
826+ 2 : keyword.other.documentation.powershell
827+ 3 : support.type.powershell
828+ - match : ^\s*(\.)({{doc}})
829+ scope : comment.documentation.embedded.powershell
830+ captures :
831+ 1 : punctuation.definition.keyword.documentation.powershell
832+ 2 : keyword.other.documentation.powershell
836833
837834 comment-line :
838835 - match : ' #(?!(?i:requires|(?:end)?region)\b)'
@@ -961,3 +958,16 @@ variables:
961958 # Other verbs
962959 | Use
963960 )\b
961+
962+ # Documentation
963+ doc : |-
964+ (?xi:
965+ Component | Description | Example | ExternalHelp | ForwardHelpCategory
966+ | ForwardHelpTargetName | Functionality | Inputs | Link | Notes | Outputs
967+ | Parameter | RemoteHelpRunSpace | Role | Synopsis
968+ )
969+ doc_fwdhelp_cat : |-
970+ (?x:
971+ Alias | Cmdlet | HelpFile | Function | Provider | General | FAQ
972+ | Glossary | ScriptCommand | ExternalScript | Filter | All
973+ )
0 commit comments