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

Add more scopes to the tree-sitter grammar #620

Merged
merged 7 commits into from
Nov 8, 2018
Merged

Conversation

Ben3eeE
Copy link
Contributor

@Ben3eeE Ben3eeE commented Nov 1, 2018

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

/cc: @maxbrunsfeld

@Ben3eeE
Copy link
Contributor Author

Ben3eeE commented Nov 1, 2018

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

@chbk
Copy link

chbk commented Nov 1, 2018

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

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

@Ben3eeE
Copy link
Contributor Author

Ben3eeE commented Nov 1, 2018

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
Copy link

chbk commented Nov 1, 2018

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
Copy link
Contributor Author

Ben3eeE commented Nov 1, 2018

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
Copy link
Contributor Author

Ben3eeE commented Nov 9, 2018

@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