Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

switch statement default clause condition keyword should be flagged as keyword token #10470

Copy link
Copy link
@msftrncs

Description

@msftrncs
Issue body actions

Summary of the new feature/enhancement

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)
image

(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)

image

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 the default clause condition keyword.

I can include a commit to PR #10295 that demonstrates this change.

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Committee-ReviewedPS-Committee has reviewed this and made a decisionPS-Committee has reviewed this and made a decisionIssue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugResolution-FixedThe issue is fixed.The issue is fixed.WG-Languageparser, language semanticsparser, language semantics

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.