Add queries for syntax highlighting (#12)
* Add queries for syntax highlighting
* 🔥 property sheets
This commit is contained in:
parent
d99b24e035
commit
47841b3f8e
@ -29,7 +29,6 @@
|
|||||||
"file-types": [
|
"file-types": [
|
||||||
"html"
|
"html"
|
||||||
],
|
],
|
||||||
"highlights": "src/highlights.json",
|
|
||||||
"injection-regex": "html"
|
"injection-regex": "html"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -1,26 +0,0 @@
|
|||||||
@import "./injections.css";
|
|
||||||
|
|
||||||
tag_name {
|
|
||||||
highlight: 'tag';
|
|
||||||
}
|
|
||||||
|
|
||||||
/* TODO - highlight as an error? */
|
|
||||||
erroneous_end_tag_name {
|
|
||||||
highlight: 'tag';
|
|
||||||
}
|
|
||||||
|
|
||||||
doctype {
|
|
||||||
highlight: 'constant';
|
|
||||||
}
|
|
||||||
|
|
||||||
attribute_name {
|
|
||||||
highlight: 'attribute';
|
|
||||||
}
|
|
||||||
|
|
||||||
attribute_value {
|
|
||||||
highlight: 'string';
|
|
||||||
}
|
|
||||||
|
|
||||||
comment {
|
|
||||||
highlight: 'comment';
|
|
||||||
}
|
|
@ -1,9 +0,0 @@
|
|||||||
script_element {
|
|
||||||
injection-language: 'javascript';
|
|
||||||
injection-content: child(this(), 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
style_element {
|
|
||||||
injection-language: 'css';
|
|
||||||
injection-content: child(this(), 1);
|
|
||||||
}
|
|
10
queries/highlights.scm
Normal file
10
queries/highlights.scm
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
(tag_name) @tag
|
||||||
|
(erroneous_end_tag_name) @tag.error
|
||||||
|
(doctype) @constant
|
||||||
|
(attribute_name) @attribute
|
||||||
|
(attribute_value) @string
|
||||||
|
(comment) @comment
|
||||||
|
|
||||||
|
"<" @punctuation.bracket
|
||||||
|
">" @punctuation.bracket
|
||||||
|
"</" @punctuation.bracket
|
7
queries/injections.scm
Normal file
7
queries/injections.scm
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
((script_element
|
||||||
|
(raw_text) @injection.content) @injection.site
|
||||||
|
(set! injection.language "javascript"))
|
||||||
|
|
||||||
|
((style_element
|
||||||
|
(raw_text) @injection.content) @injection.site
|
||||||
|
(set! injection.language "css"))
|
@ -1,137 +0,0 @@
|
|||||||
{
|
|
||||||
"states": [
|
|
||||||
{
|
|
||||||
"id": 0,
|
|
||||||
"property_set_id": 0,
|
|
||||||
"transitions": [
|
|
||||||
{
|
|
||||||
"type": "comment",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "attribute_value",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 2
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "attribute_name",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 3
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "doctype",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 4
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "erroneous_end_tag_name",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 5
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "tag_name",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 5
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "style_element",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 6
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "script_element",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 7
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"default_next_state_id": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"property_set_id": 1,
|
|
||||||
"transitions": [],
|
|
||||||
"default_next_state_id": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 2,
|
|
||||||
"property_set_id": 2,
|
|
||||||
"transitions": [],
|
|
||||||
"default_next_state_id": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 3,
|
|
||||||
"property_set_id": 3,
|
|
||||||
"transitions": [],
|
|
||||||
"default_next_state_id": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 4,
|
|
||||||
"property_set_id": 4,
|
|
||||||
"transitions": [],
|
|
||||||
"default_next_state_id": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 5,
|
|
||||||
"property_set_id": 5,
|
|
||||||
"transitions": [],
|
|
||||||
"default_next_state_id": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 6,
|
|
||||||
"property_set_id": 6,
|
|
||||||
"transitions": [],
|
|
||||||
"default_next_state_id": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 7,
|
|
||||||
"property_set_id": 7,
|
|
||||||
"transitions": [],
|
|
||||||
"default_next_state_id": 0
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"property_sets": [
|
|
||||||
{},
|
|
||||||
{
|
|
||||||
"highlight": "comment"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"highlight": "string"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"highlight": "attribute"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"highlight": "constant"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"highlight": "tag"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"injection-content": {
|
|
||||||
"args": [
|
|
||||||
{
|
|
||||||
"args": [],
|
|
||||||
"name": "this"
|
|
||||||
},
|
|
||||||
1
|
|
||||||
],
|
|
||||||
"name": "child"
|
|
||||||
},
|
|
||||||
"injection-language": "css"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"injection-content": {
|
|
||||||
"args": [
|
|
||||||
{
|
|
||||||
"args": [],
|
|
||||||
"name": "this"
|
|
||||||
},
|
|
||||||
1
|
|
||||||
],
|
|
||||||
"name": "child"
|
|
||||||
},
|
|
||||||
"injection-language": "javascript"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,62 +0,0 @@
|
|||||||
{
|
|
||||||
"states": [
|
|
||||||
{
|
|
||||||
"id": 0,
|
|
||||||
"property_set_id": 0,
|
|
||||||
"transitions": [
|
|
||||||
{
|
|
||||||
"type": "style_element",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "script_element",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 2
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"default_next_state_id": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"property_set_id": 1,
|
|
||||||
"transitions": [],
|
|
||||||
"default_next_state_id": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 2,
|
|
||||||
"property_set_id": 2,
|
|
||||||
"transitions": [],
|
|
||||||
"default_next_state_id": 0
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"property_sets": [
|
|
||||||
{},
|
|
||||||
{
|
|
||||||
"injection-content": {
|
|
||||||
"args": [
|
|
||||||
{
|
|
||||||
"args": [],
|
|
||||||
"name": "this"
|
|
||||||
},
|
|
||||||
1
|
|
||||||
],
|
|
||||||
"name": "child"
|
|
||||||
},
|
|
||||||
"injection-language": "css"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"injection-content": {
|
|
||||||
"args": [
|
|
||||||
{
|
|
||||||
"args": [],
|
|
||||||
"name": "this"
|
|
||||||
},
|
|
||||||
1
|
|
||||||
],
|
|
||||||
"name": "child"
|
|
||||||
},
|
|
||||||
"injection-language": "javascript"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user