@exercism/codemirror-lang-erlang 0.0.0-stage → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -0
- package/LICENSE +21 -0
- package/README.md +84 -2
- package/dist/index.cjs +850 -0
- package/dist/index.d.cts +152 -0
- package/dist/index.d.ts +152 -0
- package/dist/index.js +843 -0
- package/package.json +56 -4
package/dist/index.js
ADDED
|
@@ -0,0 +1,843 @@
|
|
|
1
|
+
import { ExternalTokenizer, LRParser } from '@lezer/lr';
|
|
2
|
+
import { syntaxTree, LRLanguage, indentNodeProp, continuedIndent, delimitedIndent, foldNodeProp, foldInside, LanguageSupport } from '@codemirror/language';
|
|
3
|
+
import { styleTags, tags } from '@lezer/highlight';
|
|
4
|
+
import { snippetCompletion, completeFromList, ifNotIn } from '@codemirror/autocomplete';
|
|
5
|
+
|
|
6
|
+
// This file was generated by lezer-generator. You probably shouldn't edit it.
|
|
7
|
+
const AttributeStart = 1,
|
|
8
|
+
ShellOutput = 2,
|
|
9
|
+
ShellPrompt = 3,
|
|
10
|
+
FormEnd = 4,
|
|
11
|
+
StringStart = 5,
|
|
12
|
+
StringContent = 6,
|
|
13
|
+
StringEnd = 7,
|
|
14
|
+
Escape = 8,
|
|
15
|
+
TripleString = 9,
|
|
16
|
+
Sigil = 10;
|
|
17
|
+
|
|
18
|
+
function isSpace(ch) {
|
|
19
|
+
return ch == 32 /* Ch.Space */ || ch == 9 /* Ch.Tab */ || ch == 10 /* Ch.Newline */ || ch == 13 /* Ch.Return */ ||
|
|
20
|
+
ch == 11 /* Ch.VTab */ || ch == 12 /* Ch.FormFeed */;
|
|
21
|
+
}
|
|
22
|
+
function isLetter(ch) {
|
|
23
|
+
return (ch >= 97 /* Ch.LowerA */ && ch <= 122 /* Ch.LowerZ */) || (ch >= 65 /* Ch.UpperA */ && ch <= 90 /* Ch.UpperZ */);
|
|
24
|
+
}
|
|
25
|
+
function isUpper(ch) {
|
|
26
|
+
return ch >= 65 /* Ch.UpperA */ && ch <= 90 /* Ch.UpperZ */;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
The hyphen that opens an attribute, told from the one that negates a
|
|
30
|
+
number by where it stands. A form may begin with either, and only this one
|
|
31
|
+
is followed by the lowercase word that names it, so `-module(m)` is an
|
|
32
|
+
attribute and `-1 + 2` is arithmetic the shell was handed. The compiler
|
|
33
|
+
lets spaces stand between the hyphen and the word, so `- spec f() -> ok.`
|
|
34
|
+
is an attribute too, and the spaces go into the token.
|
|
35
|
+
*/
|
|
36
|
+
const attributes = /*@__PURE__*/new ExternalTokenizer((input, stack) => {
|
|
37
|
+
if (input.next != 45 /* Ch.Dash */)
|
|
38
|
+
return;
|
|
39
|
+
let gap = 1;
|
|
40
|
+
while (input.peek(gap) == 32 /* Ch.Space */ || input.peek(gap) == 9 /* Ch.Tab */)
|
|
41
|
+
gap++;
|
|
42
|
+
const after = input.peek(gap);
|
|
43
|
+
if (!(after >= 97 /* Ch.LowerA */ && after <= 122 /* Ch.LowerZ */))
|
|
44
|
+
return;
|
|
45
|
+
if (!stack.canShift(AttributeStart))
|
|
46
|
+
return;
|
|
47
|
+
input.acceptToken(AttributeStart, gap);
|
|
48
|
+
});
|
|
49
|
+
/**
|
|
50
|
+
Whether the position stands at the start of a line, counting the spaces
|
|
51
|
+
that indent it as part of it.
|
|
52
|
+
*/
|
|
53
|
+
function atLineStart(input) {
|
|
54
|
+
for (let back = 1;; back++) {
|
|
55
|
+
const ch = input.peek(-back);
|
|
56
|
+
if (ch == -1 /* Ch.EOF */ || ch == 10 /* Ch.Newline */)
|
|
57
|
+
return true;
|
|
58
|
+
if (ch != 32 /* Ch.Space */ && ch != 9 /* Ch.Tab */)
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
A session pasted out of the Erlang shell, which is how half the Erlang
|
|
64
|
+
anybody publishes is written down: a numbered prompt, the expression typed
|
|
65
|
+
at it, and the term the shell printed back.
|
|
66
|
+
|
|
67
|
+
The prompt is only read as one where a form may begin and at the start of a
|
|
68
|
+
line, so the `2>` inside an expression stays a comparison. The answer under
|
|
69
|
+
it is whatever is left of that line, taken as one token because it is a
|
|
70
|
+
value the shell printed rather than a program anybody wrote.
|
|
71
|
+
*/
|
|
72
|
+
const shell = /*@__PURE__*/new ExternalTokenizer((input, stack) => {
|
|
73
|
+
if (stack.canShift(ShellOutput) && atLineStart(input) && !looksLikePrompt(input)) {
|
|
74
|
+
let read = 0;
|
|
75
|
+
while (input.next != -1 /* Ch.EOF */ && input.next != 10 /* Ch.Newline */) {
|
|
76
|
+
input.advance();
|
|
77
|
+
read++;
|
|
78
|
+
}
|
|
79
|
+
if (read)
|
|
80
|
+
input.acceptToken(ShellOutput);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
if (!stack.canShift(ShellPrompt) || !atLineStart(input) || !looksLikePrompt(input))
|
|
84
|
+
return;
|
|
85
|
+
input.advance(promptLength(input));
|
|
86
|
+
input.acceptToken(ShellPrompt);
|
|
87
|
+
});
|
|
88
|
+
const looksLikePrompt = (input) => promptLength(input) > 0;
|
|
89
|
+
/**
|
|
90
|
+
`1> `, `> ` and the `(node@host)7> ` a distributed node writes.
|
|
91
|
+
*/
|
|
92
|
+
function promptLength(input) {
|
|
93
|
+
let at = 0;
|
|
94
|
+
if (input.peek(at) == 40 /* Ch.ParenL */) {
|
|
95
|
+
while (input.peek(at) != -1 /* Ch.EOF */ && input.peek(at) != 41 /* Ch.ParenR */ && input.peek(at) != 10 /* Ch.Newline */)
|
|
96
|
+
at++;
|
|
97
|
+
if (input.peek(at) != 41 /* Ch.ParenR */)
|
|
98
|
+
return 0;
|
|
99
|
+
at++;
|
|
100
|
+
}
|
|
101
|
+
while (input.peek(at) >= 48 /* Ch.Digit0 */ && input.peek(at) <= 57 /* Ch.Digit9 */)
|
|
102
|
+
at++;
|
|
103
|
+
if (input.peek(at) != 62 /* Ch.Gt */)
|
|
104
|
+
return 0;
|
|
105
|
+
at++;
|
|
106
|
+
const after = input.peek(at);
|
|
107
|
+
return after == 32 /* Ch.Space */ || after == 9 /* Ch.Tab */ || after == 10 /* Ch.Newline */ || after == -1 /* Ch.EOF */ ? at : 0;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
The period that ends a form, told from every other period by what follows
|
|
111
|
+
it. Erlang's own scanner reads `.` as a terminator when whitespace, a
|
|
112
|
+
comment or the end of the file stands after it, and as punctuation
|
|
113
|
+
otherwise, which is what leaves `Rec#state.name` and `1..10` alone.
|
|
114
|
+
*/
|
|
115
|
+
const formEnd = /*@__PURE__*/new ExternalTokenizer(input => {
|
|
116
|
+
if (input.next != 46 /* Ch.Dot */)
|
|
117
|
+
return;
|
|
118
|
+
const after = input.peek(1);
|
|
119
|
+
if (after == -1 /* Ch.EOF */ || after == 37 /* Ch.Percent */ || isSpace(after)) {
|
|
120
|
+
input.advance();
|
|
121
|
+
input.acceptToken(FormEnd);
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
/**
|
|
125
|
+
Strings, in both of the shapes OTP 27 left the language with.
|
|
126
|
+
|
|
127
|
+
The ordinary `"..."` is read a piece at a time, so an escape is a token of
|
|
128
|
+
its own and can be coloured apart from the text around it. The
|
|
129
|
+
triple-quoted string is one token, because what ends it is a run of quotes
|
|
130
|
+
as long as the run that opened it and no rule can say that.
|
|
131
|
+
*/
|
|
132
|
+
const strings = /*@__PURE__*/new ExternalTokenizer((input, stack) => {
|
|
133
|
+
if (stack.canShift(StringContent)) {
|
|
134
|
+
if (input.next == 34 /* Ch.Quote */) {
|
|
135
|
+
input.advance();
|
|
136
|
+
return input.acceptToken(StringEnd);
|
|
137
|
+
}
|
|
138
|
+
if (input.next == -1 /* Ch.EOF */)
|
|
139
|
+
return input.acceptToken(StringEnd);
|
|
140
|
+
if (input.next == 92 /* Ch.Backslash */) {
|
|
141
|
+
input.advance(escapeLength(input));
|
|
142
|
+
return input.acceptToken(Escape);
|
|
143
|
+
}
|
|
144
|
+
let read = 0;
|
|
145
|
+
for (;;) {
|
|
146
|
+
const ch = input.next;
|
|
147
|
+
if (ch == -1 /* Ch.EOF */ || ch == 34 /* Ch.Quote */ || ch == 92 /* Ch.Backslash */)
|
|
148
|
+
break;
|
|
149
|
+
input.advance();
|
|
150
|
+
read++;
|
|
151
|
+
}
|
|
152
|
+
if (read)
|
|
153
|
+
input.acceptToken(StringContent);
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
if (input.next != 34 /* Ch.Quote */)
|
|
157
|
+
return;
|
|
158
|
+
if (input.peek(1) == 34 /* Ch.Quote */ && input.peek(2) == 34 /* Ch.Quote */) {
|
|
159
|
+
const quotes = runOfQuotes(input, 0);
|
|
160
|
+
input.advance(quotes);
|
|
161
|
+
readUntilQuotes(input, quotes);
|
|
162
|
+
return input.acceptToken(TripleString);
|
|
163
|
+
}
|
|
164
|
+
input.advance();
|
|
165
|
+
input.acceptToken(StringStart);
|
|
166
|
+
}, { fallback: true });
|
|
167
|
+
/**
|
|
168
|
+
A sigil: `~b"bytes"`, `~"a binary"`, `~S/verbatim/`, and the triple-quoted
|
|
169
|
+
forms of all three. The name decides whether a backslash escapes anything,
|
|
170
|
+
the character after the name is the opening delimiter, and a bracket is
|
|
171
|
+
closed by its own other half.
|
|
172
|
+
*/
|
|
173
|
+
const sigils = /*@__PURE__*/new ExternalTokenizer(input => {
|
|
174
|
+
if (input.next != 126 /* Ch.Tilde */)
|
|
175
|
+
return;
|
|
176
|
+
let at = 1;
|
|
177
|
+
while (isLetter(input.peek(at)))
|
|
178
|
+
at++;
|
|
179
|
+
const verbatim = isUpper(input.peek(1));
|
|
180
|
+
const open = input.peek(at);
|
|
181
|
+
if (open == 34 /* Ch.Quote */ && input.peek(at + 1) == 34 /* Ch.Quote */ && input.peek(at + 2) == 34 /* Ch.Quote */) {
|
|
182
|
+
const quotes = runOfQuotes(input, at);
|
|
183
|
+
input.advance(at + quotes);
|
|
184
|
+
readUntilQuotes(input, quotes);
|
|
185
|
+
return acceptSigil(input);
|
|
186
|
+
}
|
|
187
|
+
const close = closingDelimiter(open);
|
|
188
|
+
if (close < 0)
|
|
189
|
+
return;
|
|
190
|
+
input.advance(at + 1);
|
|
191
|
+
for (;;) {
|
|
192
|
+
const ch = input.next;
|
|
193
|
+
if (ch == -1 /* Ch.EOF */)
|
|
194
|
+
return;
|
|
195
|
+
input.advance();
|
|
196
|
+
if (ch == close)
|
|
197
|
+
break;
|
|
198
|
+
if (ch == 92 /* Ch.Backslash */ && !verbatim && input.next != -1 /* Ch.EOF */)
|
|
199
|
+
input.advance();
|
|
200
|
+
}
|
|
201
|
+
acceptSigil(input);
|
|
202
|
+
});
|
|
203
|
+
/**
|
|
204
|
+
The letters a sigil may carry after its closing delimiter, which say how to
|
|
205
|
+
read what stood between them.
|
|
206
|
+
*/
|
|
207
|
+
function acceptSigil(input) {
|
|
208
|
+
while (isLetter(input.next))
|
|
209
|
+
input.advance();
|
|
210
|
+
input.acceptToken(Sigil);
|
|
211
|
+
}
|
|
212
|
+
function closingDelimiter(open) {
|
|
213
|
+
switch (open) {
|
|
214
|
+
case 40 /* Ch.ParenL */: return 41 /* Ch.ParenR */;
|
|
215
|
+
case 91 /* Ch.BracketL */: return 93 /* Ch.BracketR */;
|
|
216
|
+
case 123 /* Ch.BraceL */: return 125 /* Ch.BraceR */;
|
|
217
|
+
case 60 /* Ch.Lt */: return 62 /* Ch.Gt */;
|
|
218
|
+
case 47 /* Ch.Slash */:
|
|
219
|
+
case 124 /* Ch.Pipe */:
|
|
220
|
+
case 35 /* Ch.Hash */:
|
|
221
|
+
case 96 /* Ch.Backtick */:
|
|
222
|
+
case 39 /* Ch.Apostrophe */:
|
|
223
|
+
case 34 /* Ch.Quote */:
|
|
224
|
+
return open;
|
|
225
|
+
default:
|
|
226
|
+
return -1;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
function runOfQuotes(input, from) {
|
|
230
|
+
let quotes = 0;
|
|
231
|
+
while (input.peek(from + quotes) == 34 /* Ch.Quote */)
|
|
232
|
+
quotes++;
|
|
233
|
+
return quotes;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
Everything up to and including the next run of that many quote characters,
|
|
237
|
+
which is where a triple-quoted string stops.
|
|
238
|
+
*/
|
|
239
|
+
function readUntilQuotes(input, quotes) {
|
|
240
|
+
for (;;) {
|
|
241
|
+
if (input.next == -1 /* Ch.EOF */)
|
|
242
|
+
return;
|
|
243
|
+
if (input.next == 34 /* Ch.Quote */ && runOfQuotes(input, 0) >= quotes) {
|
|
244
|
+
input.advance(quotes);
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
input.advance();
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
How far a backslash escape reaches, counting the backslash. Erlang spells a
|
|
252
|
+
code point three ways, and a backslash before a line break joins the lines.
|
|
253
|
+
*/
|
|
254
|
+
function escapeLength(input) {
|
|
255
|
+
const next = input.peek(1);
|
|
256
|
+
if (next == -1 /* Ch.EOF */)
|
|
257
|
+
return 1;
|
|
258
|
+
if (next == 120 /* Ch.LowerX */) {
|
|
259
|
+
if (input.peek(2) == 123 /* Ch.BraceL */) {
|
|
260
|
+
let at = 3;
|
|
261
|
+
while (input.peek(at) != -1 /* Ch.EOF */ && input.peek(at) != 125 /* Ch.BraceR */)
|
|
262
|
+
at++;
|
|
263
|
+
return at + 1;
|
|
264
|
+
}
|
|
265
|
+
let at = 2;
|
|
266
|
+
while (at < 4 && isHex(input.peek(at)))
|
|
267
|
+
at++;
|
|
268
|
+
return at;
|
|
269
|
+
}
|
|
270
|
+
if (next == 94 /* Ch.Caret */)
|
|
271
|
+
return 3;
|
|
272
|
+
if (next >= 48 /* Ch.Digit0 */ && next <= 55 /* Ch.Digit7 */) {
|
|
273
|
+
let at = 2;
|
|
274
|
+
while (at < 4 && input.peek(at) >= 48 /* Ch.Digit0 */ && input.peek(at) <= 55 /* Ch.Digit7 */)
|
|
275
|
+
at++;
|
|
276
|
+
return at;
|
|
277
|
+
}
|
|
278
|
+
return 2;
|
|
279
|
+
}
|
|
280
|
+
function isHex(ch) {
|
|
281
|
+
return (ch >= 48 /* Ch.Digit0 */ && ch <= 57 /* Ch.Digit9 */) ||
|
|
282
|
+
(ch >= 97 && ch <= 102) ||
|
|
283
|
+
(ch >= 65 && ch <= 70);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
// This file was generated by lezer-generator. You probably shouldn't edit it.
|
|
287
|
+
const spec_atom = {__proto__:null,if:32, div:48, rem:50, band:52, and:54, bor:60, bxor:62, bsl:64, bsr:66, or:68, xor:70, andalso:92, orelse:94, fun:140, after:164, begin:166, bnot:168, case:170, catch:172, cond:174, end:176, let:178, not:180, of:182, receive:184, try:186, when:188, maybe:265, else:267, doc:303, moduledoc:305, record:317, spec:323, callback:325, type:333, opaque:335, nominal:337};
|
|
288
|
+
const parser = /*@__PURE__*/LRParser.deserialize({
|
|
289
|
+
version: 14,
|
|
290
|
+
states: "!.rQ#]Q!aOOO#dQ!fO'#CpO(cQpO'#D}O(jQ!fO'#EdO+fQxO'#GlO-kQ!nO'#EgOOQS'#Em'#EmOOQS'#En'#EnO2cQ!fO'#EsO4vQ!YO'#EoO4}Q!YO'#FPO5UQpO'#FQO2|Q!YO'#FWO:ZQ!fO'#GfO:bQ!YO'#FeO2|Q!YO'#FfOOQS'#Gf'#GfO:iQpO'#CjO;ZQtO'#FkO;cQpO'#FmO;hQtO'#FlO2|Q!YO'#FqOOQo'#Gc'#GcOOQo'#F}'#F}QYQ!aOOQYQ!aOOO2|Q!YO'#ErO2|Q!YO'#EuO2|Q!YO'#EyO<RQpO'#EzO2|Q!YO'#E}O2|Q!YO'#FTO<YQ!YO'#FXO2|Q!YO'#FcOOQ['#EP'#EPOOQ[,5:i,5:iO&`QpO,5:iOOQ['#Gk'#GkOOQW'#GP'#GPO<aQxO,5=WOOQ[,5=W,5=WOOQ['#GQ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XQ!aYQ!h[Q!k^Q!m_Q#RkQ#SlU#]n$}%cY#ap%V%g%j%rQ#j{Q#k|Q#l}Q#m!OQ#n!PQ#o!QQ#z!SQ$O!WS$P!X&]Q$S!YQ$T!ZQ$^!dQ%n#dQ&b$VQ&f$[Q'a%`Q'l%mU'o%q)Z)^Q(^&[Q(d&dQ(i&mR*f)sQ#p!RQ%|#qQ&O#rQ&S#tQ&T#uQ&V#wQ's%sQ't%tQ'u%uQ'v%vQ'w%wQ'x%xS'y%y*{Q'z%zQ(P*tQ(T&QQ(h&lQ(n&vQ(v&|Q(x&}Q)a*uQ)b*vQ)c*wQ)d*xQ)e*yQ)f*zU)g'|(Q)kQ)o(VQ)z(qQ){(rQ*S(yR*h)wSrQtY!cZ!V#s$`$wX$d!i$b&X&n$WTOXY[^_ehijklnopq{|}!O!P!Q!R!S!W!X!Y!Z!d!w#d#w$V$[${$}%V%Z%`%b%c%g%h%j%m%p%q%r%s%t%u%v%w%x%y&[&]&d&m'S'Y'i'm)Q)U)X)Z)])^)s)w*Z*oWyTz$l&s!V$l!q#q#r#t#u%z&Q&l&v&|&}'|(Q(V(q(r(y)k*t*u*v*w*x*y*z*{Q#cpQ'X%VQ'g%gR'r%rS#^n%cR'T$}Q#VmR']%YR#[mQ!gZR#}!VQ'q%qR*_)^R!qaR$o!qR!saQ$s!sR&{$tS$q!s$tR(m&uQ&y$rR)}(sR!ua",
|
|
293
|
+
nodeNames: "⚠ AttributeStart ShellOutput ShellPrompt FormEnd StringStart StringContent StringEnd Escape TripleString Sigil Comment File Shebang Attribute AttributeName if ) ( ArgumentList Atom BinaryExpression * / div rem band and + - bor bxor bsl bsr or xor ++ -- == /= =< < >= > =:= =/= andalso orelse = ! ?= => := <- <:- <= <:= && :: BinaryType .. | : >> << BitstringType , Char Float FunType fun FunctionSignature ArgumentTypes Ellipsis -> Integer ] [ ListType MacroCall ? MacroName after begin bnot case catch cond end let not of receive try when } # MapType { ParenType QuotedAtom RecordType RecordName String TupleType TypeApplication TypeArguments TypeName UnaryType Universal Variable Bitstring Qualifiers || BlockExpression Body CallExpression CaseExpression CaseClause Guard ; CatchExpression FunExpression FunctionReference FunClause IfExpression IfClause List Map MapFields MapUpdate MaybeExpression maybe else ParenExpression ReceiveExpression Record RecordFields RecordField Field RecordAccess . RecordIndex RecordUpdate RemoteExpression TryExpression CatchClause Tuple UnaryExpression ArgumentGuard DocAttribute doc moduledoc ExpressionForm FunctionDefinition FunctionClause FunctionName RecordAttribute record ShellCommand SpecAttribute spec callback SpecName TypeConstraints TypeAttribute type opaque nominal TypeDefinition TypeParameters",
|
|
294
|
+
maxTerm: 213,
|
|
295
|
+
nodeProps: [
|
|
296
|
+
["openedBy", 17,"(",63,"<<",76,"[",95,"{"],
|
|
297
|
+
["closedBy", 18,")",64,">>",77,"]",98,"}"]
|
|
298
|
+
],
|
|
299
|
+
skippedNodes: [0,11],
|
|
300
|
+
repeatNodeCount: 17,
|
|
301
|
+
tokenData: "3a~RsXY#`YZ#`Z[#`[]#`]^#`pq#`qr#wst#|tu$muv'|vw(ewx(pxy)qyz)vz{){{|*Q|}*_}!O*d!O!P*y!P!Q+`!Q![+m![!]-p!]!^.V!^!_.[!_!`/a!`!a0l!a!b1R!c!}1`!}#O1t#P#Q1y#R#S2O#T#o2d#o#p2x#p#q2}#q#r3[~#eU%U~XY#`YZ#`Z[#`[]#`]^#`pq#`~#|O!R~~$RP#S~qr$U~$ZS]~OY$UZ;'S$U;'S;=`$g<%lO$U~$jP;=`<%l$U~$pTO#O%P#O#P%U#P;'S%P;'S;=`&d<%lO%P~%UO!e~~%XXO!Q%P!Q!Y%t!Y#Q%P#Q#R&U#R#l%P#l#m&j#m;'S%P;'S;=`&d<%lO%P~%yP!e~!Q!Y%|~&RP!e~!Q!Y%P~&ZR!e~O;'S%P;'S;=`&d<%lO%P~&gP;=`<%l%P~&oS!e~!Q![&{!c!i&{#T#Z&{#o#p'Z~'QR!e~!Q![%P!c!i%P#T#Z%P~'^S!Q!['j!c!i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
305
|
+
tokenPrec: 6112
|
|
306
|
+
});
|
|
307
|
+
|
|
308
|
+
// ── Fixed lists ───────────────────────────────────────────────────────────────
|
|
309
|
+
const keywords = /*@__PURE__*/("after and andalso band begin bnot bor bsl bsr bxor case catch cond div " +
|
|
310
|
+
"else end fun if let maybe not of or orelse receive rem try when xor")
|
|
311
|
+
.split(" ")
|
|
312
|
+
.map(label => ({ label, type: "keyword" }));
|
|
313
|
+
const guards = /*@__PURE__*/[
|
|
314
|
+
"is_atom", "is_binary", "is_bitstring", "is_boolean", "is_float",
|
|
315
|
+
"is_function", "is_integer", "is_list", "is_map", "is_map_key", "is_number",
|
|
316
|
+
"is_pid", "is_port", "is_record", "is_reference", "is_tuple"
|
|
317
|
+
].map(label => ({ label, type: "function" }));
|
|
318
|
+
// The functions Erlang imports into every module, so a file calls them without
|
|
319
|
+
// writing `erlang:` in front.
|
|
320
|
+
const builtinNames = [
|
|
321
|
+
"abs", "apply", "atom_to_binary", "atom_to_list", "binary_part",
|
|
322
|
+
"binary_to_atom", "binary_to_existing_atom", "binary_to_float",
|
|
323
|
+
"binary_to_integer", "binary_to_list", "binary_to_term", "bit_size",
|
|
324
|
+
"byte_size", "ceil", "demonitor", "element", "erase", "error", "exit",
|
|
325
|
+
"float", "float_to_binary", "float_to_list", "floor", "get", "hd",
|
|
326
|
+
"integer_to_binary", "integer_to_list", "iolist_size", "iolist_to_binary",
|
|
327
|
+
"is_process_alive", "length", "link", "list_to_atom", "list_to_binary",
|
|
328
|
+
"list_to_existing_atom", "list_to_float", "list_to_integer", "list_to_tuple",
|
|
329
|
+
"make_ref", "map_get", "map_size", "max", "min", "monitor", "node", "now",
|
|
330
|
+
"process_flag", "put", "register", "round", "self", "setelement", "size",
|
|
331
|
+
"spawn", "spawn_link", "spawn_monitor", "split_binary", "term_to_binary",
|
|
332
|
+
"throw", "tl", "trunc", "tuple_size", "tuple_to_list", "unlink", "whereis"
|
|
333
|
+
];
|
|
334
|
+
const builtins = /*@__PURE__*/builtinNames.map(label => ({ label, type: "function" }));
|
|
335
|
+
const modules = /*@__PURE__*/[
|
|
336
|
+
"application", "array", "base64", "binary", "calendar", "code", "crypto",
|
|
337
|
+
"dict", "erlang", "ets", "file", "filelib", "filename", "gb_sets",
|
|
338
|
+
"gb_trees", "gen_event", "gen_server", "gen_statem", "io", "io_lib",
|
|
339
|
+
"json", "lists", "logger", "maps", "math", "os", "proplists", "queue",
|
|
340
|
+
"rand", "re", "sets", "sofs", "string", "supervisor", "sys", "timer",
|
|
341
|
+
"unicode", "uri_string"
|
|
342
|
+
].map(label => ({ label, type: "namespace" }));
|
|
343
|
+
const types = /*@__PURE__*/[
|
|
344
|
+
"any", "arity", "atom", "binary", "bitstring", "boolean", "byte", "char",
|
|
345
|
+
"dynamic", "float", "function", "integer", "iodata", "iolist", "list",
|
|
346
|
+
"map", "maybe_improper_list", "module", "neg_integer", "no_return", "node",
|
|
347
|
+
"non_neg_integer", "none", "nonempty_list", "nonempty_string", "number",
|
|
348
|
+
"pid", "port", "pos_integer", "reference", "string", "term", "timeout",
|
|
349
|
+
"tuple"
|
|
350
|
+
].map(label => ({ label, type: "type" }));
|
|
351
|
+
// Each entry is a function and the arities it comes in: `seq/2,3` is
|
|
352
|
+
// `lists:seq/2` and `lists:seq/3`.
|
|
353
|
+
const moduleFunctions = {
|
|
354
|
+
lists: "all/2 any/2 append/1,2 concat/1 delete/2 droplast/1 dropwhile/2 " +
|
|
355
|
+
"duplicate/2 enumerate/1,2 filter/2 filtermap/2 flatlength/1 flatmap/2 " +
|
|
356
|
+
"flatten/1,2 foldl/3 foldr/3 foreach/2 join/2 keydelete/3 keyfind/3 " +
|
|
357
|
+
"keymember/3 keymerge/3 keyreplace/4 keysort/2 keystore/4 keytake/3 " +
|
|
358
|
+
"last/1 map/2 mapfoldl/3 mapfoldr/3 max/1 member/2 merge/1,2,3 min/1 " +
|
|
359
|
+
"nth/2 nthtail/2 partition/2 prefix/2 reverse/1,2 search/2 seq/2,3 " +
|
|
360
|
+
"sort/1,2 split/2 splitwith/2 sublist/2,3 subtract/2 suffix/2 sum/1 " +
|
|
361
|
+
"takewhile/2 ukeysort/2 umerge/1,2 uniq/1,2 unzip/1 unzip3/1 usort/1,2 " +
|
|
362
|
+
"zip/2,3 zip3/3 zipwith/3 zipwith3/4",
|
|
363
|
+
maps: "filter/2 filtermap/2 find/2 fold/3 foreach/2 from_keys/2 from_list/1 " +
|
|
364
|
+
"get/2,3 groups_from_list/2,3 intersect/2 intersect_with/3 is_key/2 " +
|
|
365
|
+
"iterator/1,2 keys/1 map/2 merge/2 merge_with/3 new/0 next/1 put/3 " +
|
|
366
|
+
"remove/2 size/1 take/2 to_list/1 update/3 update_with/3,4 values/1 " +
|
|
367
|
+
"with/2 without/2",
|
|
368
|
+
string: "casefold/1 chomp/1 chars/2,3 concat/2 copies/2 equal/2,3,4 find/2,3 " +
|
|
369
|
+
"is_empty/1 join/2 length/1 lexemes/2 lowercase/1 next_codepoint/1 " +
|
|
370
|
+
"next_grapheme/1 nth_lexeme/3 pad/2,3,4 prefix/2 replace/3,4 reverse/1 " +
|
|
371
|
+
"slice/2,3 split/2,3 str/2 strip/1,2,3 substr/2,3 take/2,3,4 " +
|
|
372
|
+
"titlecase/1 to_float/1 to_graphemes/1 to_integer/1 to_lower/1 " +
|
|
373
|
+
"to_upper/1 tokens/2 trim/1,2,3 uppercase/1 words/1,2",
|
|
374
|
+
io: "columns/0,1 format/1,2,3 fwrite/1,2,3 get_chars/2,3 get_line/1,2 " +
|
|
375
|
+
"getopts/0,1 nl/0,1 put_chars/1,2 read/1,2 setopts/1,2 write/1,2",
|
|
376
|
+
io_lib: "char_list/1 format/2 fwrite/2 nl/0 print/1 printable_list/1 write/1,2 " +
|
|
377
|
+
"write_atom/1 write_string/1",
|
|
378
|
+
math: "acos/1 asin/1 atan/1 atan2/2 ceil/1 cos/1 cosh/1 exp/1 floor/1 fmod/2 " +
|
|
379
|
+
"log/1 log10/1 log2/1 pi/0 pow/2 sin/1 sinh/1 sqrt/1 tan/1 tanh/1 tau/0",
|
|
380
|
+
proplists: "compact/1 delete/2 expand/2 from_map/1 get_all_values/2 get_bool/2 " +
|
|
381
|
+
"get_keys/1 get_value/2,3 is_defined/2 lookup/2 lookup_all/2 " +
|
|
382
|
+
"normalize/2 property/1,2 split/2 to_map/1 unfold/1",
|
|
383
|
+
erlang: /*@__PURE__*/builtinNames.join(" ") + " " + /*@__PURE__*/guards.map(g => g.label).join(" ") + " " +
|
|
384
|
+
"append_element/2 delete_element/2 display/1 halt/0,1 insert_element/3 " +
|
|
385
|
+
"make_tuple/2,3 monotonic_time/0,1 phash2/1,2 process_info/1,2 send/2 " +
|
|
386
|
+
"send_after/3 start_timer/3 system_time/0,1 timestamp/0"
|
|
387
|
+
};
|
|
388
|
+
function functionList(entries) {
|
|
389
|
+
return entries.split(" ").map(entry => {
|
|
390
|
+
const [label, arities] = entry.split("/");
|
|
391
|
+
return arities ? { label, type: "function", detail: "/" + arities } : { label, type: "function" };
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
const moduleCompletions = /*@__PURE__*/Object.fromEntries(/*@__PURE__*/Object.entries(moduleFunctions).map(([module, entries]) => [module, functionList(entries)]));
|
|
395
|
+
// The macros the preprocessor defines in every file.
|
|
396
|
+
const predefinedMacros = /*@__PURE__*/[
|
|
397
|
+
"MODULE", "MODULE_STRING", "FILE", "LINE", "MACHINE", "FUNCTION_NAME",
|
|
398
|
+
"FUNCTION_ARITY", "OTP_RELEASE"
|
|
399
|
+
].map(label => ({ label, type: "constant", detail: "predefined" }));
|
|
400
|
+
// ── Snippets ──────────────────────────────────────────────────────────────────
|
|
401
|
+
/**
|
|
402
|
+
Snippets for the constructs people write most often in Erlang.
|
|
403
|
+
*/
|
|
404
|
+
const snippets = [
|
|
405
|
+
/*@__PURE__*/snippetCompletion("${name}(${Args}) ->\n\t${}.", {
|
|
406
|
+
label: "function",
|
|
407
|
+
detail: "clause",
|
|
408
|
+
type: "keyword"
|
|
409
|
+
}),
|
|
410
|
+
/*@__PURE__*/snippetCompletion("${name}(${Args}) when ${Guard} ->\n\t${}.", {
|
|
411
|
+
label: "function",
|
|
412
|
+
detail: "clause with guard",
|
|
413
|
+
type: "keyword"
|
|
414
|
+
}),
|
|
415
|
+
/*@__PURE__*/snippetCompletion("case ${Expression} of\n\t${Pattern} ->\n\t\t${}\nend", {
|
|
416
|
+
label: "case",
|
|
417
|
+
detail: "expression",
|
|
418
|
+
type: "keyword"
|
|
419
|
+
}),
|
|
420
|
+
/*@__PURE__*/snippetCompletion("if\n\t${Guard} ->\n\t\t${};\n\ttrue ->\n\t\t${}\nend", {
|
|
421
|
+
label: "if",
|
|
422
|
+
detail: "expression",
|
|
423
|
+
type: "keyword"
|
|
424
|
+
}),
|
|
425
|
+
/*@__PURE__*/snippetCompletion("receive\n\t${Pattern} ->\n\t\t${}\nend", {
|
|
426
|
+
label: "receive",
|
|
427
|
+
detail: "expression",
|
|
428
|
+
type: "keyword"
|
|
429
|
+
}),
|
|
430
|
+
/*@__PURE__*/snippetCompletion("receive\n\t${Pattern} ->\n\t\t${}\nafter ${Timeout} ->\n\t${}\nend", {
|
|
431
|
+
label: "receive",
|
|
432
|
+
detail: "with after",
|
|
433
|
+
type: "keyword"
|
|
434
|
+
}),
|
|
435
|
+
/*@__PURE__*/snippetCompletion("fun(${Args}) ->\n\t${}\nend", {
|
|
436
|
+
label: "fun",
|
|
437
|
+
detail: "anonymous function",
|
|
438
|
+
type: "keyword"
|
|
439
|
+
}),
|
|
440
|
+
/*@__PURE__*/snippetCompletion("try ${Expression} of\n\t${Pattern} ->\n\t\t${}\ncatch\n\t${Class}:${Reason} ->\n\t\t${}\nend", {
|
|
441
|
+
label: "try",
|
|
442
|
+
detail: "of catch",
|
|
443
|
+
type: "keyword"
|
|
444
|
+
}),
|
|
445
|
+
/*@__PURE__*/snippetCompletion("begin\n\t${}\nend", {
|
|
446
|
+
label: "begin",
|
|
447
|
+
detail: "block",
|
|
448
|
+
type: "keyword"
|
|
449
|
+
})
|
|
450
|
+
];
|
|
451
|
+
// The words that follow the hyphen of an attribute. The text they insert
|
|
452
|
+
// starts after the hyphen the user has typed.
|
|
453
|
+
const attributeSnippets = [
|
|
454
|
+
/*@__PURE__*/snippetCompletion("module(${name}).\n\n-export([${function}/${arity}]).\n", {
|
|
455
|
+
label: "module",
|
|
456
|
+
detail: "header with exports",
|
|
457
|
+
type: "keyword"
|
|
458
|
+
}),
|
|
459
|
+
/*@__PURE__*/snippetCompletion("export([${function}/${arity}]).", { label: "export", type: "keyword" }),
|
|
460
|
+
/*@__PURE__*/snippetCompletion("import(${module}, [${function}/${arity}]).", { label: "import", type: "keyword" }),
|
|
461
|
+
/*@__PURE__*/snippetCompletion("record(${name}, {${field}}).", { label: "record", type: "keyword" }),
|
|
462
|
+
/*@__PURE__*/snippetCompletion("define(${NAME}, ${value}).", { label: "define", type: "keyword" }),
|
|
463
|
+
/*@__PURE__*/snippetCompletion("spec ${name}(${Type}) -> ${Type}.", { label: "spec", type: "keyword" }),
|
|
464
|
+
/*@__PURE__*/snippetCompletion("type ${name}() :: ${Type}.", { label: "type", type: "keyword" }),
|
|
465
|
+
/*@__PURE__*/snippetCompletion("behaviour(${gen_server}).", { label: "behaviour", type: "keyword" }),
|
|
466
|
+
/*@__PURE__*/snippetCompletion("include(\"${file}.hrl\").", { label: "include", type: "keyword" }),
|
|
467
|
+
/*@__PURE__*/snippetCompletion("include_lib(\"${app}/include/${file}.hrl\").", { label: "include_lib", type: "keyword" }),
|
|
468
|
+
/*@__PURE__*/snippetCompletion("ifdef(${NAME}).\n${}\n-endif.", { label: "ifdef", type: "keyword" })
|
|
469
|
+
];
|
|
470
|
+
// ── Names declared in the file ────────────────────────────────────────────────
|
|
471
|
+
const dontComplete = [
|
|
472
|
+
"Comment",
|
|
473
|
+
"String",
|
|
474
|
+
"TripleString",
|
|
475
|
+
"Sigil",
|
|
476
|
+
"Char",
|
|
477
|
+
"QuotedAtom",
|
|
478
|
+
"Shebang",
|
|
479
|
+
"ShellOutput"
|
|
480
|
+
];
|
|
481
|
+
function text(state, node) {
|
|
482
|
+
return state.sliceDoc(node.from, node.to);
|
|
483
|
+
}
|
|
484
|
+
// The number of arguments in an argument list. An argument may carry a guard,
|
|
485
|
+
// which counts as part of it.
|
|
486
|
+
function arity(args) {
|
|
487
|
+
if (!args)
|
|
488
|
+
return 0;
|
|
489
|
+
let count = 0;
|
|
490
|
+
for (let ch = args.firstChild; ch; ch = ch.nextSibling)
|
|
491
|
+
if (ch.name != "(" && ch.name != ")" && ch.name != "," && ch.name != "ArgumentGuard")
|
|
492
|
+
count++;
|
|
493
|
+
return count;
|
|
494
|
+
}
|
|
495
|
+
// The field a record declaration names in `x`, `x = 0`, `x :: integer()` and
|
|
496
|
+
// `x = 0 :: integer()` is the atom they all start with.
|
|
497
|
+
function leadingAtom(node) {
|
|
498
|
+
while (node && node.name == "BinaryExpression")
|
|
499
|
+
node = node.firstChild;
|
|
500
|
+
return node && node.name == "Atom" ? node : null;
|
|
501
|
+
}
|
|
502
|
+
function gatherDeclarations(state) {
|
|
503
|
+
var _a, _b, _c, _d;
|
|
504
|
+
const decls = { functions: new Map(), records: new Map(), macros: new Map() };
|
|
505
|
+
const top = syntaxTree(state).topNode;
|
|
506
|
+
for (let form = top.firstChild; form; form = form.nextSibling) {
|
|
507
|
+
if (form.name == "FunctionDefinition") {
|
|
508
|
+
for (const clause of form.getChildren("FunctionClause")) {
|
|
509
|
+
const name = clause.getChild("FunctionName");
|
|
510
|
+
if (!name || name.firstChild)
|
|
511
|
+
continue;
|
|
512
|
+
const label = text(state, name);
|
|
513
|
+
if (!decls.functions.has(label))
|
|
514
|
+
decls.functions.set(label, new Set());
|
|
515
|
+
decls.functions.get(label).add(arity(clause.getChild("ArgumentList")));
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
else if (form.name == "RecordAttribute") {
|
|
519
|
+
const name = form.getChild("RecordName");
|
|
520
|
+
const fields = form.getChild("RecordFields");
|
|
521
|
+
if (!name)
|
|
522
|
+
continue;
|
|
523
|
+
const names = [];
|
|
524
|
+
for (const field of (_a = fields === null || fields === void 0 ? void 0 : fields.getChildren("RecordField")) !== null && _a !== void 0 ? _a : []) {
|
|
525
|
+
const f = field.getChild("Field");
|
|
526
|
+
if (f)
|
|
527
|
+
names.push(text(state, f));
|
|
528
|
+
}
|
|
529
|
+
decls.records.set(text(state, name), names);
|
|
530
|
+
}
|
|
531
|
+
else if (form.name == "Attribute") {
|
|
532
|
+
const attr = form.getChild("AttributeName");
|
|
533
|
+
const args = form.getChild("ArgumentList");
|
|
534
|
+
if (!attr || !args)
|
|
535
|
+
continue;
|
|
536
|
+
const first = (_c = (_b = args.firstChild) === null || _b === void 0 ? void 0 : _b.nextSibling) !== null && _c !== void 0 ? _c : null;
|
|
537
|
+
const kind = text(state, attr);
|
|
538
|
+
if (kind == "record" && first && (first.name == "Atom" || first.name == "QuotedAtom")) {
|
|
539
|
+
const names = [];
|
|
540
|
+
const tuple = (_d = first.nextSibling) === null || _d === void 0 ? void 0 : _d.nextSibling;
|
|
541
|
+
if ((tuple === null || tuple === void 0 ? void 0 : tuple.name) == "Tuple") {
|
|
542
|
+
for (let ch = tuple.firstChild; ch; ch = ch.nextSibling) {
|
|
543
|
+
const atom = leadingAtom(ch);
|
|
544
|
+
if (atom)
|
|
545
|
+
names.push(text(state, atom));
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
decls.records.set(text(state, first), names);
|
|
549
|
+
}
|
|
550
|
+
else if (kind == "define" && first) {
|
|
551
|
+
if (first.name == "Variable" || first.name == "Atom")
|
|
552
|
+
decls.macros.set(text(state, first), null);
|
|
553
|
+
else if (first.name == "CallExpression" && first.firstChild)
|
|
554
|
+
decls.macros.set(text(state, first.firstChild), arity(first.getChild("ArgumentList")));
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
return decls;
|
|
559
|
+
}
|
|
560
|
+
// A function clause, a fun clause, a shell form and a `-define` each bind
|
|
561
|
+
// their own variables. A comprehension binds the variables of its generators,
|
|
562
|
+
// and they are not visible outside it.
|
|
563
|
+
function isScope(node) {
|
|
564
|
+
switch (node.name) {
|
|
565
|
+
case "FunctionClause":
|
|
566
|
+
case "FunClause":
|
|
567
|
+
case "ExpressionForm":
|
|
568
|
+
case "ShellCommand":
|
|
569
|
+
case "Attribute":
|
|
570
|
+
return true;
|
|
571
|
+
case "List":
|
|
572
|
+
case "Bitstring":
|
|
573
|
+
case "MapFields":
|
|
574
|
+
return !!node.getChild("Qualifiers");
|
|
575
|
+
}
|
|
576
|
+
return false;
|
|
577
|
+
}
|
|
578
|
+
function variablesInScope(state, inner, typing) {
|
|
579
|
+
const seen = new Set();
|
|
580
|
+
const options = [];
|
|
581
|
+
const walk = (node) => {
|
|
582
|
+
for (let ch = node.firstChild; ch; ch = ch.nextSibling) {
|
|
583
|
+
if (ch.name == "Variable") {
|
|
584
|
+
const label = text(state, ch);
|
|
585
|
+
if (ch.from == typing.from && ch.to == typing.to)
|
|
586
|
+
continue;
|
|
587
|
+
if (label.startsWith("_") || seen.has(label))
|
|
588
|
+
continue;
|
|
589
|
+
seen.add(label);
|
|
590
|
+
options.push({ label, type: "variable" });
|
|
591
|
+
}
|
|
592
|
+
else if (!isScope(ch)) {
|
|
593
|
+
walk(ch);
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
};
|
|
597
|
+
for (let node = inner; node; node = node.parent)
|
|
598
|
+
if (isScope(node))
|
|
599
|
+
walk(node);
|
|
600
|
+
return options;
|
|
601
|
+
}
|
|
602
|
+
function functionOptions(decls, withArity) {
|
|
603
|
+
const options = [];
|
|
604
|
+
for (const [name, arities] of decls.functions) {
|
|
605
|
+
const sorted = [...arities].sort((a, b) => a - b);
|
|
606
|
+
if (withArity) {
|
|
607
|
+
for (const n of sorted)
|
|
608
|
+
options.push({ label: `${name}/${n}`, type: "function" });
|
|
609
|
+
}
|
|
610
|
+
else {
|
|
611
|
+
options.push({ label: name, type: "function", detail: "/" + sorted.join(",") });
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
return options;
|
|
615
|
+
}
|
|
616
|
+
// The record a `{` or a `.` belongs to, when the cursor is inside
|
|
617
|
+
// `#point{x = 1, ‸}` or the tree has it as an update of one.
|
|
618
|
+
function enclosingRecord(state, inner) {
|
|
619
|
+
for (let node = inner; node; node = node.parent) {
|
|
620
|
+
if (node.name == "RecordFields" && node.parent && node.parent.name != "RecordAttribute") {
|
|
621
|
+
const names = node.parent.getChildren("RecordName");
|
|
622
|
+
return names.length ? text(state, names[names.length - 1]) : null;
|
|
623
|
+
}
|
|
624
|
+
if (isScope(node))
|
|
625
|
+
return null;
|
|
626
|
+
}
|
|
627
|
+
return null;
|
|
628
|
+
}
|
|
629
|
+
const word = /[\w@]*$/;
|
|
630
|
+
/**
|
|
631
|
+
Completes Erlang: keywords, guards, built-in functions, types, modules,
|
|
632
|
+
snippets, the functions of common modules after `lists:` and the like, and
|
|
633
|
+
the names declared in the file. After `?` it offers macros, after `#`
|
|
634
|
+
records, and after a record's `.` or inside its braces its fields.
|
|
635
|
+
Variables come from the clause around the cursor. It offers nothing in
|
|
636
|
+
strings and comments.
|
|
637
|
+
*/
|
|
638
|
+
const erlangCompletionSource = (context) => {
|
|
639
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
640
|
+
const { state, pos } = context;
|
|
641
|
+
const line = state.doc.lineAt(pos);
|
|
642
|
+
const before = state.sliceDoc(line.from, pos);
|
|
643
|
+
// `-mod‸` at the start of a line names an attribute.
|
|
644
|
+
const attribute = /^\s*-\s*([a-z][\w@]*)?$/.exec(before);
|
|
645
|
+
if (attribute) {
|
|
646
|
+
return { from: pos - ((_b = (_a = attribute[1]) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0), options: attributeSnippets, validFor: /^[\w@]*$/ };
|
|
647
|
+
}
|
|
648
|
+
// `lists:fo‸` asks for a function from another module. A module listed
|
|
649
|
+
// here gets its functions, and any other module gets nothing, because the
|
|
650
|
+
// file says nothing about what it exports.
|
|
651
|
+
const remote = /(?:^|[^\w@?#'])([a-z][\w@]*):([a-z][\w@]*)?$/.exec(before);
|
|
652
|
+
if (remote) {
|
|
653
|
+
const options = moduleCompletions[remote[1]];
|
|
654
|
+
if (!options)
|
|
655
|
+
return null;
|
|
656
|
+
return { from: pos - ((_d = (_c = remote[2]) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0), options, validFor: /^[\w@]*$/ };
|
|
657
|
+
}
|
|
658
|
+
const inner = syntaxTree(state).resolveInner(pos, -1);
|
|
659
|
+
// `?MA‸` and `??Arg` ask for a macro.
|
|
660
|
+
const macro = /\?\??([\w@]*)$/.exec(before);
|
|
661
|
+
if (macro) {
|
|
662
|
+
const decls = gatherDeclarations(state);
|
|
663
|
+
const options = [...predefinedMacros];
|
|
664
|
+
for (const [label, args] of decls.macros)
|
|
665
|
+
options.push({ label, type: "constant", detail: args == null ? "macro" : `macro/${args}` });
|
|
666
|
+
return { from: pos - macro[1].length, options, validFor: /^[\w@]*$/ };
|
|
667
|
+
}
|
|
668
|
+
// `#po‸` asks for a record, and `#point.‸` for one of its fields.
|
|
669
|
+
const recordField = /#([a-z][\w@]*)\.([a-z][\w@]*)?$/.exec(before);
|
|
670
|
+
if (recordField) {
|
|
671
|
+
const fields = (_e = gatherDeclarations(state).records.get(recordField[1])) !== null && _e !== void 0 ? _e : [];
|
|
672
|
+
return {
|
|
673
|
+
from: pos - ((_g = (_f = recordField[2]) === null || _f === void 0 ? void 0 : _f.length) !== null && _g !== void 0 ? _g : 0),
|
|
674
|
+
options: fields.map(label => ({ label, type: "property" })),
|
|
675
|
+
validFor: /^[\w@]*$/
|
|
676
|
+
};
|
|
677
|
+
}
|
|
678
|
+
const record = /#([a-z][\w@]*)?$/.exec(before);
|
|
679
|
+
if (record) {
|
|
680
|
+
const records = gatherDeclarations(state).records;
|
|
681
|
+
return {
|
|
682
|
+
from: pos - ((_j = (_h = record[1]) === null || _h === void 0 ? void 0 : _h.length) !== null && _j !== void 0 ? _j : 0),
|
|
683
|
+
options: [...records.keys()].map(label => ({ label, type: "class" })),
|
|
684
|
+
validFor: /^[\w@]*$/
|
|
685
|
+
};
|
|
686
|
+
}
|
|
687
|
+
const typed = context.matchBefore(word);
|
|
688
|
+
if (typed.from == typed.to && !context.explicit)
|
|
689
|
+
return null;
|
|
690
|
+
const from = typed.from;
|
|
691
|
+
const decls = gatherDeclarations(state);
|
|
692
|
+
const formStart = Math.max(0, pos - 2000);
|
|
693
|
+
const recent = state.sliceDoc(formStart, pos);
|
|
694
|
+
// In `-export([ad‸` and after `fun ad‸`, a function is named with its arity.
|
|
695
|
+
if (/-\s*export\s*\(\s*\[[^\]]*$/.test(recent) || /\bfun\s+[a-z][\w@]*$/.test(before)) {
|
|
696
|
+
return { from, options: functionOptions(decls, true), validFor: /^[\w@]*$/ };
|
|
697
|
+
}
|
|
698
|
+
const options = [
|
|
699
|
+
...variablesInScope(state, inner, { from, to: pos }),
|
|
700
|
+
...functionOptions(decls, false)
|
|
701
|
+
];
|
|
702
|
+
const recordName = enclosingRecord(state, inner);
|
|
703
|
+
if (recordName)
|
|
704
|
+
for (const label of (_k = decls.records.get(recordName)) !== null && _k !== void 0 ? _k : [])
|
|
705
|
+
options.push({ label, type: "property" });
|
|
706
|
+
return { from, options, validFor: /^[\w@]*$/ };
|
|
707
|
+
};
|
|
708
|
+
/**
|
|
709
|
+
Completion for the fixed lists: keywords, guards, built-in functions,
|
|
710
|
+
module names, types and snippets. It stays quiet where
|
|
711
|
+
`erlangCompletionSource` handles a context of its own: after `mod:`, `?`
|
|
712
|
+
and `#`, and in the attribute name after a hyphen.
|
|
713
|
+
*/
|
|
714
|
+
const fixedList = /*@__PURE__*/completeFromList([
|
|
715
|
+
...snippets,
|
|
716
|
+
...builtins,
|
|
717
|
+
...guards,
|
|
718
|
+
...keywords,
|
|
719
|
+
...modules,
|
|
720
|
+
...types
|
|
721
|
+
]);
|
|
722
|
+
const erlangCompletion = context => {
|
|
723
|
+
const before = context.state.sliceDoc(context.state.doc.lineAt(context.pos).from, context.pos);
|
|
724
|
+
if (/^\s*-\s*[\w@]*$/.test(before))
|
|
725
|
+
return null;
|
|
726
|
+
if (/[:?#.][\w@]*$/.test(before))
|
|
727
|
+
return null;
|
|
728
|
+
return fixedList(context);
|
|
729
|
+
};
|
|
730
|
+
/**
|
|
731
|
+
Wraps a completion source so it says nothing in strings and comments.
|
|
732
|
+
*/
|
|
733
|
+
function outsideLiterals(source) {
|
|
734
|
+
return ifNotIn(dontComplete, source);
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
const parenthesised = "ArgumentList ArgumentTypes ParenExpression ParenType TypeArguments TypeParameters";
|
|
738
|
+
const braced = "MapFields RecordFields Tuple TupleType";
|
|
739
|
+
const squared = "List ListType";
|
|
740
|
+
/**
|
|
741
|
+
The blocks Erlang closes with `end`. Each indents what it holds and puts
|
|
742
|
+
the closing word back on the margin the word that opened it stood on.
|
|
743
|
+
*/
|
|
744
|
+
function endDelimitedIndent(context) {
|
|
745
|
+
const after = context.textAfter;
|
|
746
|
+
const space = after.match(/^\s*/)[0].length;
|
|
747
|
+
const closes = after.slice(space, space + 3) == "end";
|
|
748
|
+
return context.lineIndent(context.node.from) + (closes ? 0 : context.unit);
|
|
749
|
+
}
|
|
750
|
+
const erlangLanguage = /*@__PURE__*/LRLanguage.define({
|
|
751
|
+
name: "erlang",
|
|
752
|
+
parser: /*@__PURE__*/parser.configure({
|
|
753
|
+
props: [
|
|
754
|
+
/*@__PURE__*/indentNodeProp.add({
|
|
755
|
+
[parenthesised]: /*@__PURE__*/delimitedIndent({ closing: ")" }),
|
|
756
|
+
[braced]: /*@__PURE__*/delimitedIndent({ closing: "}" }),
|
|
757
|
+
[squared]: /*@__PURE__*/delimitedIndent({ closing: "]" }),
|
|
758
|
+
Bitstring: /*@__PURE__*/delimitedIndent({ closing: ">>" }),
|
|
759
|
+
"BlockExpression CaseExpression FunExpression IfExpression": endDelimitedIndent,
|
|
760
|
+
"MaybeExpression ReceiveExpression TryExpression": endDelimitedIndent,
|
|
761
|
+
// A clause body stands one step in from the head that opened it, and
|
|
762
|
+
// so does the continuation of an attribute. Neither has a bracket to
|
|
763
|
+
// measure against.
|
|
764
|
+
"Body Guard SpecAttribute TypeAttribute": /*@__PURE__*/continuedIndent(),
|
|
765
|
+
Comment: () => null
|
|
766
|
+
}),
|
|
767
|
+
/*@__PURE__*/foldNodeProp.add({
|
|
768
|
+
[parenthesised]: foldInside,
|
|
769
|
+
[braced]: foldInside,
|
|
770
|
+
[squared]: foldInside,
|
|
771
|
+
Bitstring: foldInside,
|
|
772
|
+
// A block folds away everything between the word that opened it and
|
|
773
|
+
// the `end` that closes it.
|
|
774
|
+
"BlockExpression CaseExpression FunExpression IfExpression MaybeExpression ReceiveExpression TryExpression": node => ({ from: node.from + (node.firstChild ? node.firstChild.to - node.from : 0), to: node.to - 3 }),
|
|
775
|
+
FunctionDefinition: node => ({ from: node.from, to: node.to })
|
|
776
|
+
}),
|
|
777
|
+
/*@__PURE__*/styleTags({
|
|
778
|
+
"after begin case catch cond end if of receive try when": tags.controlKeyword,
|
|
779
|
+
"else maybe": tags.controlKeyword,
|
|
780
|
+
"fun let": tags.definitionKeyword,
|
|
781
|
+
"and andalso band bnot bor bsl bsr bxor div not or orelse rem xor": tags.operatorKeyword,
|
|
782
|
+
// An attribute is a note to the compiler rather than to the runtime,
|
|
783
|
+
// and the word after the hyphen is the whole of what it says.
|
|
784
|
+
"AttributeName AttributeStart callback doc moduledoc nominal opaque record spec type": tags.definitionKeyword,
|
|
785
|
+
Atom: tags.atom,
|
|
786
|
+
QuotedAtom: tags.atom,
|
|
787
|
+
Char: tags.character,
|
|
788
|
+
Comment: tags.lineComment,
|
|
789
|
+
Escape: tags.escape,
|
|
790
|
+
Float: tags.float,
|
|
791
|
+
Integer: tags.integer,
|
|
792
|
+
Sigil: /*@__PURE__*/tags.special(tags.string),
|
|
793
|
+
"String TripleString": tags.string,
|
|
794
|
+
"StringStart StringContent StringEnd": tags.string,
|
|
795
|
+
"Shebang ShellOutput ShellPrompt": tags.meta,
|
|
796
|
+
Universal: /*@__PURE__*/tags.special(tags.variableName),
|
|
797
|
+
Variable: tags.variableName,
|
|
798
|
+
// The name a form defines, and the name a call reaches for. Both are
|
|
799
|
+
// atoms, and where the atom stands is the only thing that tells them
|
|
800
|
+
// from the atoms used as values.
|
|
801
|
+
FunctionName: /*@__PURE__*/tags.definition(/*@__PURE__*/tags.function(tags.variableName)),
|
|
802
|
+
"CallExpression/Atom": /*@__PURE__*/tags.function(tags.variableName),
|
|
803
|
+
"FunctionReference/Atom": /*@__PURE__*/tags.function(tags.variableName),
|
|
804
|
+
"SpecName/Atom": /*@__PURE__*/tags.function(tags.variableName),
|
|
805
|
+
"MacroCall/...": tags.macroName,
|
|
806
|
+
RecordName: tags.className,
|
|
807
|
+
Field: tags.propertyName,
|
|
808
|
+
TypeName: tags.typeName,
|
|
809
|
+
"TypeDefinition/TypeName": /*@__PURE__*/tags.definition(tags.typeName),
|
|
810
|
+
'"++" "--" "!" "&&" "*" "/" "+" "-"': tags.operator,
|
|
811
|
+
'"==" "/=" "=<" "<" ">=" ">" "=:=" "=/="': tags.compareOperator,
|
|
812
|
+
'"=" "?=" "=>" ":=" "<-" "<:-" "<=" "<:=" "->"': tags.definitionOperator,
|
|
813
|
+
'"::" ".." "|" "||"': tags.typeOperator,
|
|
814
|
+
'"#"': tags.derefOperator,
|
|
815
|
+
'":"': tags.punctuation,
|
|
816
|
+
Ellipsis: tags.punctuation,
|
|
817
|
+
FormEnd: tags.punctuation,
|
|
818
|
+
'"," ";"': tags.separator,
|
|
819
|
+
'"(" ")"': tags.paren,
|
|
820
|
+
'"[" "]"': tags.squareBracket,
|
|
821
|
+
'"{" "}" "<<" ">>"': tags.brace
|
|
822
|
+
})
|
|
823
|
+
]
|
|
824
|
+
}),
|
|
825
|
+
languageData: {
|
|
826
|
+
commentTokens: { line: "%" },
|
|
827
|
+
closeBrackets: { brackets: ["(", "[", "{", "'", '"', "<<"] },
|
|
828
|
+
indentOnInput: /^\s*(end|catch|after|of|\)|\]|\}|>>)$/
|
|
829
|
+
}
|
|
830
|
+
});
|
|
831
|
+
/**
|
|
832
|
+
Erlang language support, with completion for keywords, built-in functions,
|
|
833
|
+
the functions of common modules, snippets and the names declared in the
|
|
834
|
+
file.
|
|
835
|
+
*/
|
|
836
|
+
function erlang() {
|
|
837
|
+
return new LanguageSupport(erlangLanguage, [
|
|
838
|
+
erlangLanguage.data.of({ autocomplete: outsideLiterals(erlangCompletion) }),
|
|
839
|
+
erlangLanguage.data.of({ autocomplete: outsideLiterals(erlangCompletionSource) })
|
|
840
|
+
]);
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
export { erlang, erlangCompletion, erlangCompletionSource, erlangLanguage, parser, snippets };
|