MattDMo / PythonImproved

The best Python language definition for Sublime Text - ever. Includes full support for Unicode, as well as both Python 2 and Python 3 syntax. Check out the Neon Color Scheme for highlighting.
https://packagecontrol.io/packages/Python%20Improved
MIT License
93 stars 11 forks source link

Using `cls` as a function breaks highlighting for arguments #52

Closed aldanor closed 8 years ago

aldanor commented 8 years ago

This is a quite common snippet:

@classmethod
def from_foo(cls, foo):
    return cls(foo, bar='baz')

However it breaks highlighting for arguments inside () since cls is not treated as a function.

MattDMo commented 8 years ago

Thanks for the feedback, I'll take a look and see what I can do.

MattDMo commented 8 years ago

@aldanor just so I'm sure on what I need to fix - can self also be a function like cls? If so, I can just modify them both at the same time.

aldanor commented 8 years ago

@MattDMo yea it could be, in case __call__ is implemented. But cls is always callable, so there's that

MattDMo commented 8 years ago

Thanks for your help! I fixed the argument highlighting:

screen shot 2015-12-04 at 8 37 53 pm
aldanor commented 8 years ago

Thanks!

vaultah commented 8 years ago

Is this behaviour correct?

Python Improved 2.1.0.

MattDMo commented 8 years ago

Umm ... nope. Back to work...

MattDMo commented 8 years ago
screen shot 2015-12-05 at 2 16 59 pm
aldanor commented 8 years ago

@MattDMo

Another bug, it seems:

image

MattDMo commented 8 years ago

Just pushed release 2.1.2, which fixes this:

screen shot 2015-12-07 at 1 44 58 pm

I missed a word delimiter (\b) in one or two spots. Everything should work as expected now.