Making same changes to JavaScript language configuration file as for TypeScript (#209038)

making the language configuration file the same as for typescript
This commit is contained in:
Aiday Marlen Kyzy
2024-03-28 18:25:55 +01:00
committed by GitHub
parent f6e74f9990
commit f62931d09b

View File

@@ -119,6 +119,9 @@
// e.g. * ...| or */| or *-----*/|
"unIndentedLinePattern": {
"pattern": "^(\\t|[ ])*[ ]\\*[^/]*\\*/\\s*$|^(\\t|[ ])*[ ]\\*/\\s*$|^(\\t|[ ])*[ ]\\*([ ]([^\\*]|\\*(?!/))*)?$"
},
"indentNextLinePattern": {
"pattern": "^((.*=>\\s*)|((.*[^\\w]+|\\s*)(if|while|for)\\s*\\(.*\\)\\s*))$"
}
},
"onEnterRules": [
@@ -197,6 +200,33 @@
"action": {
"indent": "outdent"
}
}
},
// Indent when pressing enter from inside ()
{
"beforeText": "^.*\\([^\\)]*$",
"afterText": "^\\s*\\).*$",
"action": {
"indent": "indentOutdent",
"appendText": "\t",
}
},
// Indent when pressing enter from inside {}
{
"beforeText": "^.*\\{[^\\}]*$",
"afterText": "^\\s*\\}.*$",
"action": {
"indent": "indentOutdent",
"appendText": "\t",
}
},
// Indent when pressing enter from inside []
{
"beforeText": "^.*\\[[^\\]]*$",
"afterText": "^\\s*\\].*$",
"action": {
"indent": "indentOutdent",
"appendText": "\t",
}
},
]
}