You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
switch statement default clause condition keyword should be flagged as keyword token #10470
In PowerShell ISE and with PSReadLine, the default clause condition keyword of the switch statement receives only 'bareword' treatment, making it hard to spot relative to other bareword conditions.
(PowerShell 7 with custom PSReadLine theme)
(Example shown here with PowerShell/EditorSyntax#156 (which marks the bareword conditions as unquoted strings) and a custom theme in VS Code, with the keyword highlighted)
I would propose a change to Parser.GetCommandArgument() that would mark the token as a keyword when it meets the criteria for being the default clause condition keyword.
I can include a commit to PR #10295 that demonstrates this change.
Conceptually, @PowerShell/powershell-committee agrees that this behavioral part of the change is fine. We defer to the Maintainers and Area Experts to review the technical and implementation aspects of the code. (And we expect that they'll mandate you include some tests in your PR as well :) )
Having looked over #10295, we'd prefer that you add your proposed commit to a separate PR.
But hey, thanks for the change. I always appreciate seeing improvements to syntax highlighting.
Activity
joeyaiello commentedon Sep 4, 2019
Conceptually, @PowerShell/powershell-committee agrees that this behavioral part of the change is fine. We defer to the Maintainers and Area Experts to review the technical and implementation aspects of the code. (And we expect that they'll mandate you include some tests in your PR as well :) )
Having looked over #10295, we'd prefer that you add your proposed commit to a separate PR.
But hey, thanks for the change. I always appreciate seeing improvements to syntax highlighting.