Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Tokenize subclass list names in tree-sitter grammar - #298

Merged
nathansobo merged 1 commit into
atom:masterfrom
caleb531:tree-sitter-subclass-names
Apr 10, 2019
Merged

nathansobo merged 1 commit into
atom:masterfrom
caleb531:tree-sitter-subclass-names

Conversation

@caleb531

@caleb531 caleb531 commented Apr 6, 2019 •

Copy link
Copy Markdown
Contributor

Requirements

  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • All new code requires tests to ensure against regressions

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
nathansobo merged commit d901fb9 into atom:master Apr 10, 2019
@nathansobo nathansobo self-assigned this Apr 10, 2019
@nathansobo

Copy link
Copy Markdown
Contributor

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

@winstliu winstliu mentioned this pull request Apr 24, 2019
1 task done
@caleb531
caleb531 deleted the tree-sitter-subclass-names branch May 12, 2019 23:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants