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
Operators tokens remain flagged as operators after TokenKind is changed to Generic in Command Mode #10348
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 runtime
While trying to understand why PSReadLine highlights operator tokens in command mode as operators (though they are not in that context) , I determined that the parser/tokenizer (Tokens Class) has a method that specifically resets the TokenKind of a token, to 'Generic'. However it fails to remove the flags originally set from the original TokenKind. This most commonly occurs to the operators, which in command mode, are not operators and instead are treated as unquoted arguments. PSReadLine uses the TokenFlags UnaryOperator, BinaryOperator and AssignmentOperator to highlight operators, and so that is what it sees
I removed the Area-PSReadLine tag. The issue can only be worked around in PSReadLine, a proper fix in the PowerShell parser might help other tools as well.
Is there any behaviour that depends on the retention of the original TokenFlags values? It seems odd not to reset the flags when changing the TokenKind. 🤔
If not, it doesn't seem like a particularly complex fix.
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
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 runtime
Activity
Operator Highlight in ArgumentMode
lzybkr commentedon Aug 21, 2019
I removed the
Area-PSReadLinetag. The issue can only be worked around in PSReadLine, a proper fix in the PowerShell parser might help other tools as well.vexx32 commentedon Aug 21, 2019
Is there any behaviour that depends on the retention of the original TokenFlags values? It seems odd not to reset the flags when changing the TokenKind. 🤔
If not, it doesn't seem like a particularly complex fix.
lzybkr commentedon Aug 21, 2019
Clearing the "operator" token flags when changing the token kind to
Genericfeels safe to me.microsoft-github-policy-service commentedon Nov 16, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commentedon Nov 23, 2023
This issue has been marked as "No Activity" as there has been no activity for 6 months. It has been closed for housekeeping purposes.