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.

Home Page:https://packagecontrol.io/packages/Python%20Improved

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Built-in types are highlighted as support.function and not support.type if called

FichteFoll opened this issue · comments

2014-09-02_22 40 11

Consider the above snippets, str is once highlighted as support.type and once highlighted as support.function, as well as list. This is probably because they are actually used like a function, but in fact they are classes. The default Python syntax def does not treat these built-in type calls differently to the literal references.

Here is the same snippet with the default Python syntax:
2014-09-02_22 44 56

I prefer the default version over the current, but what do you think?

I think part of the problem is that they currently need to be treated like a function in order to have parameters get highlighted. I agree that they aren't really functions though.

So I think that the current implementation is the easy way to get parameters etc. working; just make them functions.

But the other way would be to add parameter support to these class objects; that would be more work, but it would more correct. I have thought about doing the latter approach myself, but I am also very lazy at times when I have something working.

I would be interested to hear what @MattDMo thinks as well.

I'm not as busy as I was last time in #8. I also realize now, after seeing the screenshots in there, that this is an issue directly caused by that change.

I'll start working on the "fix" that I had in mind back then which should also cover this issue and hopefully also make the syntax definition itself a bit more manageable.

Meh, I think in this case there was a net positive increase in the highlighting via #8, but yeah, it could be done better. I look forward to seeing this improve even more; I'll keep an eye out for your fix.

So after a hiatus, I'm trying to get back to work on this again. I've merged @FichteFoll's changes into a testing branch in my repo, and I'll see what makes sense to use.

Any updates? 🐼

@aldanor as a matter of fact, yes! PythonImproved 2.0 is going to be released in the very near future, and this is fixed there.

@MattDMo wow, very cool -- and a good timing!

Thanks!