-
Notifications
You must be signed in to change notification settings - Fork 140
Conversation
|
The failing CI doesn't appear to be related to any changes introduced in this PR. Also, I neglected to add unit tests because the existing spec tests only the TM-style grammar. If there's a way to unit-test the tree-sitter grammar, I'm all for starting. |
|
Thanks @savetheclocktower 🙇
Just to double check, did you mean #224? |
|
I did indeed. Updated the PR description. |
I re-ran the build and it's passing now. 😅
We recently added some specs for the Tree-sitter grammar in atom/language-ruby (atom/language-ruby@c616809). Those specs might offer a starting point for you if you're up for adding some specs for the changes in this pull request. |
|
Done! That was easier than I envisioned. |
|
Thanks for adding these specs, @savetheclocktower. ⚡🙇 And thanks for verifying these edge cases. language-html/spec/tree-sitter-spec.js Lines 53 to 79 in c41dd49
😍 |
Add scopes for punctuation
Description of the Change
Adds appropriate
punctuationscopes to the following characters:<p>)=between an attribute’s name and valueAlternate Designs
None that I can see. This is how tree-sitter grammars are meant to work.
I intentionally left off the
.htmlat the ends of each scope name. This shouldn’t be necessary in order to target HTML-specific punctuation in a syntax theme, even when dealing with HTML injected into another source file.Benefits
The
tree-sitter-htmlgrammar was not addingpunctuationscopes to HTML documents. This means that it was impossible (or highly impractical) to style these punctuation marks in any way that distinguished them from ordinary, unscoped text. See #224.Possible Drawbacks
Opening Pandora’s box, perhaps? But this is just about inching the tree-sitter grammar toward feature parity with its TM-style sibling.
Applicable Issues
Fixes #224.