The Wayback Machine - https://web.archive.org/web/20200527212705/https://github.com/atom/language-python/pull/288
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more scopes to the tree sitter grammar #288

Merged
merged 1 commit into from Apr 10, 2019
Merged

Add more scopes to the tree sitter grammar #288

merged 1 commit into from Apr 10, 2019

Conversation

@Ben3eeE
Copy link
Member

Ben3eeE commented Nov 23, 2018

Description

This PR adds the suggested changes from #257 using the latest tree-sitter-python and API.

We are using:
'binary_operator > "@"': 'keyword.operator'

To avoid highlighting the @ in decorated_definition > decorator > "@" as keyword.operator in f.ex.:

@classmethod
def foo(*, arg1,arg2):
    ...

Open questions

  1. When raising exception using the raise Exception('a') syntax. The exception is scoped as a function call (entity.name.function). Should Exception be support.type.exception in this case as well?
        raise ValueError('A very specific bad thing happened.')
  1. Compared to #257 we are missing two functions:
    __build_class__
    BuiltinImporter

I used the list from https://docs.python.org/3/library/functions.html when adding the current functions. Are these two functions and should be added?

Issues

Supersedes and closes #257
Fixes #295

/cc @ambv @maxbrunsfeld

Exceptions -> support.type.exception
integer&float -> numeric
add @ and @= operator
@nathansobo nathansobo self-assigned this Apr 10, 2019
@nathansobo
Copy link
Contributor

nathansobo commented Apr 10, 2019

@Ben3eeE for declarative changes like this on an area you know well (such as TreeSitter languages), I'd feel comfortable with you merging at will if you don't get a timely review. So long as you're willing to help us out if you end up breaking something, which I think you're good for. Thanks for pushing this forward ❤️

@nathansobo nathansobo merged commit e76078d into master Apr 10, 2019
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@nathansobo nathansobo deleted the b3-more-stuff branch Apr 10, 2019
@Ben3eeE Ben3eeE mentioned this pull request Apr 13, 2019
2 of 2 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.