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

python: Improve function syntax highlighting #20487

Conversation

clwainwright
Copy link
Contributor

Release Notes:

  • Differentiate between function and method calls and definitions. function.definition matches the highlight for e.g. rust, function.call is new.
  • Likewise differentiate between class calls and class definitions.
  • Better highlighting of function decorators (the @ symbol is punctuation, and now the decorator itself has a function.decorator tag)
  • Make cls a special variable (like self)
  • Add ellipsis as a built-in constant

Note that most themes do not currently make use of the function.definition tags, and none make use of the type.class.definition tag. Hopefully more themes will pick this up.

Before:
image

After:
image

Copy link

cla-bot bot commented Nov 11, 2024

We require contributors to sign our Contributor License Agreement, and we don't have @clwainwright on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@clwainwright
Copy link
Contributor Author

@cla-bot check

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Nov 11, 2024
Copy link

cla-bot bot commented Nov 11, 2024

The cla-bot has been summoned, and re-checked this pull request!

@clwainwright clwainwright changed the title improved python function syntax highlighting Improved python function syntax highlighting Nov 11, 2024
@maxdeviant maxdeviant changed the title Improved python function syntax highlighting python: Improve function syntax highlighting Nov 12, 2024
@osiewicz osiewicz merged commit fb6c987 into zed-industries:main Nov 18, 2024
13 checks passed
@osiewicz
Copy link
Contributor

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants