You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This is a rewrite of the Tree-sitter grammar to implement naming conventions for syntax scopes.
Currently, Atom uses the TextMate grammar because the Tree-sitter grammar is lacking. This PR thoroughly updates the Tree-sitter grammar to be fully functional.
Benefits
Many new scopes added to make the grammar explicit and exhaustive.
Notable improvements on punctuation, selectors and built-ins.
Highlighting to be consistent with other languages.
Possible Drawbacks
The changes aim to facilitate theme development, filling the template is enough to ensure coherent highlighting across languages, instead of painfully creating styling rules for every language separately.
Regex grammar scopes vs homogenized Tree-sitter grammar scopes:
This looks like a valiant project. I like the idea. I haven't created themes before, so please enlighten me: if this gets accepted, won't themes break?
Default themes have been updated already so they'll work fine with this PR. For other community themes, it depends on what the merging strategy is:
Merge the PR as is and keep the Regex grammar as the default (just like it is now).
Merge the PR as is and make the Tree-sitter grammar the default. Users that wish to use the legacy Regex grammars can do so in their editor's settings (there's a checkbox for that).
Merge the PR after adding the legacy scopes. I'm happy to do it if needed.
The TextMate documentation doesn't provide many useful scopes for CSS, so the scopes I listed above seem to have emerged from some sort of genetic process, selecting what works with existing themes. It's blatant with support.type.property-name for example, which is not a type at all, or entity.other.attribute-name.id which is not an attribute name. This is what makes creating a theme so difficult, the inconsistencies require you to check what works with each language individually.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
None yet
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the Change
This is a rewrite of the Tree-sitter grammar to implement naming conventions for syntax scopes.
Currently, Atom uses the TextMate grammar because the Tree-sitter grammar is lacking. This PR thoroughly updates the Tree-sitter grammar to be fully functional.
Benefits
Possible Drawbacks
The changes aim to facilitate theme development, filling the template is enough to ensure coherent highlighting across languages, instead of painfully creating styling rules for every language separately.
Regex grammar scopes vs homogenized Tree-sitter grammar scopes:
support.constant.property-value->constant.style.supportentity.other.keyframe-offset->constant.offsetsupport.type.property-name->entity.property.supportvariable.parameter.keyframe-list->entity.keyframesentity.name.tag->entity.selector.tagentity.other.attribute-name.class->entity.selector.classentity.other.attribute-name.id->entity.selector.identity.other.attribute-name.pseudo-class->entity.selector.pseudo-classentity.other.attribute-name.pseudo-element->entity.selector.pseudo-elemententity.other.attribute-name->entity.selector.attributeApplicable Issues
Related Pull Requests