Skip to content

Commit e225a0d

Browse files
authored
fix: indented comment syntax highlighting (#335)
1 parent 21ae71f commit e225a0d

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

vscode-extension/languages/sass.tmLanguage.json

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,9 @@
217217
{
218218
"include": "#comment_line"
219219
},
220+
{
221+
"include": "#comment_end_of_line"
222+
},
220223
{
221224
"include": "#comment_block"
222225
}
@@ -313,6 +316,9 @@
313316
},
314317
{
315318
"include": "#comment_line"
319+
},
320+
{
321+
"include": "#comment_end_of_line"
316322
}
317323
]
318324
},
@@ -549,6 +555,9 @@
549555
{
550556
"include": "#comment_line"
551557
},
558+
{
559+
"include": "#comment_end_of_line"
560+
},
552561
{
553562
"match": "\\b(only)\\b",
554563
"name": "keyword.control.operator.css.sass"
@@ -840,6 +849,9 @@
840849
{
841850
"include": "#comment_line"
842851
},
852+
{
853+
"include": "#comment_end_of_line"
854+
},
843855
{
844856
"include": "#comment_block"
845857
},
@@ -946,13 +958,23 @@
946958
"name": "comment.block.sass"
947959
},
948960
"comment_line": {
949-
"begin": "//",
961+
"begin": "^([ \\t]*)(//)",
962+
"while": "^\\1(\\s|\\t)+.*$",
950963
"beginCaptures": {
951964
"0": {
952965
"name": "punctuation.definition.comment.sass"
953966
}
954967
},
968+
"name": "comment.line.sass"
969+
},
970+
"comment_end_of_line": {
971+
"begin": "//",
955972
"end": "\\n",
973+
"captures": {
974+
"0": {
975+
"name": "punctuation.definition.comment.sass"
976+
}
977+
},
956978
"name": "comment.line.sass"
957979
},
958980
"constant_default": {
@@ -1107,6 +1129,9 @@
11071129
},
11081130
{
11091131
"include": "#comment_line"
1132+
},
1133+
{
1134+
"include": "#comment_end_of_line"
11101135
}
11111136
]
11121137
},
@@ -1175,6 +1200,9 @@
11751200
{
11761201
"include": "#comment_line"
11771202
},
1203+
{
1204+
"include": "#comment_end_of_line"
1205+
},
11781206
{
11791207
"match": "\\b([\\w-]+)\\s*(:)",
11801208
"captures": {
@@ -1766,6 +1794,9 @@
17661794
{
17671795
"include": "#comment_line"
17681796
},
1797+
{
1798+
"include": "#comment_end_of_line"
1799+
},
17691800
{
17701801
"include": "#map"
17711802
},

0 commit comments

Comments
 (0)