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

fix: Some Python syntax highlight enhancements #4708

Merged
merged 1 commit into from
May 22, 2022

Conversation

zardam
Copy link
Contributor

@zardam zardam commented May 22, 2022

fix: Some Python syntax highlight enhancements:

  • brackets should be matched independently
  • functions should be matched as functions

For example, with dracula theme, before:

image

After:

image

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@andrewnester andrewnester self-requested a review May 22, 2022 10:08
regex: "[\\]\\)\\}]"
regex: "[\\)\\}]"
}, {
token: "paren.lbracket",
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you explain why yo want to a new token here? paren.lbracket seems to be some new token you introduced and it won't be styled properly anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right, I have removed these tokens from the pull request.

@zardam zardam force-pushed the python_highlight_rules branch from c8e7195 to fce9a7c Compare May 22, 2022 12:15
@andrewnester andrewnester self-requested a review May 22, 2022 12:37
Copy link
Contributor

@andrewnester andrewnester left a comment

Choose a reason for hiding this comment

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

Please fix the test here, it should be entity.name.function after your change

https://github.com/ajaxorg/ace/blob/master/lib/ace/mode/_test/tokens_python.json#L336

@zardam zardam force-pushed the python_highlight_rules branch from fce9a7c to 8c01a6e Compare May 22, 2022 13:04
@zardam
Copy link
Contributor Author

zardam commented May 22, 2022

I have updated the pull request.

@codecov
Copy link

codecov bot commented May 22, 2022

Codecov Report

Merging #4708 (8c01a6e) into master (0164811) will decrease coverage by 0.00%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #4708      +/-   ##
==========================================
- Coverage   71.19%   71.19%   -0.01%     
==========================================
  Files         553      553              
  Lines       55598    55598              
  Branches    10392    10392              
==========================================
- Hits        39584    39583       -1     
- Misses      16014    16015       +1     
Flag Coverage Δ
unittests 71.19% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
lib/ace/mode/python_highlight_rules.js 100.00% <ø> (ø)
lib/ace/range.js 84.82% <0.00%> (-0.69%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0164811...8c01a6e. Read the comment docs.

@andrewnester andrewnester self-requested a review May 22, 2022 13:21
@andrewnester andrewnester merged commit b2aaf1f into ajaxorg:master May 22, 2022
@andrewnester
Copy link
Contributor

Merged, thanks for the contribution!

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