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

Add more scopes to the tree-sitter grammar - #620

Merged
maxbrunsfeld merged 7 commits into
masterfrom
b3-more-scopes
Nov 8, 2018
Merged

maxbrunsfeld merged 7 commits into
masterfrom
b3-more-scopes

Conversation

@Ben3eeE

@Ben3eeE Ben3eeE commented Nov 1, 2018 •

Copy link
Copy Markdown
Contributor

Fixes #619
Fixes #617
Fixes #616
Fixes #566

/cc: @maxbrunsfeld

@Ben3eeE

Ben3eeE commented Nov 1, 2018

Copy link
Copy Markdown
Contributor Author

@chbk This fixes the issues you reported earlier except default is staying scoped as keyword.control

@chbk

chbk commented Nov 1, 2018

Copy link
Copy Markdown

Great! I tried out your PR and it fixes most issues except:

  • this is still source.js
  • super and super() are scoped differently

@Ben3eeE

Ben3eeE commented Nov 1, 2018

Copy link
Copy Markdown
Contributor Author

Yeah super() is a function call and is expected to be scoped differently, while super is a language variable and scoped as such,.

We scope:
call_expression > super as support.function
and super as variable.language

this is because I messed up when staging. Thanks for noticing and testing 👍 💯 Fixed in the latest commit.

@chbk

chbk commented Nov 1, 2018

Copy link
Copy Markdown

Alright, super() being scoped differently makes sense. Would it be possible be more specific then, with support.function.super for example? It would be nice to be able to highlight super the same way in both cases, even if they are syntactically different. After all they refer to the same parent class, super() calling its constructor and super accessing any of its methods.

@Ben3eeE

Ben3eeE commented Nov 1, 2018

Copy link
Copy Markdown
Contributor Author

I'm ok with making it support.function.super. It still looks the same with one-dark-syntax and one-light-syntax.

@maxbrunsfeld I think this is ready for review now 😅

@maxbrunsfeld
maxbrunsfeld merged commit f5706d5 into master Nov 8, 2018
maxbrunsfeld added a commit to atom/language-typescript that referenced this pull request Nov 8, 2018
@Ben3eeE

Ben3eeE commented Nov 9, 2018

Copy link
Copy Markdown
Contributor Author

@chbk We removed some scope mappings for language.variable before merging this to get the other changes out in Atom 1.32.2. language.variable is awaiting review of atom/atom#18383 before we change them.

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.

3 participants