Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/extensions/javascript/javascript-language-configuration.json
5222 views
1
{
2
// Note that this file should stay in sync with 'typescript-language-basics/language-configuration.json'
3
"comments": {
4
"lineComment": "//",
5
"blockComment": [
6
"/*",
7
"*/"
8
]
9
},
10
"brackets": [
11
[
12
"${",
13
"}"
14
],
15
[
16
"{",
17
"}"
18
],
19
[
20
"[",
21
"]"
22
],
23
[
24
"(",
25
")"
26
]
27
],
28
"autoClosingPairs": [
29
{
30
"open": "${",
31
"close": "}"
32
},
33
{
34
"open": "{",
35
"close": "}"
36
},
37
{
38
"open": "[",
39
"close": "]"
40
},
41
{
42
"open": "(",
43
"close": ")"
44
},
45
{
46
"open": "'",
47
"close": "'",
48
"notIn": [
49
"string",
50
"comment"
51
]
52
},
53
{
54
"open": "\"",
55
"close": "\"",
56
"notIn": [
57
"string"
58
]
59
},
60
{
61
"open": "`",
62
"close": "`",
63
"notIn": [
64
"string",
65
"comment"
66
]
67
},
68
{
69
"open": "/**",
70
"close": " */",
71
"notIn": [
72
"string"
73
]
74
}
75
],
76
"surroundingPairs": [
77
[
78
"${",
79
"}"
80
],
81
[
82
"$",
83
""
84
],
85
[
86
"{",
87
"}"
88
],
89
[
90
"[",
91
"]"
92
],
93
[
94
"(",
95
")"
96
],
97
[
98
"'",
99
"'"
100
],
101
[
102
"\"",
103
"\""
104
],
105
[
106
"`",
107
"`"
108
],
109
[
110
"<",
111
">"
112
]
113
],
114
"autoCloseBefore": ";:.,=}])>` \n\t",
115
"folding": {
116
"markers": {
117
"start": "^\\s*//\\s*#?region\\b",
118
"end": "^\\s*//\\s*#?endregion\\b"
119
}
120
},
121
"wordPattern": {
122
"pattern": "(-?\\d*\\.\\d\\w*)|([^\\`\\~\\@\\!\\%\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>/\\?\\s]+)",
123
},
124
"indentationRules": {
125
"decreaseIndentPattern": {
126
"pattern": "^\\s*[\\}\\]\\)].*$"
127
},
128
"increaseIndentPattern": {
129
"pattern": "^.*(\\{[^}]*|\\([^)]*|\\[[^\\]]*)$"
130
},
131
// e.g. * ...| or */| or *-----*/|
132
"unIndentedLinePattern": {
133
"pattern": "^(\\t|[ ])*[ ]\\*[^/]*\\*/\\s*$|^(\\t|[ ])*[ ]\\*/\\s*$|^(\\t|[ ])*[ ]\\*([ ]([^\\*]|\\*(?!/))*)?$"
134
},
135
"indentNextLinePattern": {
136
"pattern": "^((.*=>\\s*)|((.*[^\\w]+|\\s*)((if|while|for)\\s*\\(.*\\)\\s*|else\\s*)))$"
137
}
138
},
139
"onEnterRules": [
140
{
141
// e.g. /** | */
142
"beforeText": {
143
"pattern": "^\\s*/\\*\\*(?!/)([^\\*]|\\*(?!/))*$"
144
},
145
"afterText": {
146
"pattern": "^\\s*\\*/$"
147
},
148
"action": {
149
"indent": "indentOutdent",
150
"appendText": " * "
151
}
152
},
153
{
154
// e.g. /** ...|
155
"beforeText": {
156
"pattern": "^\\s*/\\*\\*(?!/)([^\\*]|\\*(?!/))*$"
157
},
158
"action": {
159
"indent": "none",
160
"appendText": " * "
161
}
162
},
163
{
164
// e.g. * ...|
165
"beforeText": {
166
"pattern": "^(\\t|[ ])*[ ]\\*([ ]([^\\*]|\\*(?!/))*)?$"
167
},
168
"previousLineText": {
169
"pattern": "(?=^(\\s*(/\\*\\*|\\*)).*)(?=(?!(\\s*\\*/)))"
170
},
171
"action": {
172
"indent": "none",
173
"appendText": "* "
174
}
175
},
176
{
177
// e.g. */|
178
"beforeText": {
179
"pattern": "^(\\t|[ ])*[ ]\\*/\\s*$"
180
},
181
"action": {
182
"indent": "none",
183
"removeText": 1
184
},
185
},
186
{
187
// e.g. *-----*/|
188
"beforeText": {
189
"pattern": "^(\\t|[ ])*[ ]\\*[^/]*\\*/\\s*$"
190
},
191
"action": {
192
"indent": "none",
193
"removeText": 1
194
},
195
},
196
{
197
"beforeText": {
198
"pattern": "^\\s*(\\bcase\\s.+:|\\bdefault:)$"
199
},
200
"afterText": {
201
"pattern": "^(?!\\s*(\\bcase\\b|\\bdefault\\b))"
202
},
203
"action": {
204
"indent": "indent"
205
}
206
},
207
{
208
// Decrease indentation after single line if/else if/else, for, or while
209
"previousLineText": "^\\s*(((else ?)?if|for|while)\\s*\\(.*\\)\\s*|else\\s*)$",
210
// But make sure line doesn't have braces or is not another if statement
211
"beforeText": "^\\s+([^{i\\s]|i(?!f\\b))",
212
"action": {
213
"indent": "outdent"
214
}
215
},
216
// Indent when pressing enter from inside ()
217
{
218
"beforeText": "^.*\\([^\\)]*$",
219
"afterText": "^\\s*\\).*$",
220
"action": {
221
"indent": "indentOutdent",
222
"appendText": "\t",
223
}
224
},
225
// Indent when pressing enter from inside {}
226
{
227
"beforeText": "^.*\\{[^\\}]*$",
228
"afterText": "^\\s*\\}.*$",
229
"action": {
230
"indent": "indentOutdent",
231
"appendText": "\t",
232
}
233
},
234
// Indent when pressing enter from inside []
235
{
236
"beforeText": "^.*\\[[^\\]]*$",
237
"afterText": "^\\s*\\].*$",
238
"action": {
239
"indent": "indentOutdent",
240
"appendText": "\t",
241
}
242
},
243
// Add // when pressing enter from inside line comment
244
{
245
"beforeText": "(?<!\\\\|\\w:)\/\/\\s*\\S",
246
"afterText": "^(?!\\s*$).+",
247
"action": {
248
"indent": "none",
249
"appendText": "// "
250
}
251
},
252
]
253
}
254
255