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

Update the regex for the PowerShell parser #33

Merged
merged 4 commits into from
Jul 11, 2023

Conversation

daxian-dbw
Copy link
Contributor

@daxian-dbw daxian-dbw commented May 25, 2023

Update the regex for the PowerShell parser:

  1. Support matching the PowerShell cmdlets and parameters;
  2. For operators, update the regex to match pipeline operator | and the array literal operator ,;
  3. For attributes, update the regex to match more available attributes;
  4. Make attribute and keyword matching case insensitive;
  5. Add pwsh as an alias for the PowerShell language;
  6. Add the color setting for PowerShell command and parameter for both the default dark and light themes.

@daxian-dbw
Copy link
Contributor Author

@michael-hawker Could you please do a code review? Thanks!

@daxian-dbw
Copy link
Contributor Author

Gently ping. @michael-hawker @azchohfi, can you please review this PR? Thanks!

@michael-hawker
Copy link
Member

Sorry, I was away. @daxian-dbw do you have a before/after picture of the changes on a PowerShell file? Otherwise, appears good!

@daxian-dbw
Copy link
Contributor Author

@michael-hawker No worries!
Here are the screenshots to show the highlighting before and after the changes:

Before the change

image

After the change

image

@daxian-dbw
Copy link
Contributor Author

@michael-hawker gentle ping :) Can you please review again? The pictures were added.

Copy link
Member

@Arlodotexe Arlodotexe left a comment

Choose a reason for hiding this comment

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

The case sensitivity for keywords was fixed, Commands and Parameters are now highlighted, and several more inbox attributes are now supported (case insensitive). No obvious issues. Approved 👍

@michael-hawker michael-hawker merged commit 7c21251 into CommunityToolkit:main Jul 11, 2023
3 checks passed
@daxian-dbw daxian-dbw deleted the pwsh branch July 11, 2023 16:48
@daxian-dbw
Copy link
Contributor Author

@Arlodotexe and @michael-hawker, thanks for the review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants