Skip to content

Commit f62931d

Browse files
authored
Making same changes to JavaScript language configuration file as for TypeScript (microsoft#209038)
making the language configuration file the same as for typescript
1 parent f6e74f9 commit f62931d

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

extensions/javascript/javascript-language-configuration.json

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@
119119
// e.g. * ...| or */| or *-----*/|
120120
"unIndentedLinePattern": {
121121
"pattern": "^(\\t|[ ])*[ ]\\*[^/]*\\*/\\s*$|^(\\t|[ ])*[ ]\\*/\\s*$|^(\\t|[ ])*[ ]\\*([ ]([^\\*]|\\*(?!/))*)?$"
122+
},
123+
"indentNextLinePattern": {
124+
"pattern": "^((.*=>\\s*)|((.*[^\\w]+|\\s*)(if|while|for)\\s*\\(.*\\)\\s*))$"
122125
}
123126
},
124127
"onEnterRules": [
@@ -197,6 +200,33 @@
197200
"action": {
198201
"indent": "outdent"
199202
}
200-
}
203+
},
204+
// Indent when pressing enter from inside ()
205+
{
206+
"beforeText": "^.*\\([^\\)]*$",
207+
"afterText": "^\\s*\\).*$",
208+
"action": {
209+
"indent": "indentOutdent",
210+
"appendText": "\t",
211+
}
212+
},
213+
// Indent when pressing enter from inside {}
214+
{
215+
"beforeText": "^.*\\{[^\\}]*$",
216+
"afterText": "^\\s*\\}.*$",
217+
"action": {
218+
"indent": "indentOutdent",
219+
"appendText": "\t",
220+
}
221+
},
222+
// Indent when pressing enter from inside []
223+
{
224+
"beforeText": "^.*\\[[^\\]]*$",
225+
"afterText": "^\\s*\\].*$",
226+
"action": {
227+
"indent": "indentOutdent",
228+
"appendText": "\t",
229+
}
230+
},
201231
]
202232
}

0 commit comments

Comments
 (0)