Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
python: Improve function syntax highlighting (#20487)
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:* <img width="248" alt="image" src="https://github.com/user-attachments/assets/550ccd3d-594c-413a-b543-ef9caf39eee1"> *After:* <img width="245" alt="image" src="https://github.com/user-attachments/assets/47aa43b1-006b-4f9f-9029-510880f390ea">
- Loading branch information