Built-in types are highlighted as support.function and not support.type if called
FichteFoll opened this issue · comments
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:
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!