Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Operator Highlight in ArgumentMode #1003

Merged
merged 2 commits into from
Sep 5, 2019

Conversation

msftrncs
Copy link
Collaborator

Operators shouldn't highlight in argument mode.

See PowerShell/PowerShell#10348

Operators as TokenKind Generic are not actually operators. This PR restricts the operator token detection to just those tokens that are not TokenKind Generic.

Fix #1002.

Operators shouldn't highlight in argument mode.
See PowerShell/PowerShell#10348
Operators as TokenKind Generic are not actually operators.

Fix PowerShell#1002.
lzybkr
lzybkr previously approved these changes Aug 21, 2019
@lzybkr lzybkr dismissed their stale review August 21, 2019 12:34

Suggest adding a test.

Copy link
Member

@lzybkr lzybkr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code changes look good, but it would be a good idea to add a quick test in test\RenderTest.cs.

@msftrncs
Copy link
Collaborator Author

I made a simple addition for testing, testing against master first to confirm the tests would fail previously.

@daxian-dbw
Copy link
Member

Like being said in the referenced issue, it probably should be fixed in parser.
But fixing it in PSReadLine is nice to have since the tokens will be rendered more accurately on old versions of powershell.

@daxian-dbw daxian-dbw merged commit 4285cce into PowerShell:master Sep 5, 2019
@msftrncs msftrncs deleted the OperatorHighlight branch September 7, 2019 03:56
@daxian-dbw daxian-dbw added this to the 2.0.0-beta5 milestone Sep 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Operators highlight in argument mode when not operators
3 participants