atom / language-python

Python package for Atom
Other
190 stars 146 forks source link

Tokenize subclass list names in tree-sitter grammar #298

Closed caleb531 closed 5 years ago

caleb531 commented 5 years ago

Requirements

Description of the Change

This PR tokenizes the names of subclasses listed within class definitions, for Python files matched by the tree-sitter grammar.

Before:

Screen Shot 2019-04-06 at 2 09 32 PM

After:

Screen Shot 2019-04-06 at 2 10 30 PM

Alternate Designs

I don't know if the Atom team desires to tokenize these subclass names differently; I figured entity.other.inherited-class was the most appropriate scope, as it's based on the same scope from the first-mate grammar.

Benefits

Syntax highlighting that is more familiar to longtime users of the Python first-mate grammar.

Possible Drawbacks

Perhaps some might prefer different colors be used for the subclass names, though I personally like them.

Applicable Issues

N/A

nathansobo commented 5 years ago

Cool of you to break these up. Far from a Python expert but this also seems reasonable.