Skip to content

Prioritize highlight of command names, prevent bleed from aligned nested tokens #989

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

Merged
merged 3 commits into from
Sep 6, 2019

Conversation

msftrncs
Copy link
Collaborator

@msftrncs msftrncs commented Aug 3, 2019

Referencing #836,

  • Prioritize the selection of the command color when a token is flagged as 'CommandName'. (to handle a parameter token that is flagged as a command name, it is really a command name)
  • Prevent the bleed of a token with nested tokens in to the rest of the statement.

reference PowerShell#836, specifically handles parameter token that is flagged as a
command name, it is really a command name.
When a nested token ends together with the parent token, the signal would
be lost, and the rest of the statement would be highlighted as the parent.
@msftrncs
Copy link
Collaborator Author

msftrncs commented Aug 3, 2019

I added another commit to complete what can be fixed in #836, where nested tokens would bleed the parent tokens color unto the rest of the statement, if the last nested token ended together with the parent token. In the case of & hello$ab -hello, lets not prioritize command names so much the next item gets the same color.

@msftrncs msftrncs changed the title Prioritize highlight of command names Prioritize highlight of command names, prevent bleed from aligned nested tokens Aug 3, 2019
Copy link
Member

@daxian-dbw daxian-dbw left a comment

Choose a reason for hiding this comment

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

Could you please add a test? I'm not sure if it's easy to do so though ...

@msftrncs
Copy link
Collaborator Author

msftrncs commented Sep 6, 2019

I have added a commit that implements two test scenarios, each of which attempts to test for the two items addressed above under slightly different scenarios.

Add 2 tests to RenderTests, both tests simultaneously check for priority
to highlight command names, and check for highlight bleed from expandable
token which has a nested token that ends together with the parent token.
@msftrncs msftrncs force-pushed the PrioritizeCommandHighlight branch from 2789f32 to 2062ead Compare September 6, 2019 04:56
@msftrncs
Copy link
Collaborator Author

msftrncs commented Sep 6, 2019

I force pushed as my previous commit was trying to change (remove) the BOM.

Copy link
Member

@daxian-dbw daxian-dbw left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

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.

2 participants