switch
statement default
clause condition keyword should be flagged as keyword token
#10470
Labels
Committee-Reviewed
PS-Committee has reviewed this and made a decision
Issue-Enhancement
the issue is more of a feature request than a bug
Resolution-Fixed
The issue is fixed.
WG-Language
parser, language semantics
Summary of the new feature/enhancement
In PowerShell ISE and with PSReadLine, the
default
clause condition keyword of theswitch
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)
Proposed technical implementation details (optional)
I would propose a change to
Parser.GetCommandArgument()
that would mark the token as a keyword when it meets the criteria for being thedefault
clause condition keyword.I can include a commit to PR #10295 that demonstrates this change.
The text was updated successfully, but these errors were encountered: