Use new tree-sitter highlight API in property sheets

This commit is contained in:
Max Brunsfeld 2019-05-10 09:16:19 -07:00
parent 95500a29f8
commit a1df9b785c
3 changed files with 88 additions and 88 deletions

View File

@ -1,26 +1,26 @@
@import "./injections.css"; @import "./injections.css";
tag_name { tag_name {
scope: 'tag'; highlight: 'tag';
} }
/* TODO - highlight as an error? */ /* TODO - highlight as an error? */
erroneous_end_tag_name { erroneous_end_tag_name {
scope: 'tag'; highlight: 'tag';
} }
doctype { doctype {
scope: 'constant'; highlight: 'constant';
} }
attribute_name { attribute_name {
scope: 'attribute'; highlight: 'attribute';
} }
attribute_value { attribute_value {
scope: 'string'; highlight: 'string';
} }
comment { comment {
scope: 'comment'; highlight: 'comment';
} }

View File

@ -5,7 +5,7 @@
"property_set_id": 0, "property_set_id": 0,
"transitions": [ "transitions": [
{ {
"type": "attribute_name", "type": "comment",
"named": true, "named": true,
"state_id": 1 "state_id": 1
}, },
@ -15,7 +15,7 @@
"state_id": 2 "state_id": 2
}, },
{ {
"type": "comment", "type": "attribute_name",
"named": true, "named": true,
"state_id": 3 "state_id": 3
}, },
@ -30,19 +30,19 @@
"state_id": 5 "state_id": 5
}, },
{ {
"type": "script_element", "type": "tag_name",
"named": true, "named": true,
"state_id": 6 "state_id": 5
}, },
{ {
"type": "style_element", "type": "style_element",
"named": true, "named": true,
"state_id": 7 "state_id": 6
}, },
{ {
"type": "tag_name", "type": "script_element",
"named": true, "named": true,
"state_id": 5 "state_id": 7
} }
], ],
"default_next_state_id": 0 "default_next_state_id": 0
@ -52,7 +52,7 @@
"property_set_id": 1, "property_set_id": 1,
"transitions": [ "transitions": [
{ {
"type": "attribute_name", "type": "comment",
"named": true, "named": true,
"state_id": 1 "state_id": 1
}, },
@ -62,7 +62,7 @@
"state_id": 2 "state_id": 2
}, },
{ {
"type": "comment", "type": "attribute_name",
"named": true, "named": true,
"state_id": 3 "state_id": 3
}, },
@ -77,19 +77,19 @@
"state_id": 5 "state_id": 5
}, },
{ {
"type": "script_element", "type": "tag_name",
"named": true, "named": true,
"state_id": 6 "state_id": 5
}, },
{ {
"type": "style_element", "type": "style_element",
"named": true, "named": true,
"state_id": 7 "state_id": 6
}, },
{ {
"type": "tag_name", "type": "script_element",
"named": true, "named": true,
"state_id": 5 "state_id": 7
} }
], ],
"default_next_state_id": 0 "default_next_state_id": 0
@ -99,7 +99,7 @@
"property_set_id": 2, "property_set_id": 2,
"transitions": [ "transitions": [
{ {
"type": "attribute_name", "type": "comment",
"named": true, "named": true,
"state_id": 1 "state_id": 1
}, },
@ -109,7 +109,7 @@
"state_id": 2 "state_id": 2
}, },
{ {
"type": "comment", "type": "attribute_name",
"named": true, "named": true,
"state_id": 3 "state_id": 3
}, },
@ -124,19 +124,19 @@
"state_id": 5 "state_id": 5
}, },
{ {
"type": "script_element", "type": "tag_name",
"named": true, "named": true,
"state_id": 6 "state_id": 5
}, },
{ {
"type": "style_element", "type": "style_element",
"named": true, "named": true,
"state_id": 7 "state_id": 6
}, },
{ {
"type": "tag_name", "type": "script_element",
"named": true, "named": true,
"state_id": 5 "state_id": 7
} }
], ],
"default_next_state_id": 0 "default_next_state_id": 0
@ -146,7 +146,7 @@
"property_set_id": 3, "property_set_id": 3,
"transitions": [ "transitions": [
{ {
"type": "attribute_name", "type": "comment",
"named": true, "named": true,
"state_id": 1 "state_id": 1
}, },
@ -156,7 +156,7 @@
"state_id": 2 "state_id": 2
}, },
{ {
"type": "comment", "type": "attribute_name",
"named": true, "named": true,
"state_id": 3 "state_id": 3
}, },
@ -171,19 +171,19 @@
"state_id": 5 "state_id": 5
}, },
{ {
"type": "script_element", "type": "tag_name",
"named": true, "named": true,
"state_id": 6 "state_id": 5
}, },
{ {
"type": "style_element", "type": "style_element",
"named": true, "named": true,
"state_id": 7 "state_id": 6
}, },
{ {
"type": "tag_name", "type": "script_element",
"named": true, "named": true,
"state_id": 5 "state_id": 7
} }
], ],
"default_next_state_id": 0 "default_next_state_id": 0
@ -193,7 +193,7 @@
"property_set_id": 4, "property_set_id": 4,
"transitions": [ "transitions": [
{ {
"type": "attribute_name", "type": "comment",
"named": true, "named": true,
"state_id": 1 "state_id": 1
}, },
@ -203,7 +203,7 @@
"state_id": 2 "state_id": 2
}, },
{ {
"type": "comment", "type": "attribute_name",
"named": true, "named": true,
"state_id": 3 "state_id": 3
}, },
@ -218,19 +218,19 @@
"state_id": 5 "state_id": 5
}, },
{ {
"type": "script_element", "type": "tag_name",
"named": true, "named": true,
"state_id": 6 "state_id": 5
}, },
{ {
"type": "style_element", "type": "style_element",
"named": true, "named": true,
"state_id": 7 "state_id": 6
}, },
{ {
"type": "tag_name", "type": "script_element",
"named": true, "named": true,
"state_id": 5 "state_id": 7
} }
], ],
"default_next_state_id": 0 "default_next_state_id": 0
@ -240,7 +240,7 @@
"property_set_id": 5, "property_set_id": 5,
"transitions": [ "transitions": [
{ {
"type": "attribute_name", "type": "comment",
"named": true, "named": true,
"state_id": 1 "state_id": 1
}, },
@ -250,7 +250,7 @@
"state_id": 2 "state_id": 2
}, },
{ {
"type": "comment", "type": "attribute_name",
"named": true, "named": true,
"state_id": 3 "state_id": 3
}, },
@ -265,19 +265,19 @@
"state_id": 5 "state_id": 5
}, },
{ {
"type": "script_element", "type": "tag_name",
"named": true, "named": true,
"state_id": 6 "state_id": 5
}, },
{ {
"type": "style_element", "type": "style_element",
"named": true, "named": true,
"state_id": 7 "state_id": 6
}, },
{ {
"type": "tag_name", "type": "script_element",
"named": true, "named": true,
"state_id": 5 "state_id": 7
} }
], ],
"default_next_state_id": 0 "default_next_state_id": 0
@ -287,7 +287,7 @@
"property_set_id": 6, "property_set_id": 6,
"transitions": [ "transitions": [
{ {
"type": "attribute_name", "type": "comment",
"named": true, "named": true,
"state_id": 1 "state_id": 1
}, },
@ -297,7 +297,7 @@
"state_id": 2 "state_id": 2
}, },
{ {
"type": "comment", "type": "attribute_name",
"named": true, "named": true,
"state_id": 3 "state_id": 3
}, },
@ -312,19 +312,19 @@
"state_id": 5 "state_id": 5
}, },
{ {
"type": "script_element", "type": "tag_name",
"named": true, "named": true,
"state_id": 6 "state_id": 5
}, },
{ {
"type": "style_element", "type": "style_element",
"named": true, "named": true,
"state_id": 7 "state_id": 6
}, },
{ {
"type": "tag_name", "type": "script_element",
"named": true, "named": true,
"state_id": 5 "state_id": 7
} }
], ],
"default_next_state_id": 0 "default_next_state_id": 0
@ -334,7 +334,7 @@
"property_set_id": 7, "property_set_id": 7,
"transitions": [ "transitions": [
{ {
"type": "attribute_name", "type": "comment",
"named": true, "named": true,
"state_id": 1 "state_id": 1
}, },
@ -344,7 +344,7 @@
"state_id": 2 "state_id": 2
}, },
{ {
"type": "comment", "type": "attribute_name",
"named": true, "named": true,
"state_id": 3 "state_id": 3
}, },
@ -359,19 +359,19 @@
"state_id": 5 "state_id": 5
}, },
{ {
"type": "script_element", "type": "tag_name",
"named": true, "named": true,
"state_id": 6 "state_id": 5
}, },
{ {
"type": "style_element", "type": "style_element",
"named": true, "named": true,
"state_id": 7 "state_id": 6
}, },
{ {
"type": "tag_name", "type": "script_element",
"named": true, "named": true,
"state_id": 5 "state_id": 7
} }
], ],
"default_next_state_id": 0 "default_next_state_id": 0
@ -380,32 +380,19 @@
"property_sets": [ "property_sets": [
{}, {},
{ {
"scope": "attribute" "highlight": "comment"
}, },
{ {
"scope": "string" "highlight": "string"
}, },
{ {
"scope": "comment" "highlight": "attribute"
}, },
{ {
"scope": "constant" "highlight": "constant"
}, },
{ {
"scope": "tag" "highlight": "tag"
},
{
"injection-content": {
"args": [
{
"args": [],
"name": "this"
},
1
],
"name": "child"
},
"injection-language": "javascript"
}, },
{ {
"injection-content": { "injection-content": {
@ -419,6 +406,19 @@
"name": "child" "name": "child"
}, },
"injection-language": "css" "injection-language": "css"
},
{
"injection-content": {
"args": [
{
"args": [],
"name": "this"
},
1
],
"name": "child"
},
"injection-language": "javascript"
} }
] ]
} }

