-
Notifications
You must be signed in to change notification settings - Fork 26
/
language-configuration.json
71 lines (71 loc) · 1.97 KB
/
language-configuration.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
{
"comments": {
"lineComment": "%"
},
"brackets": [
[ "(", ")" ],
[ "[", "]" ],
[ "{", "}" ]
],
"autoClosingPairs": [
[ "(", ")" ],
[ "[", "]" ],
[ "{", "}" ],
{ "open": "'", "close": "'", "notIn": [ "string", "comment" ] },
{ "open": "\"", "close": "\"", "notIn": [ "string" ] },
{ "open": "<<\"", "close": "\">>", "notIn": [ "string" ] }
],
"surroundingPairs": [
[ "(", ")" ],
[ "[", "]" ],
[ "{", "}" ],
[ "'", "'" ],
[ "\"", "\"" ]
],
"indentationRules": {
// Indent if a line ends brackets, "->" or most keywords. Also if prefixed
// with "||". This should work with most formatting models.
// The ((?!%).)* is to ensure this doesn't match inside comments.
"increaseIndentPattern": "^((?!%).)*([{([]|->|after|begin|case|catch|fun|if|of|try|when|maybe|else|(\\|\\|.*))\\s*$",
// Dedent after brackets, end or lone "->". The latter happens in a spec
// with indented types, typically after "when". Only do this if it's _only_
// preceded by whitespace.
"decreaseIndentPattern": "^\\s*([)}\\]]|end|else|->\\s*$)",
// Indent if after an incomplete map association operator, list
// comprehension and type specifier. But only once, then return to the
// previous indent.
"indentNextLinePattern": "^((?!%).)*(::|=>|:=|<-)\\s*$"
},
"onEnterRules": [
{
// Dedent after ";" or "."
"beforeText": "^((?!%).)*[;.]",
"action": {
"indent": "outdent"
}
},
// Inside a comment, pressing enter should insert comment markers (%) as
// appropriate. These three rules do just that.
{
"beforeText": "^\\s*%%%",
"action": {
"indent": "none",
"appendText": "%%% "
}
},
{
"beforeText": "^\\s*%%",
"action": {
"indent": "none",
"appendText": "%% "
}
},
{
"beforeText": "^\\s*%",
"action": {
"indent": "none",
"appendText": "% "
}
}
]
}