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 python call syntax highlighting #1987

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

pencels
Copy link

@pencels pencels commented Aug 20, 2023

Summary

Fixes an issue with the Python lexer where any identifier used before an opening paren ( would be highlighted as a function name. This led to inconsistent highlighting in the case of for loops, where one for would be rendered as a keyword while the other was rendered as a function name:

image

This pull request also addresses other edge cases for call expressions:

  • distinguishes Exception classes from normal classes in a call expr context
  • distinguishes Builtin calls from identically named method calls

Visual Before and After

Before After
Screenshot 2023-08-20 132415 Screenshot 2023-08-20 132000

@tancnle tancnle self-requested a review August 25, 2023 00:56
@tancnle tancnle added the needs-review The PR needs to be reviewed label Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-review The PR needs to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants