-
Notifications
You must be signed in to change notification settings - Fork 592
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] decorators highlighting is broken #704
Comments
Decorator highlighting was changed to make it more sane in most situations by not abusing the Now it just highlights the I'm interested in your suggestions however. |
The Java syntax, for example, assigns Furthermore, unline in Java, decorators in Python can also be function calls, which means that any arbitrary expression may occur as an argument within the decorator statement. Looking at the code above, I don't think I would like everything in there to be highlighted in orange (before that change, the entire call had a purple background for me), so ... I guess we could limit the scope to the function beeing called. How does that sound? |
The issue of annotation scoping is one that we could use to sort of standardize on and add to the Scope Naming docs. Syntaxes that I think use something like this include: C#, Python, Java, Scala, Rust (attributes), Swift (attributes) I think the approach of Java (applying a single scope to the entire construct) breaks as soon as multiple tokens are used. I believe this is true for all of the syntaxes listed above, including Java. It may even be possible to argue some uses of My general opinion of the issue (which I am open to having my mind changed about) is that:
|
I agree that having everything highlighted is not a very nice option here. It will be more comfortable to have only |
FYI, this will most likely be addressed after #709 has concluded. |
Just a note, I've made a decision at #709 (comment) about decorator/annotation scope names. |
This should be addressed in the next dev build by a combination of #743 and tweaks to Monokai to highlight the new standard of |
It seems that detection of decorators in Python sources was broken somewhere between versions 3114 and 3124 of Sublime Text.
OS: Ubuntu 16.04
Steps to reproduce:
$ rm -r ~/.config/sublime-text-3
ER: decorator is highlighted in some way
AR: it is highlighted in green color
Do the same steps for 3124:
ER: decorator is highlighted in some way
AR: it is in white color - seems to be not highlighted at all
Also I have checked the "Python.sublime-syntax" file in both versions and it seems that decorator section was reduced a lot.
The text was updated successfully, but these errors were encountered: