Skip to content

Add better support for Python functions and props #4285

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

fibbo
Copy link

@fibbo fibbo commented Jun 16, 2025

This is an attempt to improve the syntax highlighting for Python (#4284)

It should now correctly highlight function calls, chained function calls, and properties.

Changes

Added three more regex rules to the Python rules.

Checklist

  • Added markup tests TBD
  • Updated the changelog at CHANGES.md TBD

},
{
match: [
/(?<!(?:import|from)\s+[\w.]*)/, // Negative lookbehind for import context
Copy link
Member

Choose a reason for hiding this comment

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

Do we have a test case for this? I'd like to see an example or two of what exactly we're avoiding here.

Copy link
Author

@fibbo fibbo Jun 21, 2025

Choose a reason for hiding this comment

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

Imagine the following line:

from base.derive import test

I wouldn't want derive to be highlighted as a property. I added a test case for this.

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.

3 participants