@exercism/codemirror-lang-cfml 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/LICENSE +21 -0
- package/README.md +119 -2
- package/dist/index.cjs +658 -0
- package/dist/index.d.cts +14 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +652 -0
- package/package.json +51 -4
package/dist/index.js
ADDED
|
@@ -0,0 +1,652 @@
|
|
|
1
|
+
import { ContextTracker, ExternalTokenizer, LRParser, LocalTokenGroup } from '@lezer/lr';
|
|
2
|
+
import { styleTags, tags } from '@lezer/highlight';
|
|
3
|
+
import { syntaxTree, LRLanguage, indentNodeProp, continuedIndent, delimitedIndent, foldNodeProp, foldInside, LanguageSupport } from '@codemirror/language';
|
|
4
|
+
import { snippetCompletion, completeFromList } from '@codemirror/autocomplete';
|
|
5
|
+
|
|
6
|
+
// This file was generated by lezer-generator. You probably shouldn't edit it.
|
|
7
|
+
const insertSemi = 178,
|
|
8
|
+
_if = 1,
|
|
9
|
+
_else = 2,
|
|
10
|
+
elseif = 3,
|
|
11
|
+
_for = 4,
|
|
12
|
+
_while = 5,
|
|
13
|
+
_do = 6,
|
|
14
|
+
_switch = 7,
|
|
15
|
+
_break = 8,
|
|
16
|
+
_continue = 9,
|
|
17
|
+
_return = 10,
|
|
18
|
+
_try = 11,
|
|
19
|
+
_catch = 12,
|
|
20
|
+
_finally = 13,
|
|
21
|
+
_throw = 14,
|
|
22
|
+
rethrow = 15,
|
|
23
|
+
_function = 16,
|
|
24
|
+
_var = 17,
|
|
25
|
+
_new = 18,
|
|
26
|
+
_import = 19,
|
|
27
|
+
_in = 20,
|
|
28
|
+
_null = 21,
|
|
29
|
+
_true = 22,
|
|
30
|
+
_false = 23,
|
|
31
|
+
not = 24,
|
|
32
|
+
and = 25,
|
|
33
|
+
or = 26,
|
|
34
|
+
xor = 27,
|
|
35
|
+
eqv = 28,
|
|
36
|
+
imp = 29,
|
|
37
|
+
mod = 30,
|
|
38
|
+
eq = 31,
|
|
39
|
+
neq = 32,
|
|
40
|
+
is = 33,
|
|
41
|
+
gt = 34,
|
|
42
|
+
lt = 35,
|
|
43
|
+
gte = 36,
|
|
44
|
+
lte = 37,
|
|
45
|
+
ge = 38,
|
|
46
|
+
le = 39,
|
|
47
|
+
contains = 40,
|
|
48
|
+
_case = 41,
|
|
49
|
+
_default = 42,
|
|
50
|
+
component = 43,
|
|
51
|
+
_interface = 44,
|
|
52
|
+
property = 45,
|
|
53
|
+
required = 46,
|
|
54
|
+
Modifier = 47,
|
|
55
|
+
ScriptTagName = 48,
|
|
56
|
+
spaces = 180,
|
|
57
|
+
newline = 181,
|
|
58
|
+
LineComment = 49,
|
|
59
|
+
BlockComment = 50;
|
|
60
|
+
|
|
61
|
+
// Hand-written tokenizers for CFScript.
|
|
62
|
+
//
|
|
63
|
+
// trackNewline and insertSemicolon are adapted from @lezer/javascript
|
|
64
|
+
// (MIT licence, copyright Marijn Haverbeke and others). CFScript, like
|
|
65
|
+
// JavaScript, lets a line break end a statement.
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
const trackNewline = new ContextTracker({
|
|
69
|
+
start: false,
|
|
70
|
+
shift(context, term) {
|
|
71
|
+
return term == LineComment || term == BlockComment || term == spaces ? context : term == newline;
|
|
72
|
+
},
|
|
73
|
+
strict: false,
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
const braceR = 125;
|
|
77
|
+
|
|
78
|
+
// If the next token can't continue the statement, a line break, a closing
|
|
79
|
+
// brace or the end of the file ends it.
|
|
80
|
+
const insertSemicolon = new ExternalTokenizer(
|
|
81
|
+
(input, stack) => {
|
|
82
|
+
const { next } = input;
|
|
83
|
+
if (next == braceR || next == -1 || stack.context) input.acceptToken(insertSemi);
|
|
84
|
+
},
|
|
85
|
+
{ contextual: true, fallback: true }
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
// CFML keywords are case-insensitive, so `IF`, `If` and `if` are all the same.
|
|
89
|
+
const keywords$1 = {
|
|
90
|
+
if: _if, else: _else, elseif, for: _for, while: _while, do: _do, switch: _switch,
|
|
91
|
+
break: _break, continue: _continue, return: _return, try: _try,
|
|
92
|
+
catch: _catch, finally: _finally, throw: _throw, rethrow, function: _function, var: _var,
|
|
93
|
+
new: _new, import: _import, in: _in, null: _null, true: _true, false: _false,
|
|
94
|
+
not, and, or, xor, eqv, imp, mod, eq, neq, is, gt, lt, gte, lte, ge, le, contains,
|
|
95
|
+
__proto__: null,
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
function specializeKeyword(value) {
|
|
99
|
+
const found = keywords$1[value.toLowerCase()];
|
|
100
|
+
return found == null ? -1 : found;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// These words are keywords in some places only, so they can still be names.
|
|
104
|
+
const softKeywords = {
|
|
105
|
+
case: _case, default: _default, component, interface: _interface, property, required,
|
|
106
|
+
public: Modifier, private: Modifier, package: Modifier, remote: Modifier,
|
|
107
|
+
static: Modifier, final: Modifier, abstract: Modifier,
|
|
108
|
+
__proto__: null,
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
// Tags that CFScript can write as statements without the `cf` prefix, as in
|
|
112
|
+
// `lock name="x" { }` or `abort;`. Any word starting with `cf`, such as
|
|
113
|
+
// `cfloop` or `cfhttp`, can also start a tag statement.
|
|
114
|
+
const scriptTags = [
|
|
115
|
+
"abort", "content", "cookie", "directory", "dump", "execute", "exit", "file", "flush",
|
|
116
|
+
"header", "http", "include", "location", "lock", "log", "loop", "mail", "output", "param",
|
|
117
|
+
"query", "savecontent", "setting", "thread", "timer", "transaction", "zip",
|
|
118
|
+
];
|
|
119
|
+
|
|
120
|
+
const scriptTagSet = new Set(scriptTags);
|
|
121
|
+
|
|
122
|
+
function extendKeyword(value) {
|
|
123
|
+
const lower = value.toLowerCase();
|
|
124
|
+
const soft = softKeywords[lower];
|
|
125
|
+
if (soft != null) return soft;
|
|
126
|
+
if (scriptTagSet.has(lower) || /^cf[a-z]+$/.test(lower)) return ScriptTagName;
|
|
127
|
+
return -1;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
const cfmlHighlight = styleTags({
|
|
131
|
+
"if else elseif for while do switch case default break continue return try catch finally throw rethrow":
|
|
132
|
+
tags.controlKeyword,
|
|
133
|
+
"in": tags.operatorKeyword,
|
|
134
|
+
"function var new import component interface property": tags.definitionKeyword,
|
|
135
|
+
"required Modifier": tags.modifier,
|
|
136
|
+
WordOp: tags.operatorKeyword,
|
|
137
|
+
null: tags.null,
|
|
138
|
+
BooleanLiteral: tags.bool,
|
|
139
|
+
Number: tags.number,
|
|
140
|
+
"String Quote": tags.string,
|
|
141
|
+
Escape: tags.escape,
|
|
142
|
+
"Interpolation/#": tags.special(tags.brace),
|
|
143
|
+
"HashExpression/#": tags.special(tags.brace),
|
|
144
|
+
LineComment: tags.lineComment,
|
|
145
|
+
BlockComment: tags.blockComment,
|
|
146
|
+
VariableName: tags.variableName,
|
|
147
|
+
"VariableDefinition": tags.definition(tags.variableName),
|
|
148
|
+
"FunctionDeclaration/VariableDefinition": tags.function(tags.definition(tags.variableName)),
|
|
149
|
+
"CallExpression/VariableName": tags.function(tags.variableName),
|
|
150
|
+
"CallExpression/MemberExpression/PropertyName": tags.function(tags.propertyName),
|
|
151
|
+
PropertyName: tags.propertyName,
|
|
152
|
+
PropertyDefinition: tags.definition(tags.propertyName),
|
|
153
|
+
"TypeName ComponentPath/...": tags.typeName,
|
|
154
|
+
ImportPath: tags.namespace,
|
|
155
|
+
AttributeName: tags.attributeName,
|
|
156
|
+
ScriptTagName: tags.tagName,
|
|
157
|
+
ArithOp: tags.arithmeticOperator,
|
|
158
|
+
ConcatOp: tags.operator,
|
|
159
|
+
LogicOp: tags.logicOperator,
|
|
160
|
+
CompareOp: tags.compareOperator,
|
|
161
|
+
UpdateOp: tags.updateOperator,
|
|
162
|
+
"=>": tags.punctuation,
|
|
163
|
+
"( )": tags.paren,
|
|
164
|
+
"[ ]": tags.squareBracket,
|
|
165
|
+
"{ }": tags.brace,
|
|
166
|
+
".": tags.derefOperator,
|
|
167
|
+
", ;": tags.separator,
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
// This file was generated by lezer-generator. You probably shouldn't edit it.
|
|
171
|
+
const parser = LRParser.deserialize({
|
|
172
|
+
version: 14,
|
|
173
|
+
states: "!&hQ`QPOOOOQO'#Fq'#FqO#xQPO'#DbOOQW'#Dl'#DlO'oQYO'#DmO'vQPO'#DnO*_QPO'#DqO*iQPO'#DtO-VQPO'#EUO-^QSO'#EOO-fQPO'#EVO-kQ[O'#E[O-vQPO'#E^O-{QPO'#E_O.QQYO'#EzO0|QPO'#E`O-{QPO'#EfO*sQPO'#EgO-{QPO'#EhO1RQPO'#ElO1WQXO'#EoO1bQSO'#ErO1mQXO'#EpO2UQXO'#EtO2UQXO'#EuO2UQXO'#EvO2^QSO'#EwO2iQ[O'#EyOOQO'#Gd'#GdO3QQPO'#E{OOQO'#FR'#FROOQO'#FS'#FSOOQW'#FT'#FTO'vQPO'#FQO'vQPO'#FUO6eQYO'#G^OOQW'#G^'#G^O7OO`O'#DeO7^OpO'#DeO7lQSO'#DbO7lQSO'#FoOOQO'#Fp'#FpQ`QPOOOOQO-E9o-E9oOOQO'#EW'#EWO-aQSO,5:qO7tQPO,5:qO-vQPO,5:xO7lQSO,59|O7yQYO'#DmO;YQQO,5:YO;aQSO'#D{O;oQPO'#EOO;tQQO,5:]O;{QPO'#E}O<ZQPO'#GjO<cQPO,5;hO<hQQO'#G`O<rQPO,5:`O?mQQO'#G^O?}QPO'#GaO@VQPO,5:bO@[QPO'#E^OOQO'#Fy'#FyO@jQPO,5:pOOQW,5:p,5:pO@qQPO'#EPOOQO'#EX'#EXO;oQPO,5:qO1RQPO,5:jOOQW'#Dd'#DdOOQO'#Ge'#GeO@|Q[O'#E]OOQW'#F{'#F{O-kQ[O,5:vOOQO,5:v,5:vOOQW'#ET'#ETOAeQXO,5:xO'vQPO'#DqO*sQPO,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!_VR$`!TR$t!dSyOzW!aW!b$Q&RQ#^aQ$|!qQ%a#[Q%b#]S'^%d'`Q(V&{R(t(WQ!mZQ!u^Q#bdQ#ffQ#hgQ#ihQ#jiQ#okQ$y!lQ$z!oQ%k#aQ%o#gQ%r#lS%s#m#nQ&W$XQ&u$uQ'm%vS's&U&tQ(U&zQ(b'ZQ(j'lS(k'r'tQ(m'uR)Q(lQ&}$|R)S(tT'_%d'`R%R!tR!YU",
|
|
176
|
+
nodeNames: "⚠ if else elseif for while do switch break continue return try catch finally throw rethrow function var new import in null true false WordOp WordOp WordOp WordOp WordOp WordOp WordOp WordOp WordOp WordOp WordOp WordOp WordOp WordOp WordOp WordOp WordOp case default component interface property required Modifier ScriptTagName LineComment BlockComment Script ComponentDeclaration ComponentAttribute AttributeName String Quote Escape # Interpolation # Number BooleanLiteral VariableName HashExpression ) ( ParenthesizedExpression ] [ ArrayExpression , OrderedStructExpression Property : } { StructExpression Property PropertyDefinition FunctionExpression ParamList Parameter TypeName . VariableDefinition Block FunctionDeclaration TypeName VariableDefinition FunctionAttribute ; PropertyDeclaration TagAttribute VariableDeclaration IfStatement ForStatement ForSpec ForInSpec MemberExpression ?. PropertyName WhileStatement DoStatement SwitchStatement SwitchBody CaseLabel DefaultLabel TryStatement CatchClause FinallyClause ReturnStatement ThrowStatement ArgList NewExpression ComponentPath RethrowStatement BreakStatement ContinueStatement ImportStatement ImportPath ScriptTag ExpressionStatement ArrowFunction ParamList Parameter => CallExpression UnaryExpression LogicOp ArithOp UpdateOp NotExpression PostfixExpression BinaryExpression ArithOp ArithOp ConcatOp CompareOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp ElvisExpression LogicOp ?: AssignmentExpression UpdateOp Quote Quote Escape Interpolation # Quote AttributeMember ComponentBody InterfaceDeclaration",
|
|
177
|
+
maxTerm: 227,
|
|
178
|
+
context: trackNewline,
|
|
179
|
+
nodeProps: [
|
|
180
|
+
["group", -22,21,55,61,62,63,64,67,70,72,77,80,99,114,123,127,128,132,133,134,141,144,147,"Expression",-19,86,87,91,92,94,95,96,102,103,104,108,111,112,116,117,118,119,121,122,"Statement"],
|
|
181
|
+
["isolate", -2,49,50,""],
|
|
182
|
+
["openedBy", 65,"(",68,"[",75,"{"],
|
|
183
|
+
["closedBy", 66,")",69,"]",76,"}"]
|
|
184
|
+
],
|
|
185
|
+
propSources: [cfmlHighlight],
|
|
186
|
+
skippedNodes: [0,49,50],
|
|
187
|
+
repeatNodeCount: 19,
|
|
188
|
+
tokenData: "2V~R!YXY$qYZ%fZ[$q]^%fpq$qqr%krs&Qst&Vtu&[uv'Rvw'`wx'uxy'zyz(Pz{(U{|(c|}(x}!O(}!O!P)d!P!Q*f!Q![,i![!],z!]!^-P!^!_-U!_!`-c!`!a.Q!a!b._!c!}&[!}#O.t#O#P.y#P#Q/O#Q#R/T#R#S&[#T#o&[#o#p/Y#p#q/_#q#r/j$f$g$q$g#BY&[#BY#BZ/o#BZ$IS&[$IS$I_/o$I_$I|&[$I|$I}1d$I}$JO1d$JO$JT&[$JT$JU/o$JU$KV&[$KV$KW/o$KW&FU&[&FU&FV/o&FV;'S&[;'S;=`&{<%l?HT&[?HT?HU/o?HUO&[~$vY$z~XY$qZ[$qpq$q$f$g$q#BY#BZ$q$IS$I_$q$JT$JU$q$KV$KW$q&FU&FV$q?HT?HU$q~%kO${~[%pP%_S!_!`%sW%xP%jW!_!`%{W&QO%lW~&VO!Y~~&[O![~l&cW%R[$|`tu&[!Q![&[!c!}&[#R#S&[#T#o&[$g;'S&[;'S;=`&{<%lO&[l'OP;=`<%l&[~'WP%g~!_!`'Z~'`O%y~~'eQ%h~vw'k!_!`'p~'pO%r~~'uO%z~~'zO$[~~(PO!d~~(UO!c~~(ZP%]~!_!`(^~(cO%w~~(hQ%`~{|(n!_!`(s~(sO%b~~(xO%u~~(}O!i~~)SQ%a~}!O)Y!_!`)_~)_O%c~~)dO%v~~)iP!v~!Q![)l~)qR!_~!Q![)l!g!h)z#X#Y)z~)}R{|*W}!O*W!Q![*^~*ZP!Q![*^~*cP!_~!Q![*^~*kR%e~z{*t!P!Q+{!_!`,d~*wTOz*tz{+W{;'S*t;'S;=`+u<%lO*t~+ZVOz*tz{+W{!P*t!P!Q+p!Q;'S*t;'S;=`+u<%lO*t~+uO!S~~+xP;=`<%l*t~,QS!R~OY+{Z;'S+{;'S;=`,^<%lO+{~,aP;=`<%l+{~,iO%x~~,nS!_~!O!P)l!Q![,i!g!h)z#X#Y)z~-PO!l~~-UO!}~~-ZP%m~!_!`-^~-cO%o~~-hQ$}~!_!`-n!`!a-{~-sP%i~!_!`-v~-{O%k~~.QO#r~~.VP%n~!_!`.Y~._O%p~~.dQ%t~!O!P.j![!].o~.oO#W~~.tO$W~~.yO!g~~/OO%f~~/TO!f~~/YO%d~~/_O!n~~/bP#p#q/e~/jO%s~~/oO!m~~/xh$z~%R[$|`XY$qZ[$qpq$qtu&[!Q![&[!c!}&[#R#S&[#T#o&[$f$g$q$g#BY&[#BY#BZ/o#BZ$IS&[$IS$I_/o$I_$JT&[$JT$JU/o$JU$KV&[$KV$KW/o$KW&FU&[&FU&FV/o&FV;'S&[;'S;=`&{<%l?HT&[?HT?HU/o?HUO&[~1mW${~%R[$|`tu&[!Q![&[!c!}&[#R#S&[#T#o&[$g;'S&[;'S;=`&{<%lO&[",
|
|
189
|
+
tokenizers: [2, 3, 4, insertSemicolon, new LocalTokenGroup("r~RQrsXstf~^P$Z~rsa~fO!Z~~kP!^~sta!Z$Z!^~", 30, 185), new LocalTokenGroup("r~RQstXwxf~^P$_~sta~fO$]~~kP$`~wxa$]$`$_~", 30, 227)],
|
|
190
|
+
topRules: {"Script":[0,51]},
|
|
191
|
+
specialized: [{term: 187, get: (value, stack) => (specializeKeyword(value) << 1), external: specializeKeyword},{term: 187, get: (value, stack) => (extendKeyword(value) << 1) | 1, external: extendKeyword, extend: true}],
|
|
192
|
+
tokenPrec: 4435
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
// Names of CFML's built-in functions, member functions and types, as found in
|
|
196
|
+
// both Adobe ColdFusion and Lucee. Names only, so completion can offer them.
|
|
197
|
+
const builtinFunctions = (
|
|
198
|
+
// Arrays
|
|
199
|
+
"arrayAppend arrayAvg arrayClear arrayContains arrayContainsNoCase arrayDelete arrayDeleteAt " +
|
|
200
|
+
"arrayDeleteNoCase arrayEach arrayEvery arrayFilter arrayFind arrayFindAll arrayFindAllNoCase " +
|
|
201
|
+
"arrayFindNoCase arrayFirst arrayIndexExists arrayInsertAt arrayIsDefined arrayIsEmpty arrayLast " +
|
|
202
|
+
"arrayLen arrayMap arrayMax arrayMedian arrayMerge arrayMid arrayMin arrayNew arrayPop arrayPrepend " +
|
|
203
|
+
"arrayPush arrayReduce arrayReduceRight arrayResize arrayReverse arraySet arrayShift arraySlice " +
|
|
204
|
+
"arraySome arraySort arraySplice arraySum arraySwap arrayToList arrayToStruct arrayUnshift " +
|
|
205
|
+
// Structs
|
|
206
|
+
"structAppend structClear structCopy structCount structDelete structEach structEvery structFilter " +
|
|
207
|
+
"structFind structFindKey structFindValue structGet structInsert structIsEmpty structKeyArray " +
|
|
208
|
+
"structKeyExists structKeyList structMap structNew structReduce structSome structSort structToSorted " +
|
|
209
|
+
"structUpdate structValueArray " +
|
|
210
|
+
// Lists
|
|
211
|
+
"listAppend listAvg listChangeDelims listCompact listContains listContainsNoCase listDeleteAt " +
|
|
212
|
+
"listEach listFilter listFind listFindNoCase listFirst listGetAt listInsertAt listItemTrim listLast " +
|
|
213
|
+
"listLen listMap listPrepend listQualify listReduce listRemoveDuplicates listRest listSetAt " +
|
|
214
|
+
"listSort listToArray listValueCount listValueCountNoCase " +
|
|
215
|
+
// Strings
|
|
216
|
+
"asc ascii chr compare compareNoCase find findNoCase findOneOf formatBaseN insert jsStringFormat " +
|
|
217
|
+
"lCase left len lJustify lTrim mid reEscape reFind reFindNoCase reMatch reMatchNoCase removeChars " +
|
|
218
|
+
"repeatString replace replaceList replaceNoCase reReplace reReplaceNoCase reverse right rJustify " +
|
|
219
|
+
"rTrim spanExcluding spanIncluding stringEach stringEvery stringFilter stringMap stringReduce " +
|
|
220
|
+
"stringSome stringSort toString trim uCase uCFirst val wrap " +
|
|
221
|
+
"htmlEditFormat htmlCodeFormat encodeForHTML encodeForURL urlEncodedFormat urlDecode " +
|
|
222
|
+
"toBase64 toBinary charsetDecode charsetEncode hash " +
|
|
223
|
+
// Numbers and maths
|
|
224
|
+
"abs aCos aSin atn bitAnd bitNot bitOr bitShln bitShrn bitXor ceiling cos decimalFormat " +
|
|
225
|
+
"decrementValue dollarFormat exp fix floor formatNumber incrementValue inputBaseN int log log10 " +
|
|
226
|
+
"max min numberFormat pi precisionEvaluate rand randomize randRange round sgn sin sqr sqrt tan " +
|
|
227
|
+
// Dates
|
|
228
|
+
"createDate createDateTime createODBCDate createODBCDateTime createTime createTimeSpan dateAdd " +
|
|
229
|
+
"dateCompare dateConvert dateDiff dateFormat datePart dateTimeFormat day dayOfWeek dayOfWeekAsString " +
|
|
230
|
+
"dayOfYear daysInMonth daysInYear firstDayOfMonth getTickCount hour isLeapYear minute month " +
|
|
231
|
+
"monthAsString now parseDateTime quarter second timeFormat week year " +
|
|
232
|
+
// Decisions
|
|
233
|
+
"isArray isBinary isBoolean isClosure isCustomFunction isDate isDefined isEmpty isInstanceOf " +
|
|
234
|
+
"isJSON isNull isNumeric isNumericDate isObject isQuery isSimpleValue isStruct isValid isXML " +
|
|
235
|
+
// Queries
|
|
236
|
+
"queryAddColumn queryAddRow queryColumnArray queryColumnCount queryColumnExists queryColumnList " +
|
|
237
|
+
"queryDeleteRow queryEach queryExecute queryFilter queryGetRow queryMap queryNew queryRecordCount " +
|
|
238
|
+
"queryReduce querySetCell querySort " +
|
|
239
|
+
// Other
|
|
240
|
+
"abort createObject createUUID deserializeJSON duplicate echo evaluate fileExists fileRead " +
|
|
241
|
+
"fileWrite getComponentMetadata getMetadata invoke javaCast location now nullValue serializeJSON " +
|
|
242
|
+
"sleep throw writeDump writeLog writeOutput").split(" ");
|
|
243
|
+
// Member functions offered after a dot, as in `name.len()` or `items.each()`.
|
|
244
|
+
const memberFunctions = (
|
|
245
|
+
// Strings
|
|
246
|
+
"asc compare compareNoCase find findNoCase findOneOf insert lCase left len listAppend " +
|
|
247
|
+
"listContains listDeleteAt listFind listFindNoCase listFirst listGetAt listLast listLen listPrepend " +
|
|
248
|
+
"listRest listSetAt listSort listToArray lTrim mid reFind reFindNoCase reMatch reMatchNoCase " +
|
|
249
|
+
"removeChars repeatString replace replaceNoCase reReplace reReplaceNoCase reverse right rTrim " +
|
|
250
|
+
"split spanExcluding spanIncluding toString trim uCase ucFirst val " +
|
|
251
|
+
"each every filter map reduce some sort " +
|
|
252
|
+
// Arrays
|
|
253
|
+
"append avg clear contains containsNoCase delete deleteAt deleteNoCase findAll findAllNoCase first " +
|
|
254
|
+
"indexExists insertAt isDefined isEmpty last max median merge min pop prepend push reduceRight " +
|
|
255
|
+
"resize set shift slice splice sum swap toList unshift " +
|
|
256
|
+
// Structs
|
|
257
|
+
"copy count findKey findValue keyArray keyExists keyList update valueArray " +
|
|
258
|
+
// Numbers and dates
|
|
259
|
+
"abs ceiling floor formatNumber round add diff format part dateFormat timeFormat dateTimeFormat " +
|
|
260
|
+
// Queries
|
|
261
|
+
"addColumn addRow columnArray columnList getRow recordCount").split(" ");
|
|
262
|
+
const types = ("any array binary boolean component date function guid numeric query string struct uuid " +
|
|
263
|
+
"variableName void xml").split(" ");
|
|
264
|
+
const scopes = ("application arguments cgi client cookie form local request server session this thread url variables").split(" ");
|
|
265
|
+
const keywords = ("abstract and break case catch component continue contains default do else elseif eq eqv false " +
|
|
266
|
+
"final finally for function ge gt gte if imp import in interface is le lt lte mod neq new not null " +
|
|
267
|
+
"or package private property public remote required rethrow return static switch throw true try " +
|
|
268
|
+
"var while xor").split(" ");
|
|
269
|
+
|
|
270
|
+
/// Snippets for the constructs people type most often.
|
|
271
|
+
const snippets = [
|
|
272
|
+
snippetCompletion("component {\n\t${}\n}", {
|
|
273
|
+
label: "component",
|
|
274
|
+
detail: "definition",
|
|
275
|
+
type: "keyword",
|
|
276
|
+
}),
|
|
277
|
+
snippetCompletion("function ${name}(${params}) {\n\t${}\n}", {
|
|
278
|
+
label: "function",
|
|
279
|
+
detail: "definition",
|
|
280
|
+
type: "keyword",
|
|
281
|
+
}),
|
|
282
|
+
snippetCompletion("public ${any} function ${name}(${params}) {\n\t${}\n}", {
|
|
283
|
+
label: "public",
|
|
284
|
+
detail: "function definition",
|
|
285
|
+
type: "keyword",
|
|
286
|
+
}),
|
|
287
|
+
snippetCompletion("private ${any} function ${name}(${params}) {\n\t${}\n}", {
|
|
288
|
+
label: "private",
|
|
289
|
+
detail: "function definition",
|
|
290
|
+
type: "keyword",
|
|
291
|
+
}),
|
|
292
|
+
snippetCompletion("function(${params}) {\n\t${}\n}", {
|
|
293
|
+
label: "function",
|
|
294
|
+
detail: "closure",
|
|
295
|
+
type: "keyword",
|
|
296
|
+
}),
|
|
297
|
+
snippetCompletion("if (${condition}) {\n\t${}\n}", {
|
|
298
|
+
label: "if",
|
|
299
|
+
detail: "block",
|
|
300
|
+
type: "keyword",
|
|
301
|
+
}),
|
|
302
|
+
snippetCompletion("if (${condition}) {\n\t${}\n} else {\n\t${}\n}", {
|
|
303
|
+
label: "if",
|
|
304
|
+
detail: "/ else block",
|
|
305
|
+
type: "keyword",
|
|
306
|
+
}),
|
|
307
|
+
snippetCompletion("else if (${condition}) {\n\t${}\n}", {
|
|
308
|
+
label: "else if",
|
|
309
|
+
detail: "branch",
|
|
310
|
+
type: "keyword",
|
|
311
|
+
}),
|
|
312
|
+
snippetCompletion("for (var ${i} = 1; ${i} <= ${n}; ${i}++) {\n\t${}\n}", {
|
|
313
|
+
label: "for",
|
|
314
|
+
detail: "loop",
|
|
315
|
+
type: "keyword",
|
|
316
|
+
}),
|
|
317
|
+
snippetCompletion("for (var ${item} in ${items}) {\n\t${}\n}", {
|
|
318
|
+
label: "for",
|
|
319
|
+
detail: "in loop",
|
|
320
|
+
type: "keyword",
|
|
321
|
+
}),
|
|
322
|
+
snippetCompletion("while (${condition}) {\n\t${}\n}", {
|
|
323
|
+
label: "while",
|
|
324
|
+
detail: "loop",
|
|
325
|
+
type: "keyword",
|
|
326
|
+
}),
|
|
327
|
+
snippetCompletion("do {\n\t${}\n} while (${condition});", {
|
|
328
|
+
label: "do",
|
|
329
|
+
detail: "loop",
|
|
330
|
+
type: "keyword",
|
|
331
|
+
}),
|
|
332
|
+
snippetCompletion('switch (${value}) {\n\tcase ${"a"}:\n\t\t${}\n\t\tbreak;\n\tdefault:\n\t\t${}\n}', {
|
|
333
|
+
label: "switch",
|
|
334
|
+
detail: "block",
|
|
335
|
+
type: "keyword",
|
|
336
|
+
}),
|
|
337
|
+
snippetCompletion("try {\n\t${}\n} catch (any ${e}) {\n\t${}\n}", {
|
|
338
|
+
label: "try",
|
|
339
|
+
detail: "/ catch block",
|
|
340
|
+
type: "keyword",
|
|
341
|
+
}),
|
|
342
|
+
snippetCompletion("var ${name} = ${value};", {
|
|
343
|
+
label: "var",
|
|
344
|
+
detail: "declaration",
|
|
345
|
+
type: "keyword",
|
|
346
|
+
}),
|
|
347
|
+
snippetCompletion('property name="${name}" type="${string}";', {
|
|
348
|
+
label: "property",
|
|
349
|
+
detail: "declaration",
|
|
350
|
+
type: "keyword",
|
|
351
|
+
}),
|
|
352
|
+
snippetCompletion('throw(type="${type}", message="${message}");', {
|
|
353
|
+
label: "throw",
|
|
354
|
+
detail: "error",
|
|
355
|
+
type: "keyword",
|
|
356
|
+
}),
|
|
357
|
+
];
|
|
358
|
+
// Snippets that are expressions, so they fit anywhere.
|
|
359
|
+
const expressionSnippets = snippets.filter((s) => s.detail == "closure");
|
|
360
|
+
const keywordOptions = keywords.map((label) => ({ label, type: "keyword" }));
|
|
361
|
+
const functionOptions = builtinFunctions.map((label) => ({ label, type: "function" }));
|
|
362
|
+
const scopeOptions = scopes.map((label) => ({ label, type: "namespace" }));
|
|
363
|
+
const typeOptions = types.map((label) => ({ label, type: "type" }));
|
|
364
|
+
const memberOptions = [...new Set(memberFunctions)].map((label) => ({ label, type: "method" }));
|
|
365
|
+
const functionNodes = new Set(["FunctionDeclaration", "FunctionExpression", "ArrowFunction"]);
|
|
366
|
+
// Scopes whose names completion knows after a dot, as in `arguments.` or `this.`.
|
|
367
|
+
const localScopes = new Set(["local", "arguments"]);
|
|
368
|
+
const componentScopes = new Set(["variables", "this"]);
|
|
369
|
+
function text(doc, node) {
|
|
370
|
+
return doc.sliceString(node.from, node.to);
|
|
371
|
+
}
|
|
372
|
+
function add(names, name, type) {
|
|
373
|
+
if (name && !names.has(name))
|
|
374
|
+
names.set(name, type);
|
|
375
|
+
}
|
|
376
|
+
// The parameters of a function, a closure or an arrow function.
|
|
377
|
+
function parameters(fn, doc, names) {
|
|
378
|
+
const list = fn.getChild("ParamList");
|
|
379
|
+
if (!list) {
|
|
380
|
+
const single = fn.getChild("VariableDefinition");
|
|
381
|
+
if (single && fn.name == "ArrowFunction")
|
|
382
|
+
add(names, text(doc, single), "variable");
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
385
|
+
for (const param of list.getChildren("Parameter")) {
|
|
386
|
+
const name = param.getChild("VariableDefinition");
|
|
387
|
+
if (name)
|
|
388
|
+
add(names, text(doc, name), "variable");
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
// Visits every node inside `node`, without going into nested functions.
|
|
392
|
+
function walkBody(node, visit) {
|
|
393
|
+
for (let child = node.firstChild; child; child = child.nextSibling) {
|
|
394
|
+
if (functionNodes.has(child.name))
|
|
395
|
+
continue;
|
|
396
|
+
visit(child);
|
|
397
|
+
walkBody(child, visit);
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
// For `local.total` or `variables.total`, the scope's name in lower case.
|
|
401
|
+
function scopeOf(member, doc) {
|
|
402
|
+
var _a;
|
|
403
|
+
const base = member.firstChild;
|
|
404
|
+
return base && base.name == "VariableName" && ((_a = base.nextSibling) === null || _a === void 0 ? void 0 : _a.name) == "." ? text(doc, base).toLowerCase() : null;
|
|
405
|
+
}
|
|
406
|
+
// The names a function keeps to itself: `var` declarations, `local.` names,
|
|
407
|
+
// loop variables and caught errors. If `before` is given, only the names
|
|
408
|
+
// declared before that position count.
|
|
409
|
+
function functionLocals(fn, doc, names, before) {
|
|
410
|
+
walkBody(fn, (node) => {
|
|
411
|
+
var _a;
|
|
412
|
+
if (before != null && node.from >= before)
|
|
413
|
+
return;
|
|
414
|
+
if (node.name == "VariableDefinition") {
|
|
415
|
+
const parent = node.parent.name;
|
|
416
|
+
if (parent == "VariableDeclaration" || parent == "ForSpec" || parent == "CatchClause") {
|
|
417
|
+
add(names, text(doc, node), "variable");
|
|
418
|
+
}
|
|
419
|
+
else if (parent == "ForInSpec" && ((_a = node.prevSibling) === null || _a === void 0 ? void 0 : _a.name) == "var") {
|
|
420
|
+
add(names, text(doc, node), "variable");
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
else if (node.name == "AssignmentExpression" || node.name == "ForInSpec") {
|
|
424
|
+
const target = node.name == "ForInSpec" ? node.getChild("MemberExpression") : node.firstChild;
|
|
425
|
+
if ((target === null || target === void 0 ? void 0 : target.name) == "MemberExpression" && scopeOf(target, doc) == "local") {
|
|
426
|
+
const prop = target.getChild("PropertyName");
|
|
427
|
+
if (prop)
|
|
428
|
+
add(names, text(doc, prop), "variable");
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
// Whether a name belongs to a function around `node`.
|
|
434
|
+
function isLocalTo(node, name, doc) {
|
|
435
|
+
for (let p = node.parent; p; p = p.parent) {
|
|
436
|
+
if (functionNodes.has(p.name)) {
|
|
437
|
+
const names = new Map();
|
|
438
|
+
parameters(p, doc, names);
|
|
439
|
+
functionLocals(p, doc, names);
|
|
440
|
+
if (names.has(name))
|
|
441
|
+
return true;
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
return false;
|
|
445
|
+
}
|
|
446
|
+
// `property name="total";` and `property numeric total;` both name `total`.
|
|
447
|
+
function propertyName(prop, doc) {
|
|
448
|
+
let bare = null;
|
|
449
|
+
for (const attr of prop.getChildren("TagAttribute")) {
|
|
450
|
+
const key = attr.getChild("AttributeName");
|
|
451
|
+
if (!key)
|
|
452
|
+
continue;
|
|
453
|
+
const value = key.nextSibling;
|
|
454
|
+
if (!value)
|
|
455
|
+
bare = text(doc, key);
|
|
456
|
+
else if (text(doc, key).toLowerCase() == "name" && value.name == "String") {
|
|
457
|
+
return text(doc, value).slice(1, -1);
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
return bare;
|
|
461
|
+
}
|
|
462
|
+
const componentCache = new WeakMap();
|
|
463
|
+
// The names the whole component or script can see: its functions and
|
|
464
|
+
// properties, and every variable set outside a function's own scope (as in
|
|
465
|
+
// `total = 0`, `variables.total = 0` or `this.total = 0`).
|
|
466
|
+
function componentNames(tree, doc) {
|
|
467
|
+
const cached = componentCache.get(tree);
|
|
468
|
+
if (cached)
|
|
469
|
+
return cached;
|
|
470
|
+
const names = new Map();
|
|
471
|
+
tree.iterate({
|
|
472
|
+
enter(ref) {
|
|
473
|
+
var _a, _b;
|
|
474
|
+
const node = ref.node;
|
|
475
|
+
if (node.name == "FunctionDeclaration") {
|
|
476
|
+
const name = node.getChild("VariableDefinition");
|
|
477
|
+
if (name)
|
|
478
|
+
add(names, text(doc, name), "function");
|
|
479
|
+
}
|
|
480
|
+
else if (node.name == "PropertyDeclaration") {
|
|
481
|
+
const name = propertyName(node, doc);
|
|
482
|
+
if (name)
|
|
483
|
+
add(names, name, "property");
|
|
484
|
+
}
|
|
485
|
+
else if (node.name == "AssignmentExpression" || node.name == "ForInSpec") {
|
|
486
|
+
const target = node.name == "ForInSpec"
|
|
487
|
+
? (_a = node.getChild("VariableDefinition")) !== null && _a !== void 0 ? _a : node.getChild("MemberExpression")
|
|
488
|
+
: node.firstChild;
|
|
489
|
+
if (!target || ((_b = target.prevSibling) === null || _b === void 0 ? void 0 : _b.name) == "var")
|
|
490
|
+
return;
|
|
491
|
+
if (target.name == "VariableName" || target.name == "VariableDefinition") {
|
|
492
|
+
const name = text(doc, target);
|
|
493
|
+
if (!isLocalTo(node, name, doc))
|
|
494
|
+
add(names, name, "variable");
|
|
495
|
+
}
|
|
496
|
+
else if (target.name == "MemberExpression") {
|
|
497
|
+
const scope = scopeOf(target, doc);
|
|
498
|
+
const prop = target.getChild("PropertyName");
|
|
499
|
+
if (scope && componentScopes.has(scope) && prop)
|
|
500
|
+
add(names, text(doc, prop), "variable");
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
},
|
|
504
|
+
});
|
|
505
|
+
componentCache.set(tree, names);
|
|
506
|
+
return names;
|
|
507
|
+
}
|
|
508
|
+
// The names visible at `pos`: the parameters and earlier locals of the
|
|
509
|
+
// functions around it, then the component's names. If `scope` is given,
|
|
510
|
+
// only the names that scope holds.
|
|
511
|
+
function namesAt(tree, doc, pos, scope) {
|
|
512
|
+
const names = new Map();
|
|
513
|
+
if (scope == null || localScopes.has(scope)) {
|
|
514
|
+
for (let p = tree.resolveInner(pos, -1); p; p = p.parent) {
|
|
515
|
+
if (!functionNodes.has(p.name))
|
|
516
|
+
continue;
|
|
517
|
+
if (scope != "local")
|
|
518
|
+
parameters(p, doc, names);
|
|
519
|
+
if (scope != "arguments")
|
|
520
|
+
functionLocals(p, doc, names, pos);
|
|
521
|
+
if (scope)
|
|
522
|
+
break;
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
if (scope == null || componentScopes.has(scope)) {
|
|
526
|
+
for (const [name, type] of componentNames(tree, doc))
|
|
527
|
+
add(names, name, type);
|
|
528
|
+
}
|
|
529
|
+
return names;
|
|
530
|
+
}
|
|
531
|
+
function toOptions(names) {
|
|
532
|
+
return [...names].map(([label, type]) => ({ label, type, boost: 1 }));
|
|
533
|
+
}
|
|
534
|
+
const dontComplete = new Set(["LineComment", "BlockComment", "PropertyDefinition", "AttributeName", "Number"]);
|
|
535
|
+
const identifier = /[\w$]+$/;
|
|
536
|
+
// True when the cursor sits in a string's text, outside any `#...#`.
|
|
537
|
+
function inStringText(node) {
|
|
538
|
+
for (let p = node; p; p = p.parent) {
|
|
539
|
+
if (p.name == "Interpolation" || p.name == "HashExpression")
|
|
540
|
+
return false;
|
|
541
|
+
if (p.name == "String")
|
|
542
|
+
return true;
|
|
543
|
+
}
|
|
544
|
+
return false;
|
|
545
|
+
}
|
|
546
|
+
// A parameter's type comes first, or after `required`.
|
|
547
|
+
const typeSlot = /(?:^\(|,|\brequired)\s*$/i;
|
|
548
|
+
const statementStart = /(?:^|[;{}])\s*(?:(?:public|private|package|remote|static|final|abstract)\s+)*$/i;
|
|
549
|
+
// Works out what kind of name the cursor is on.
|
|
550
|
+
function describe(context) {
|
|
551
|
+
var _a;
|
|
552
|
+
const { state, pos } = context;
|
|
553
|
+
const node = syntaxTree(state).resolveInner(pos, -1);
|
|
554
|
+
if (dontComplete.has(node.name) || inStringText(node))
|
|
555
|
+
return { kind: "none" };
|
|
556
|
+
const word = context.matchBefore(identifier);
|
|
557
|
+
const from = word ? word.from : pos;
|
|
558
|
+
const line = state.doc.lineAt(from);
|
|
559
|
+
const before = line.text.slice(0, from - line.from);
|
|
560
|
+
const member = /(?:([\w$]+)\s*|[)\]]\s*)\??\.\s*$/.exec(before);
|
|
561
|
+
if (!word && !context.explicit && !member)
|
|
562
|
+
return null;
|
|
563
|
+
if (member)
|
|
564
|
+
return { kind: "member", from, scope: member[1] ? member[1].toLowerCase() : null };
|
|
565
|
+
if (node.name == "VariableDefinition" || node.name == "TypeName") {
|
|
566
|
+
const param = node.parent;
|
|
567
|
+
const list = param === null || param === void 0 ? void 0 : param.parent;
|
|
568
|
+
if ((param === null || param === void 0 ? void 0 : param.name) == "Parameter" && (list === null || list === void 0 ? void 0 : list.name) == "ParamList" && ((_a = list.parent) === null || _a === void 0 ? void 0 : _a.name) != "ArrowFunction") {
|
|
569
|
+
if (typeSlot.test(state.doc.sliceString(list.from, from)))
|
|
570
|
+
return { kind: "type", from };
|
|
571
|
+
}
|
|
572
|
+
if (node.name == "VariableDefinition")
|
|
573
|
+
return { kind: "none" };
|
|
574
|
+
}
|
|
575
|
+
return { kind: "expression", from, statementStart: statementStart.test(before) };
|
|
576
|
+
}
|
|
577
|
+
/// Completes the names declared in the file that are in scope at the
|
|
578
|
+
/// cursor. After `arguments.`, `local.`, `variables.` or `this.` it offers
|
|
579
|
+
/// the names that scope holds.
|
|
580
|
+
const localCompletionSource = (context) => {
|
|
581
|
+
const found = describe(context);
|
|
582
|
+
if (!found || found.kind == "none" || found.kind == "type")
|
|
583
|
+
return null;
|
|
584
|
+
const tree = syntaxTree(context.state);
|
|
585
|
+
const doc = context.state.doc;
|
|
586
|
+
if (found.kind == "member") {
|
|
587
|
+
const scope = found.scope;
|
|
588
|
+
if (!scope || !(localScopes.has(scope) || componentScopes.has(scope)))
|
|
589
|
+
return null;
|
|
590
|
+
return { from: found.from, options: toOptions(namesAt(tree, doc, context.pos, scope)), validFor: identifier };
|
|
591
|
+
}
|
|
592
|
+
return { from: found.from, options: toOptions(namesAt(tree, doc, context.pos)), validFor: identifier };
|
|
593
|
+
};
|
|
594
|
+
/// Completes keywords, built-in functions, scopes, types and snippets, and
|
|
595
|
+
/// member functions after a dot.
|
|
596
|
+
const cfmlCompletion = (context) => {
|
|
597
|
+
const found = describe(context);
|
|
598
|
+
if (!found || found.kind == "none")
|
|
599
|
+
return null;
|
|
600
|
+
if (found.kind == "type")
|
|
601
|
+
return { from: found.from, options: typeOptions, validFor: identifier };
|
|
602
|
+
if (found.kind == "member") {
|
|
603
|
+
if (found.scope && (localScopes.has(found.scope) || componentScopes.has(found.scope)))
|
|
604
|
+
return null;
|
|
605
|
+
return { from: found.from, options: memberOptions, validFor: identifier };
|
|
606
|
+
}
|
|
607
|
+
const options = [...keywordOptions, ...functionOptions, ...scopeOptions, ...expressionSnippets];
|
|
608
|
+
if (found.statementStart)
|
|
609
|
+
options.push(...snippets.filter((s) => !expressionSnippets.includes(s)), ...typeOptions);
|
|
610
|
+
return completeFromList(options)(context);
|
|
611
|
+
};
|
|
612
|
+
|
|
613
|
+
const cfmlLanguage = LRLanguage.define({
|
|
614
|
+
name: "cfml",
|
|
615
|
+
parser: parser.configure({
|
|
616
|
+
props: [
|
|
617
|
+
indentNodeProp.add({
|
|
618
|
+
"Block ComponentBody StructExpression": delimitedIndent({ closing: "}" }),
|
|
619
|
+
"ArrayExpression": delimitedIndent({ closing: "]" }),
|
|
620
|
+
"ArgList ParamList ParenthesizedExpression": delimitedIndent({ closing: ")" }),
|
|
621
|
+
// Labels sit one level in, and the statements under them two.
|
|
622
|
+
SwitchBody: (context) => {
|
|
623
|
+
const after = context.textAfter;
|
|
624
|
+
const closed = /^\s*\}/.test(after);
|
|
625
|
+
const isLabel = /^\s*(case|default)\b/i.test(after);
|
|
626
|
+
return context.baseIndent + (closed ? 0 : isLabel ? 1 : 2) * context.unit;
|
|
627
|
+
},
|
|
628
|
+
"IfStatement ForStatement WhileStatement DoStatement": continuedIndent({ except: /^\s*(\{|else\b)/i }),
|
|
629
|
+
"ExpressionStatement VariableDeclaration ReturnStatement": continuedIndent(),
|
|
630
|
+
}),
|
|
631
|
+
foldNodeProp.add({
|
|
632
|
+
"Block ComponentBody SwitchBody StructExpression ArrayExpression": foldInside,
|
|
633
|
+
BlockComment(tree) {
|
|
634
|
+
return { from: tree.from + 2, to: tree.to - 2 };
|
|
635
|
+
},
|
|
636
|
+
}),
|
|
637
|
+
],
|
|
638
|
+
}),
|
|
639
|
+
languageData: {
|
|
640
|
+
commentTokens: { line: "//", block: { open: "/*", close: "*/" } },
|
|
641
|
+
closeBrackets: { brackets: ["(", "[", "{", "'", '"'] },
|
|
642
|
+
indentOnInput: /^\s*(?:case |default:|\}|\]|\))$/,
|
|
643
|
+
},
|
|
644
|
+
});
|
|
645
|
+
function cfml() {
|
|
646
|
+
return new LanguageSupport(cfmlLanguage, [
|
|
647
|
+
cfmlLanguage.data.of({ autocomplete: localCompletionSource }),
|
|
648
|
+
cfmlLanguage.data.of({ autocomplete: cfmlCompletion }),
|
|
649
|
+
]);
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
export { cfml, cfmlCompletion, cfmlLanguage, localCompletionSource, snippets };
|