-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally 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 moreIssue has had no activity for 6 months or moreWG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime
Description
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
Steps to reproduce
echo 1 + 2 + 3 (1 + 2 + 3)
# ^ ^ not operators
# ^ ^ operators!Metadata
Metadata
Assignees
Labels
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally 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 moreIssue has had no activity for 6 months or moreWG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime