slackhq / tree-sitter-hack

Hack grammar for tree-sitter
MIT License
33 stars 15 forks source link

Add syntax highlighting queries #39

Closed Wilfred closed 2 years ago

Wilfred commented 2 years ago

Summary

Add basic syntax highlighting for comments, strings, common keywords and types.

Requirements (place an x in each [ ])

CLAassistant commented 2 years ago

CLA assistant check
All committers have signed the CLA.

brownierin commented 2 years ago

Thanks for contributing! My apologies for the delay; a good chunk of this grammar was written during internships last summer, and we're getting back into the swing of it now.

We haven't done much with syntax highlighting in this tree-sitter grammar as we're using it to parse hack code for use with Semgrep. Based on the docs, this looks good to me. I also ran tree-sitter highlight on some of our test hack files; it's outputting correctly. :+1:

frankeld commented 2 years ago

Thanks for this contribution! I will add that as we expand syntax highlighting, we might want to consider adding tests, along with organizing our .scm files with headers (ex. ; Keywords) consistent with the other tree-sitter packages.

We will also want to update language configuration (especially language detection) to support hack files as described here: https://tree-sitter.github.io/tree-sitter/syntax-highlighting#language-configuration