View File

@ -5,12 +5,12 @@
"property_set_id": 0, "property_set_id": 0,
"transitions": [ "transitions": [
{ {
"type": "script_element", "type": "style_element",
"named": true, "named": true,
"state_id": 1 "state_id": 1
}, },
{ {
"type": "style_element", "type": "script_element",
"named": true, "named": true,
"state_id": 2 "state_id": 2
} }
@ -22,12 +22,12 @@
"property_set_id": 1, "property_set_id": 1,
"transitions": [ "transitions": [
{ {
"type": "script_element", "type": "style_element",
"named": true, "named": true,
"state_id": 1 "state_id": 1
}, },
{ {
"type": "style_element", "type": "script_element",
"named": true, "named": true,
"state_id": 2 "state_id": 2
} }
@ -39,12 +39,12 @@
"property_set_id": 2, "property_set_id": 2,
"transitions": [ "transitions": [
{ {
"type": "script_element", "type": "style_element",
"named": true, "named": true,
"state_id": 1 "state_id": 1
}, },
{ {
"type": "style_element", "type": "script_element",
"named": true, "named": true,
"state_id": 2 "state_id": 2
} }
@ -65,7 +65,7 @@
], ],
"name": "child" "name": "child"
}, },
"injection-language": "javascript" "injection-language": "css"
}, },
{ {
"injection-content": { "injection-content": {
@ -78,7 +78,7 @@
], ],
"name": "child" "name": "child"
}, },
"injection-language": "css" "injection-language": "javascript"
} }
] ]
} }