Skip to content

Commit 2d96e05

Browse files
committed
feat: basic syntax highlighting
1 parent 0ba9419 commit 2d96e05

File tree

3 files changed

+43
-36
lines changed

3 files changed

+43
-36
lines changed

language-configuration.json

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
11
{
22
"comments": {
3-
// symbol used for single line comment. Remove this entry if your language does not support line comments
4-
"lineComment": "//",
5-
// symbols used for start and end a block comment. Remove this entry if your language does not support block comments
6-
"blockComment": ["/*", "*/"]
3+
"lineComment": "//"
74
},
8-
// symbols used as brackets
9-
"brackets": [
10-
["{", "}"],
11-
["[", "]"],
12-
["(", ")"]
13-
],
5+
"brackets": [["(", ")"]],
146
// symbols that are auto closed when typing
157
"autoClosingPairs": [
168
["{", "}"],
@@ -21,8 +13,6 @@
2113
],
2214
// symbols that can be used to surround a selection
2315
"surroundingPairs": [
24-
["{", "}"],
25-
["[", "]"],
2616
["(", ")"],
2717
["\"", "\""],
2818
["'", "'"]

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "vscode-hsml",
2+
"name": "hsml",
33
"displayName": "hsml",
44
"description": "hsml support for Visual Studio Code",
55
"version": "0.1.0",
@@ -28,7 +28,7 @@
2828
"grammars": [
2929
{
3030
"language": "hsml",
31-
"scopeName": "index.hsml",
31+
"scopeName": "text.hsml",
3232
"path": "./syntaxes/hsml.tmLanguage.json"
3333
}
3434
]

syntaxes/hsml.tmLanguage.json

Lines changed: 39 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,49 @@
33
"name": "hsml",
44
"patterns": [
55
{
6-
"include": "#keywords"
6+
"name": "string.comment.buffered.block.hsml",
7+
"comment": "html comment",
8+
"begin": "//!",
9+
"end": "$"
710
},
811
{
9-
"include": "#strings"
10-
}
11-
],
12-
"repository": {
13-
"keywords": {
14-
"patterns": [
15-
{
16-
"name": "keyword.control.hsml",
17-
"match": "\\b(if|while|for|return)\\b"
12+
"name": "comment.line.double-slash.hsml",
13+
"comment": "hsml developer comment",
14+
"begin": "//",
15+
"end": "$"
16+
},
17+
{
18+
"name": "entity.name.tag.hsml",
19+
"comment": "hsml tag name",
20+
"match": "^\\s*([a-z]+)(?=[\\.\\(\\s])"
21+
},
22+
{
23+
"name": "punctuation.class.hsml",
24+
"comment": "hsml punctuated class",
25+
"match": "(\\.)([\\w\\:\\-\\[\\]\\#\\/]+)(?=[\\.\\(\\s])",
26+
"captures": {
27+
"0": {
28+
"name": "entity.other.attribute-name.class.css.hsml"
29+
},
30+
"1": {
31+
"name": "meta.attribute-name.class.css.hsml"
1832
}
19-
]
33+
}
2034
},
21-
"strings": {
22-
"name": "string.quoted.double.hsml",
23-
"begin": "\"",
24-
"end": "\"",
25-
"patterns": [
26-
{
27-
"name": "constant.character.escape.hsml",
28-
"match": "\\\\."
35+
{
36+
"name": "punctuation.separator.key-value.hsml",
37+
"comment": "hsml attribute",
38+
"match": "([\\w\\-]+)=?(\".*\")",
39+
"captures": {
40+
"1": {
41+
"name": "entity.other.attribute-name.hsml"
42+
},
43+
"2": {
44+
"name": "string.quoted.double.hsml"
2945
}
30-
]
46+
}
3147
}
32-
},
33-
"scopeName": "index.hsml"
48+
],
49+
"repository": {},
50+
"scopeName": "text.hsml"
3451
}

0 commit comments

Comments
 (0)