Open RobertKlohr opened 4 years ago
Noting #136 as a related issue.
Have you checked out PR #155 or #156 for bahavior?
Are you expecting .Link
to accept a parameter, or not? PowerShell does not accept .Link
if you attempt to pass a parameter (URL) on the same line, and will actually invalidate the entire comment-based-help.
You are correct about the .LINK parameter I was not paying attention when I was building the generic file to make the screenshots.
Issue #136 definitely related.
I looked at #155 and #156 and loaded the powershell.tmLanguage.json file into my system. In it's current state the changes fix most of the issues but not all of them.
All of the other keywords function and highlight as excepted with the changes in #156.
Environment
I tested the code snippet below with all extensions disabled using both the stable and preview versions of the PowerShell extension. In all cases the behavior was the same.
Issue Description
The following keywords and their parameters used in the Comment-Based-Help section of a script or module not highlight correctly when compared to the other keywords that do not take parameters nor consistently when compared the .PARAMETER keyword.
.LINK .FORWARDHELPTARGETNAME .FORWARDHELPCATEGORY .REMOTEHELPRUNSPACE .EXTERNALHELP
The one keyword that does seem to at least partially work is the .PARAMETER keyword. It only highlights as a keyword if it has the required parameters and both the keyword and parameters highlight as the same type of syntax. (same color)
I was able to manually edit the powershell.tmLanguage.json file to get the highlighting to work but adjusting the moving all the keywords to the second "captures" under "commentEmbeddedDocs" and making some edits to the regex statement to include characters needed to create URI patterns.
When working against my local files I also created a new third "captures" group and moved the .FORWARDHELPCATEGORY to that group and added the regex to test for the list of valid categories that the keyword would take: (Alias|Cmdlet|HelpFile|Function|Provider|General|FAQ|Glossary|ScriptCommand|ExternalScript|Filter|All)
I don't have the knowledge to do the pull and edit XML and do the regression testing. I can test if someone is able to make the edits.
Screenshots
Expected Behavior
The keywords would highlight as comments if they did not have the required parameters (the ".PARAMETER" keyword is the only one that currently works) and the keywords and parameters would both highlight as keywords, as the ".PARAMETER" keyword and parameter does now or highlight as a keyword and parameter with two different colors.
Code Samples - Snippet: