Skip to content

DashDash token causing remaining parameter tokens to be flagged as CommandName #10347

@msftrncs

Description

@msftrncs

Apparently there is some special meaning to the DashDash token when it is used in command mode, but I couldn't seem to uncover it. While trying to understand the tokenizer and parser I ran in to these two issues:

  1. A DashDash token causes further Parameter tokens to be flagged as CommandName, which can be confusing with PSReadLine if PSReadLine if changed to prioritize the highlighting of CommandName over Parameter (Prioritize highlight of command names, prevent bleed from aligned nested tokens PSReadLine#989).
  2. A DashDash token can be accepted as a command, when used with the invoke operators, but it does not get flagged with CommandName, and so causes PSReadLine to highlight it as a operator. Even when it is accepted as a command, the behavior in point 1 still occurs.

Steps to reproduce

& -- -NowACommandNameFlaggedToken

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-No ActivityIssue has had no activity for 6 months or moreWG-Enginecore PowerShell engine, interpreter, and runtimeWG-Interactive-PSReadLinePSReadline related issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions