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 go grammar #158

merged 6 commits into from Oct 29, 2018


None yet
2 participants

Ben3eeE commented Oct 29, 2018


  • default in this program does not get parsed with an anonymous node and is not highlighted
  • true and false is not highlighted. They are constant.language.go in textmate
  • The % part of interpreted_string_literal is not highlighted differently. It's constant.other.placeholder.go in textmate:
fmt.Printf("Don't know type %T\n", t)


  • Test everything


  • Scope go as keyword.control
  • Scope imaginary_literal as constant.numeric.integer
  • Scope float_literal as constant.numeric.float
  • Scope all operators as keyword.operator

/cc: @maxbrunsfeld

Ben3eeE added some commits Oct 29, 2018


This comment has been minimized.


maxbrunsfeld commented Oct 29, 2018

I pushed an update to tree-sitter-go that addresses some issues:

  • There should now be an anonymous default node, so default in switch statements should get colored.
  • There are now separate true and false nodes

I would say we should probably merge this even without the % changes. I want to do something about those, but I'm not exactly sure what yet. They're a bit like the word TODO in a comment - something that's not really part of the language's syntax, so is maybe suitable for an injection. But like TODO, it seems like we need some lighter-weight kind of injection, which doesn't involve creating an entirely separate parser.

@Ben3eeE Ben3eeE merged commit b4ac7f5 into master Oct 29, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
continuous-integration/travis-ci/pr The Travis CI build passed

@Ben3eeE Ben3eeE deleted the b3-tree-sitter-scopes branch Oct 29, 2018


This comment has been minimized.


Ben3eeE commented Oct 29, 2018

Nice, yeah it seems like we have this problem in other languages as well. The %. Like in Python {} is not highlighted in a string /cc: atom/language-python#281 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment