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

Conversation

Projects
None yet
2 participants
@Ben3eeE
Copy link
Member

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

Add more scopes to the tree sitter grammar
Exceptions -> support.type.exception
integer&float -> numeric
add @ and @= operator

@Ben3eeE Ben3eeE referenced this pull request Mar 11, 2019

Closed

Numbers do not have numeric scope/class with tree-sitters #295

1 of 1 task complete

@nathansobo nathansobo self-assigned this Apr 10, 2019

@nathansobo

This comment has been minimized.

Copy link
Contributor

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

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 referenced this pull request Apr 13, 2019

Merged

Add tree-sitter json grammar #68

2 of 2 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.