Skip to content

Commit f81cd91

Browse files
chore: upgrade language configurations (#1)
1 parent 2333b3b commit f81cd91

File tree

5 files changed

+50
-8
lines changed

5 files changed

+50
-8
lines changed

grammars/css/language-configuration.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,10 @@
2626
"start": "^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\/",
2727
"end": "^\\s*\\/\\*\\s*#endregion\\b.*\\*\\/"
2828
}
29-
}
29+
},
30+
"indentationRules": {
31+
"increaseIndentPattern": "(^.*\\{[^}]*$)",
32+
"decreaseIndentPattern": "^\\s*\\}"
33+
},
34+
"wordPattern": "(#?-?\\d*\\.\\d\\w*%?)|(::?[\\w-]*(?=[^,{;]*[,{]))|(([@#.!])?[\\w-?]+%?|[@#!.])"
3035
}

grammars/html/language-configuration.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,31 @@
2929
"start": "^\\s*<!--\\s*#region\\b.*-->",
3030
"end": "^\\s*<!--\\s*#endregion\\b.*-->"
3131
}
32+
},
33+
"wordPattern": "(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\$\\^\\&\\*\\(\\)\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\s]+)",
34+
"onEnterRules": [
35+
{
36+
"beforeText": {
37+
"pattern": "<(?!(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr))([_:\\w][_:\\w-.\\d]*)([^/>]*(?!\\/)>)[^<]*$",
38+
"flags": "i"
39+
},
40+
"afterText": { "pattern": "^<\\/([_:\\w][_:\\w-.\\d]*)\\s*>", "flags": "i" },
41+
"action": {
42+
"indent": "indentOutdent"
43+
}
44+
},
45+
{
46+
"beforeText": {
47+
"pattern": "<(?!(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr))(\\w[\\w\\d]*)([^/>]*(?!\\/)>)[^<]*$",
48+
"flags": "i"
49+
},
50+
"action": {
51+
"indent": "indent"
52+
}
53+
}
54+
],
55+
"indentationRules": {
56+
"increaseIndentPattern": "<(?!\\?|(?:area|base|br|col|frame|hr|html|img|input|keygen|link|menuitem|meta|param|source|track|wbr)\\b|[^>]*\\/>)([-_\\.A-Za-z0-9]+)(?=\\s|>)\\b[^>]*>(?!.*<\\/\\1>)|<!--(?!.*-->)|\\{[^}\"']*$",
57+
"decreaseIndentPattern": "^\\s*(<\\/(?!html)[-_\\.A-Za-z0-9]+\\b[^>]*>|-->|\\})"
3258
}
3359
}

grammars/json/language-configuration.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,10 @@
1414
{ "open": "'", "close": "'", "notIn": ["string"] },
1515
{ "open": "\"", "close": "\"", "notIn": ["string", "comment"] },
1616
{ "open": "`", "close": "`", "notIn": ["string", "comment"] }
17-
]
17+
],
18+
"wordPattern": "(\"(?:[^\\\\\\\"]*(?:\\\\.)?)*\"?)|[^\\s{}\\[\\],:]+",
19+
"indentationRules": {
20+
"increaseIndentPattern": "({+(?=([^\"]*\"[^\"]*\")*[^\"}]*$))|(\\[+(?=([^\"]*\"[^\"]*\")*[^\"\\]]*$))",
21+
"decreaseIndentPattern": "^\\s*[}\\]],?\\s*$"
22+
}
1823
}

grammars/less/language-configuration.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,15 @@
2222
["\"", "\""],
2323
["'", "'"]
2424
],
25-
"indentationRules": {
26-
"increaseIndentPattern": "(^.*\\{[^}]*$)",
27-
"decreaseIndentPattern": "^\\s*\\}"
28-
},
2925
"folding": {
3026
"markers": {
3127
"start": "^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\/",
3228
"end": "^\\s*\\/\\*\\s*#endregion\\b.*\\*\\/"
3329
}
34-
}
30+
},
31+
"indentationRules": {
32+
"increaseIndentPattern": "(^.*\\{[^}]*$)",
33+
"decreaseIndentPattern": "^\\s*\\}"
34+
},
35+
"wordPattern": "(#?-?\\d*\\.\\d\\w*%?)|(::?[\\w-]+(?=[^,{;]*[,{]))|(([@#.!])?[\\w-?]+%?|[@#!.])"
3536
}

grammars/scss/language-configuration.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,10 @@
2727
"start": "^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\/",
2828
"end": "^\\s*\\/\\*\\s*#endregion\\b.*\\*\\/"
2929
}
30-
}
30+
},
31+
"indentationRules": {
32+
"increaseIndentPattern": "(^.*\\{[^}]*$)",
33+
"decreaseIndentPattern": "^\\s*\\}"
34+
},
35+
"wordPattern": "(#?-?\\d*\\.\\d\\w*%?)|(::?[\\w-]*(?=[^,{;]*[,{]))|(([@$#.!])?[\\w-?]+%?|[@#!$.])"
3136
}

0 commit comments

Comments
 (0)