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

Commit dd94394

Browse files
committed
Implement naming conventions
1 parent 8ab471d commit dd94394

File tree

3 files changed

+64
-46
lines changed

3 files changed

+64
-46
lines changed

grammars/tree-sitter-ejs.cson

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,17 @@ comments:
2323
end: '%>'
2424

2525
scopes:
26-
'comment_directive': 'comment.block'
27-
'comment_directive > "%>"': 'comment.block'
28-
29-
'"<%#"': 'keyword.control.directive'
30-
'"<%"': 'keyword.control.directive'
31-
'"<%="': 'keyword.control.directive'
32-
'"<%_"': 'keyword.control.directive'
33-
'"<%-"': 'keyword.control.directive'
34-
'"%>"': 'keyword.control.directive'
35-
'"-%>"': 'keyword.control.directive'
36-
'"_%>"': 'keyword.control.directive'
26+
'template': 'source.ejs'
27+
28+
'comment_directive': 'comment.block.html.ejs'
29+
30+
'"<%#"': 'punctuation.definition.comment.html.ejs'
31+
'comment_directive > "%>"': 'punctuation.definition.comment.html.ejs'
32+
33+
'"<%"': 'punctuation.delimiter.embedded.html.ejs'
34+
'"<%="': 'punctuation.delimiter.embedded.html.ejs'
35+
'"<%_"': 'punctuation.delimiter.embedded.html.ejs'
36+
'"<%-"': 'punctuation.delimiter.embedded.html.ejs'
37+
'"%>"': 'punctuation.delimiter.embedded.html.ejs'
38+
'"-%>"': 'punctuation.delimiter.embedded.html.ejs'
39+
'"_%>"': 'punctuation.delimiter.embedded.html.ejs'

grammars/tree-sitter-erb.cson

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,17 @@ comments:
2323
end: '%>'
2424

2525
scopes:
26-
'comment_directive': 'comment.block'
27-
'comment_directive > "%>"': 'comment.block'
28-
29-
'"<%#"': 'keyword.control.directive'
30-
'"<%"': 'keyword.control.directive'
31-
'"<%="': 'keyword.control.directive'
32-
'"<%_"': 'keyword.control.directive'
33-
'"<%-"': 'keyword.control.directive'
34-
'"%>"': 'keyword.control.directive'
35-
'"-%>"': 'keyword.control.directive'
36-
'"_%>"': 'keyword.control.directive'
26+
'template': 'source.erb'
27+
28+
'comment_directive': 'comment.block.html.erb'
29+
30+
'"<%#"': 'punctuation.definition.comment.html.erb'
31+
'comment_directive > "%>"': 'punctuation.definition.comment.html.erb'
32+
33+
'"<%"': 'punctuation.delimiter.embedded.html.erb'
34+
'"<%="': 'punctuation.delimiter.embedded.html.erb'
35+
'"<%_"': 'punctuation.delimiter.embedded.html.erb'
36+
'"<%-"': 'punctuation.delimiter.embedded.html.erb'
37+
'"%>"': 'punctuation.delimiter.embedded.html.erb'
38+
'"-%>"': 'punctuation.delimiter.embedded.html.erb'
39+
'"_%>"': 'punctuation.delimiter.embedded.html.erb'

grammars/tree-sitter-html.cson

Lines changed: 36 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -28,29 +28,41 @@ comments:
2828

2929
scopes:
3030
'fragment': 'source.html'
31-
'tag_name': 'entity.name.tag'
32-
'erroneous_end_tag_name': 'invalid.illegal'
33-
'doctype': 'meta.tag.doctype.html'
34-
'attribute_name': 'entity.other.attribute-name'
35-
'attribute_value': 'string.html'
31+
32+
# Entity
33+
'tag_name': 'entity.tag.html'
34+
'erroneous_end_tag_name': 'entity.tag.html.invalid.illegal'
35+
'attribute_name': 'entity.attribute.html'
36+
37+
# String
38+
'attribute > attribute_value': 'string.unquoted.attribute-value.html'
39+
'attribute > quoted_attribute_value': 'string.quoted.attribute-value.html'
40+
41+
# Text
42+
'text': 'text.html'
43+
44+
# Comment
3645
'comment': 'comment.block.html'
3746

38-
'
39-
start_tag > "<",
40-
end_tag > "</"
41-
': 'punctuation.definition.tag.begin'
42-
'
43-
start_tag > ">",
44-
end_tag > ">"
45-
': 'punctuation.definition.tag.end'
46-
47-
'attribute > "="': 'punctuation.separator.key-value.html'
48-
49-
# quoted_attribute_value has three child nodes: ", attribute_value, and ".
50-
# Target the first and last.
51-
# Single quotes and double quotes are targeted in separate selectors because
52-
# of quote-escaping difficulties.
53-
"quoted_attribute_value > '\"':nth-child(0)": 'punctuation.definition.string.begin'
54-
'quoted_attribute_value > "\'":nth-child(0)': 'punctuation.definition.string.begin'
55-
"quoted_attribute_value > '\"':nth-child(2)": 'punctuation.definition.string.end'
56-
'quoted_attribute_value > "\'":nth-child(2)': 'punctuation.definition.string.end'
47+
# Punctuation
48+
'"<"': 'punctuation.definition.tag.html'
49+
'"</"': 'punctuation.definition.tag.html'
50+
'">"': 'punctuation.definition.tag.html'
51+
'"/>"': 'punctuation.definition.tag.html'
52+
'"<!"': 'punctuation.definition.tag.doctype.html'
53+
'doctype > ">"': 'punctuation.definition.tag.doctype.html'
54+
'"\\""': 'punctuation.definition.string.html'
55+
'"\'"': 'punctuation.definition.string.html'
56+
'"="': 'punctuation.association.pair.attribute-value.html'
57+
58+
'ERROR > "<"': 'punctuation.definition.tag.html.invalid.illegal'
59+
'ERROR > "</"': 'punctuation.definition.tag.html.invalid.illegal'
60+
'ERROR > ">"': 'punctuation.definition.tag.html.invalid.illegal'
61+
'ERROR > "/>"': 'punctuation.definition.tag.html.invalid.illegal'
62+
'ERROR > "<!"': 'punctuation.definition.tag.doctype.html.invalid.illegal'
63+
'ERROR > "\\""': 'punctuation.definition.string.html.invalid.illegal'
64+
'ERROR > "\'"': 'punctuation.definition.string.html.invalid.illegal'
65+
'ERROR > "="': 'punctuation.association.pair.html.invalid.illegal'
66+
67+
# Meta
68+
'doctype': 'meta.doctype.html'

0 commit comments

Comments
 (0)