Skip to content

Commit 4d9b2fb

Browse files
authored
Auto close and indent comments (#815)
1 parent f549132 commit 4d9b2fb

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

Diff for: rescript.configuration.json

+22-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,12 @@
4040
[
4141
"`",
4242
"`"
43-
]
43+
],
44+
{
45+
"open": "/*",
46+
"close": " */",
47+
"notIn": ["string"]
48+
}
4449
],
4550
"surroundingPairs": [
4651
[
@@ -69,5 +74,20 @@
6974
"start": "^\\s*//\\s*#?region\\b",
7075
"end": "^\\s*//\\s*#?endregion\\b"
7176
}
72-
}
77+
},
78+
"onEnterRules": [
79+
{
80+
"beforeText": { "pattern": "^\\s*/\\*(?!/)([^\\*]|\\*(?!/))*$" },
81+
"afterText": { "pattern": "^\\s*\\*/$" },
82+
"action": { "indent": "indentOutdent", "appendText": " "}
83+
},
84+
{
85+
"beforeText": { "pattern": "^\\s*/\\*(?!/)([^\\*]|\\*(?!/))*$" },
86+
"action": { "indent": "none", "appendText": " "}
87+
},
88+
{
89+
"beforeText": { "pattern": "^(\\t|[ ])*[ ]\\*/\\s*$" },
90+
"action": { "indent": "none", "removeText": 1 }
91+
}
92+
]
7393
}

0 commit comments

Comments
 (0)