@valtzu/codemirror-lang-el 0.8.0 → 0.9.0

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/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { LRParser, LocalTokenGroup } from '@lezer/lr';
2
2
  import { syntaxTree, LRLanguage, indentNodeProp, delimitedIndent, foldNodeProp, LanguageSupport } from '@codemirror/language';
3
3
  import { styleTags, tags } from '@lezer/highlight';
4
- import { linter } from '@codemirror/lint';
4
+ import { linter as linter$1 } from '@codemirror/lint';
5
5
  import { insertCompletionText } from '@codemirror/autocomplete';
6
6
  import { StateField } from '@codemirror/state';
7
7
  import { showTooltip, hoverTooltip, EditorView } from '@codemirror/view';
@@ -12,35 +12,54 @@ const t = {
12
12
  };
13
13
 
14
14
  // This file was generated by lezer-generator. You probably shouldn't edit it.
15
- const spec_word = {__proto__:null,true:92, TRUE:94, false:96, FALSE:98, null:100, NULL:102, starts:112, with:114, ends:116, contains:118, matches:120, not:122, in:124, and:126, or:128, xor:130};
16
- const spec_Operator = {__proto__:null,"?":111, "!":133, "~":135, "+":137, "-":139};
17
- const parser = LRParser.deserialize({
15
+ const spec_word = {__proto__:null,true:90, TRUE:92, false:94, FALSE:96, null:98, NULL:100, starts:110, with:112, ends:114, contains:116, matches:118, not:120, in:122, and:124, or:126, xor:128};
16
+ const spec_Operator = {__proto__:null,"?":109, "!":131, "~":133, "+":135, "-":137};
17
+ const parser = /*@__PURE__*/LRParser.deserialize({
18
18
  version: 14,
19
- states: ")rOYQPOOP!aOPOOQ!fQPOOO#dQPO'#CeO$wQPO'#CnO%OQPO'#CoOYQPO'#CuOYQPO'#CwOOQO'#DS'#DSO%VQPO'#CdO%[QPO'#CdOOQO'#Cl'#ClOOQO'#Cm'#CmOOQO'#Cv'#CvP%aOQO'#C]POOO)C>r)C>rO%lQPO,58yOYQPO,58}OYQPO,59_OYQPO,59]O%qQPO'#CtOOQO'#Ct'#CtO%vQ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]O!U!_O~P!fOxma}mazma~P!fOoey!Weyxey}eyzey!Uey~P!fO}!]O!U!bO~O!W!cO~P!fO}nq!Unq~P!fO_TfS^wS~",
21
- goto: "%l}P!OP!RPP!d!R!R!g!x!{#^#aPP!R!R!R!R!R!RP!R#d!R#s!R$U$[$bPPPPPPP$hPPPPP%cR_PoWOSTUVabcmoz{!U!]!cRt`oXOSTUVabcmoz{!U!]!cRnXoYOSTUVabcmoz{!U!]!cRu`RnYkbQgiklvwx!V!W![!`!doUOSTUVabcmoz{!U!]!cQq^R!RqQ|iR!X|Q!^!VR!a!^QQOQgSUiTmoQkUQlVQvaQwbQxcQ!VzQ!W{Q![!UQ!`!]R!d!cQjTQ!PmR!Qo",
22
- nodeNames: "⚠ BlockComment Expression ObjectAccess MemberOf NullSafeMemberOf Property ArrayAccess Call Function Arguments ObjectAccess Method Arguments Number String Boolean Null Object Array Variable TernaryExpression Operator BinaryExpression OperatorKeyword UnaryExpression UnaryOperator Application",
23
- maxTerm: 69,
19
+ states: ")YOYQPOOP!aOPOOQ!fQPOOO#dQPO'#CeO$wQPO'#CmO%OQPO'#CnOYQPO'#CtOYQPO'#CvOOQO'#DR'#DRO%VQPO'#CdOOQO'#Ck'#CkOOQO'#Cl'#ClOOQO'#Cu'#CuP%[OQO'#C]POOO)C>q)C>qO%gQPO,58yOYQPO,58}OYQPO,59^OYQPO,59[O%lQPO'#CsOOQO'#Cs'#CsO%qQPO'#CsO&{QPO,59XOOQO,59X,59XO'SQPO'#DXO'aQPO,59YO'fQPO,59`O'|QPO,59bO(TQPO'#CfOOQO,59O,59OPOOO'#Cw'#CwP([OQO,58wPOOO,58w,58wO(gQPO'#CbOOQO1G.e1G.eOOQO1G.m1G.mO)zQPO1G.iO*RQPO1G.xO*iQPO1G.vOOQO,59_,59_OYQPO1G.sOYQPO'#CxO*pQPO,59sOOQO1G.t1G.tOOQO1G.|1G.|O*{QPO,59QPOOO-E6u-E6uPOOO1G.c1G.cOOQO7+$T7+$TOYQPO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XR!`!_QiTR}l",
22
+ nodeNames: "⚠ BlockComment Expression PropertyAccess MemberOf NullSafeMemberOf Property ArrayAccess Call Function Arguments MethodAccess Method Number String Boolean Null Object Array Variable TernaryExpression Operator BinaryExpression OperatorKeyword UnaryExpression UnaryOperator Application",
23
+ maxTerm: 68,
24
24
  nodeProps: [
25
- [t, 14,"number",15,"string",16,"bool",17,"null",18,"object",19,"array"]
25
+ [t, 13,"number",14,"string",15,"bool",16,"null",17,"object",18,"array"]
26
26
  ],
27
- skippedNodes: [0,1,28],
27
+ skippedNodes: [0,1,27],
28
28
  repeatNodeCount: 3,
29
- tokenData: "-a~RqXY#YYZ#Y]^#Ypq#Yqr#krs$Quv#{vw%zwx&Sxy'wyz'|z{(R{|#{|}(Z}!O#{!O!P(`!P!Q(h!Q![(u![!]+[!^!_+a!_!`+l!`!a+r!a!b+}!c!},b!}#O,s#P#Q,x#Q#R#{#R#S,b#T#o,b#o#p,}#p#q-S#q#r-[#r#s#{~#_Sq~XY#YYZ#Y]^#Ypq#Y~#pPf~!_!`#s~#xPf~!_!`#{~$QOf~~$TXOr$Qrs$ps#O$Q#O#P$u#P;'S$Q;'S;=`%t<%l~$Q~O$Q~~$p~$uO_~~$xRO;'S$Q;'S;=`%R;=`O$Q~%UYOr$Qrs$ps#O$Q#O#P$u#P;'S$Q;'S;=`%t;=`<%l$Q<%l~$Q~O$Q~~$p~%wP;=`<%l$Q~&PPf~vw#{~&VXOw&Swx$px#O&S#O#P&r#P;'S&S;'S;=`'q<%l~&S~O&S~~$p~&uRO;'S&S;'S;=`'O;=`O&S~'RYOw&Swx$px#O&S#O#P&r#P;'S&S;'S;=`'q;=`<%l&S<%l~&S~O&S~~$p~'tP;=`<%l&S~'|O{~~(ROz~~(WPf~z{#{~(`O}~~(ePS~!O!P#{~(mPf~z{(p~(uOr~~(zT^~!O!P)Z!Q![(u!g!h*Z#R#S+U#X#Y*Z~)^SO!O)j!P;'S)j;'S;=`+O<%lO)j~)oR^~!Q![)x!g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j;'S;=`+O<%lO)j~)oR]~!Q![)x!g!h*Z#X#Y*Z~)}S]~!Q![)x!g!h*Z#R#S*x#X#Y*Z~*^R{|*g}!O*g!Q![*m~*jP!Q![*m~*rQ]~!Q![*m#R#S*g~*{P!Q![)x~+RP;=`<%l)j~+XP!Q![(u~+aO!V~~+fQe~!^!_#{!_!`#{~+oP!_!`#s~+wQe~!_!`#{!`!a#{~,SRe~!O!P,]![!]#{!a!b#{~,bOT~~,gSv~!Q![,b!c!},b#R#S,b#T#o,b~,xOx~~,}Ow~~-SO!U~~-XPe~#p#q#{~-aO!T~",
30
+ tokenizers: [1, /*@__PURE__*/new LocalTokenGroup("j~RQYZXz{^~^Os~~aP!P!Qd~iOt~~", 25, 34)],
31
31
  topRules: {"Expression":[0,2]},
32
- specialized: [{term: 39, get: (value) => spec_word[value] || -1},{term: 22, get: (value) => spec_Operator[value] || -1}],
33
- tokenPrec: 542
32
+ specialized: [{term: 38, get: (value) => spec_word[value] || -1},{term: 21, get: (value) => spec_Operator[value] || -1}],
33
+ tokenPrec: 532
34
34
  });
35
35
 
36
- var ELScalar;
37
- (function (ELScalar) {
36
+ var ELScalar = /*@__PURE__*/(function (ELScalar) {
38
37
  ELScalar["Bool"] = "bool";
39
38
  ELScalar["Number"] = "number";
40
39
  ELScalar["String"] = "string";
41
40
  ELScalar["Null"] = "null";
42
41
  ELScalar["Any"] = "any";
43
- })(ELScalar || (ELScalar = {}));
42
+ return ELScalar})(ELScalar || (ELScalar = {}));
43
+
44
+ // This file was generated by lezer-generator. You probably shouldn't edit it.
45
+ const BlockComment = 1,
46
+ Expression = 2,
47
+ PropertyAccess = 3,
48
+ Property = 6,
49
+ ArrayAccess = 7,
50
+ Call = 8,
51
+ Function = 9,
52
+ Arguments = 10,
53
+ MethodAccess = 11,
54
+ Method = 12,
55
+ String = 14,
56
+ Array$1 = 18,
57
+ Variable = 19,
58
+ TernaryExpression = 20,
59
+ BinaryExpression = 22,
60
+ OperatorKeyword = 23,
61
+ UnaryExpression = 24,
62
+ Application = 26;
44
63
 
45
64
  const createInfoElement = (html) => {
46
65
  const dom = document.createElement("div");
@@ -54,30 +73,30 @@ function resolveFunctionDefinition(node, state, config) {
54
73
  return undefined;
55
74
  }
56
75
  let identifier;
57
- if (node.name === 'ObjectAccess' && node.lastChild) {
58
- const leftArgument = (_a = node.firstChild) === null || _a === void 0 ? void 0 : _a.node;
76
+ if ((node.type.is(PropertyAccess) || node.type.is(MethodAccess)) && node.lastChild) {
77
+ const leftArgument = (_a = node.firstChild) === null || _a === undefined ? undefined : _a.node;
59
78
  const types = Array.from(resolveTypes(state, leftArgument, config));
60
79
  identifier = state.sliceDoc(node.lastChild.from, node.lastChild.to);
61
- return types.map(type => { var _a; return resolveCallable(identifier, (_a = config.types) === null || _a === void 0 ? void 0 : _a[type]); }).find(x => x);
80
+ return types.map(type => { var _a; return resolveCallable(identifier, (_a = config.types) === null || _a === undefined ? undefined : _a[type]); }).find(x => x);
62
81
  }
63
- else if (node.name === 'Function') {
82
+ else if (node.type.is(Function)) {
64
83
  identifier = state.sliceDoc(node.from, node.node.firstChild ? node.node.firstChild.from - 1 : node.to);
65
84
  return resolveCallable(identifier, config);
66
85
  }
67
86
  }
68
- const resolveCallable = (identifier, config) => { var _a; return (_a = config === null || config === void 0 ? void 0 : config.functions) === null || _a === void 0 ? void 0 : _a.find(x => x.name === identifier); };
69
- const resolveIdentifier = (nodeName, identifier, config) => {
87
+ const resolveCallable = (identifier, config) => { var _a; return (_a = config === null || config === undefined ? undefined : config.functions) === null || _a === undefined ? undefined : _a.find(x => x.name === identifier); };
88
+ const resolveIdentifier = (nodeTypeId, identifier, config) => {
70
89
  var _a;
71
- switch (nodeName) {
72
- case 'Method':
73
- case 'Function':
90
+ switch (nodeTypeId) {
91
+ case Method:
92
+ case Function:
74
93
  return resolveCallable(identifier, config);
75
- case 'Property':
76
- case 'Variable':
77
- return (_a = config === null || config === void 0 ? void 0 : config.identifiers) === null || _a === void 0 ? void 0 : _a.find(x => x.name === identifier);
94
+ case Property:
95
+ case Variable:
96
+ return (_a = config === null || config === undefined ? undefined : config.identifiers) === null || _a === undefined ? undefined : _a.find(x => x.name === identifier);
78
97
  }
79
98
  };
80
- function resolveTypes(state, node, config, matchExact) {
99
+ function resolveTypes(state, node, config) {
81
100
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
82
101
  let types = new Set();
83
102
  if (!node) {
@@ -87,43 +106,43 @@ function resolveTypes(state, node, config, matchExact) {
87
106
  if (typeof (type = node.type.prop(t)) !== "undefined") {
88
107
  types.add(type);
89
108
  }
90
- else if (node.name === 'Call' && node.firstChild && node.lastChild) {
109
+ else if (node.type.is(Call) && node.firstChild && node.lastChild) {
91
110
  resolveTypes(state, node.firstChild, config).forEach(x => types.add(x));
92
111
  }
93
- else if (node.name === 'Variable') {
112
+ else if (node.type.is(Variable)) {
94
113
  const varName = state.sliceDoc(node.from, node.to) || '';
95
114
  // @ts-ignore
96
- (_b = (_a = resolveIdentifier(node.name, varName, config)) === null || _a === void 0 ? void 0 : _a.type) === null || _b === void 0 ? void 0 : _b.forEach((x) => types.add(x));
115
+ (_b = (_a = resolveIdentifier(node.type.id, varName, config)) === null || _a === undefined ? undefined : _a.type) === null || _b === undefined ? undefined : _b.forEach((x) => types.add(x));
97
116
  }
98
- else if (node.name === 'Function') {
117
+ else if (node.type.is(Function)) {
99
118
  const varName = state.sliceDoc(node.from, node.to) || '';
100
119
  // @ts-ignore
101
- (_d = (_c = resolveIdentifier(node.name, varName, config)) === null || _c === void 0 ? void 0 : _c.returnType) === null || _d === void 0 ? void 0 : _d.forEach((x) => types.add(x));
120
+ (_d = (_c = resolveIdentifier(node.type.id, varName, config)) === null || _c === undefined ? undefined : _c.returnType) === null || _d === undefined ? undefined : _d.forEach((x) => types.add(x));
102
121
  }
103
- else if (node.name === 'ObjectAccess' && node.firstChild && ((_e = node.lastChild) === null || _e === void 0 ? void 0 : _e.name) === 'Property') {
122
+ else if (node.type.is(PropertyAccess) && node.firstChild && ((_e = node.lastChild) === null || _e === undefined ? undefined : _e.type.is(Property))) {
104
123
  const varName = state.sliceDoc(node.lastChild.from, node.lastChild.to) || '';
105
- (_f = resolveTypes(state, node.firstChild, config)) === null || _f === void 0 ? void 0 : _f.forEach(baseType => {
124
+ (_f = resolveTypes(state, node.firstChild, config)) === null || _f === undefined ? undefined : _f.forEach(baseType => {
106
125
  var _a, _b, _c, _d;
107
126
  // @ts-ignore
108
- (_d = (_c = resolveIdentifier((_a = node.lastChild) === null || _a === void 0 ? void 0 : _a.name, varName, (_b = config.types) === null || _b === void 0 ? void 0 : _b[baseType])) === null || _c === void 0 ? void 0 : _c.type) === null || _d === void 0 ? void 0 : _d.forEach((x) => types.add(x));
127
+ (_d = (_c = resolveIdentifier((_a = node.lastChild) === null || _a === undefined ? undefined : _a.type.id, varName, (_b = config.types) === null || _b === undefined ? undefined : _b[baseType])) === null || _c === undefined ? undefined : _c.type) === null || _d === undefined ? undefined : _d.forEach((x) => types.add(x));
109
128
  });
110
129
  }
111
- else if (node.name === 'ObjectAccess' && node.firstChild && ((_g = node.lastChild) === null || _g === void 0 ? void 0 : _g.name) === 'Method') {
130
+ else if (node.type.is(MethodAccess) && node.firstChild && ((_g = node.lastChild) === null || _g === undefined ? undefined : _g.type.is(Method))) {
112
131
  const varName = state.sliceDoc(node.lastChild.from, node.lastChild.to) || '';
113
- (_h = resolveTypes(state, node.firstChild, config)) === null || _h === void 0 ? void 0 : _h.forEach(baseType => {
132
+ (_h = resolveTypes(state, node.firstChild, config)) === null || _h === undefined ? undefined : _h.forEach(baseType => {
114
133
  var _a, _b, _c, _d;
115
134
  // @ts-ignore
116
- (_d = (_c = resolveIdentifier((_a = node.lastChild) === null || _a === void 0 ? void 0 : _a.name, varName, (_b = config.types) === null || _b === void 0 ? void 0 : _b[baseType])) === null || _c === void 0 ? void 0 : _c.returnType) === null || _d === void 0 ? void 0 : _d.forEach((x) => types.add(x));
135
+ (_d = (_c = resolveIdentifier((_a = node.lastChild) === null || _a === undefined ? undefined : _a.type.id, varName, (_b = config.types) === null || _b === undefined ? undefined : _b[baseType])) === null || _c === undefined ? undefined : _c.returnType) === null || _d === undefined ? undefined : _d.forEach((x) => types.add(x));
117
136
  });
118
137
  }
119
- else if (node.name === 'Application' && node.firstChild) {
138
+ else if (node.type.is(Application) && node.firstChild) {
120
139
  resolveTypes(state, node.firstChild, config).forEach(x => types.add(x));
121
140
  }
122
- else if (node.name === 'TernaryExpression' && node.firstChild && node.firstChild.nextSibling && node.firstChild.nextSibling.nextSibling) {
141
+ else if (node.type.is(TernaryExpression) && node.firstChild && node.firstChild.nextSibling && node.firstChild.nextSibling.nextSibling) {
123
142
  resolveTypes(state, node.firstChild.nextSibling, config).forEach(x => types.add(x));
124
143
  resolveTypes(state, node.firstChild.nextSibling.nextSibling, config).forEach(x => types.add(x));
125
144
  }
126
- else if (node.name === 'BinaryExpression' && ((_j = node.firstChild) === null || _j === void 0 ? void 0 : _j.nextSibling) && ((_l = (_k = node.firstChild) === null || _k === void 0 ? void 0 : _k.nextSibling) === null || _l === void 0 ? void 0 : _l.nextSibling)) {
145
+ else if (node.type.is(BinaryExpression) && ((_j = node.firstChild) === null || _j === undefined ? undefined : _j.nextSibling) && ((_l = (_k = node.firstChild) === null || _k === undefined ? undefined : _k.nextSibling) === null || _l === undefined ? undefined : _l.nextSibling)) {
127
146
  const operator = state.sliceDoc(node.firstChild.nextSibling.from, node.firstChild.nextSibling.to);
128
147
  if (operator == '?:' || operator == '??' || operator == '?') {
129
148
  if (operator == '?:' || operator == '??') {
@@ -138,7 +157,7 @@ function resolveTypes(state, node, config, matchExact) {
138
157
  types.add(ELScalar.Number);
139
158
  }
140
159
  }
141
- else if (node.name === 'UnaryExpression' && node.firstChild) {
160
+ else if (node.type.is(UnaryExpression) && node.firstChild) {
142
161
  const operator = state.sliceDoc(node.firstChild.from, node.firstChild.to);
143
162
  if (['not', '!'].includes(operator)) {
144
163
  types.add(ELScalar.Bool);
@@ -168,6 +187,16 @@ const keywords = [
168
187
  { name: 'xor' },
169
188
  ];
170
189
 
190
+ var utils = /*#__PURE__*//*@__PURE__*/Object.freeze({
191
+ __proto__: null,
192
+ createInfoElement: createInfoElement,
193
+ getExpressionLanguageConfig: getExpressionLanguageConfig,
194
+ keywords: keywords,
195
+ resolveFunctionDefinition: resolveFunctionDefinition,
196
+ resolveIdentifier: resolveIdentifier,
197
+ resolveTypes: resolveTypes
198
+ });
199
+
171
200
  /**
172
201
  * @internal
173
202
  */
@@ -175,35 +204,36 @@ const expressionLanguageLinterSource = (state) => {
175
204
  const config = getExpressionLanguageConfig(state);
176
205
  let diagnostics = [];
177
206
  syntaxTree(state).cursor().iterate(node => {
178
- var _a, _b, _c, _d, _e, _f, _g;
179
- const { from, to, name } = node;
207
+ var _a, _b, _c, _d, _e, _f;
208
+ const { from, to, type: { id } } = node;
180
209
  let identifier;
181
- switch (name) {
182
- case '⚠':
210
+ switch (id) {
211
+ case 0:
183
212
  if (state.doc.length === 0 || from === 0) {
184
213
  // Don't show error on empty doc (even though it is an error)
185
214
  return;
186
215
  }
187
216
  identifier = state.sliceDoc(from, to);
188
217
  if (identifier.length === 0) {
189
- diagnostics.push({ from, to: (_c = (_b = (_a = node.node.parent) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.to) !== null && _c !== void 0 ? _c : to, severity: 'error', message: `Expression expected` });
218
+ diagnostics.push({ from, to: (_c = (_b = (_a = node.node.parent) === null || _a === undefined ? undefined : _a.parent) === null || _b === undefined ? undefined : _b.to) !== null && _c !== undefined ? _c : to, severity: 'error', message: `Expression expected` });
190
219
  }
191
220
  else {
192
221
  const type = /^[a-zA-Z_]+[a-zA-Z_0-9]*$/.test(identifier) ? 'identifier' : 'operator';
193
- diagnostics.push({ from, to, severity: 'error', message: `Unexpected ${type} '${identifier}'` });
222
+ diagnostics.push({ from, to, severity: 'error', message: `Unexpected ${type} <code>${identifier}</code>` });
194
223
  }
195
224
  return;
196
- case 'Arguments':
197
- const args = (_d = resolveFunctionDefinition(node.node.prevSibling, state, config)) === null || _d === void 0 ? void 0 : _d.args;
225
+ case Arguments:
226
+ const fn = resolveFunctionDefinition(node.node.prevSibling, state, config);
227
+ const args = fn === null || fn === undefined ? undefined : fn.args;
198
228
  if (!args) {
199
229
  return;
200
230
  }
201
231
  for (let n = node.node.firstChild, i = 0; n != null; n = n.nextSibling) {
202
- if (n.name === 'BlockComment') {
232
+ if (n.type.is(BlockComment)) {
203
233
  continue;
204
234
  }
205
235
  if (i > args.length - 1) {
206
- diagnostics.push({ from: n.from, to: n.to, severity: 'error', message: `Unexpected argument` });
236
+ diagnostics.push({ from: n.from, to: n.to, severity: 'warning', message: `Unexpected argument – <code>${fn.name}</code> takes ${args.length} argument${args.length == 1 ? '' : 's'}` });
207
237
  continue;
208
238
  }
209
239
  const typesUsed = Array.from(resolveTypes(state, n, config));
@@ -214,25 +244,25 @@ const expressionLanguageLinterSource = (state) => {
214
244
  i++;
215
245
  }
216
246
  break;
217
- case 'Property':
218
- case 'Method':
219
- const leftArgument = (_f = (_e = node.node.parent) === null || _e === void 0 ? void 0 : _e.firstChild) === null || _f === void 0 ? void 0 : _f.node;
247
+ case Property:
248
+ case Method:
249
+ const leftArgument = (_e = (_d = node.node.parent) === null || _d === undefined ? undefined : _d.firstChild) === null || _e === undefined ? undefined : _e.node;
220
250
  const types = Array.from(resolveTypes(state, leftArgument, config));
221
251
  identifier = state.sliceDoc(from, to);
222
- if (!types.find(type => { var _a; return resolveIdentifier(name, identifier, (_a = config.types) === null || _a === void 0 ? void 0 : _a[type]); })) {
223
- diagnostics.push({ from, to, severity: 'error', message: `${node.name} "${identifier}" not found in ${types.join('|')}` });
252
+ if (!types.find(type => { var _a; return resolveIdentifier(id, identifier, (_a = config.types) === null || _a === undefined ? undefined : _a[type]); })) {
253
+ diagnostics.push({ from, to, severity: 'error', message: `${node.name} <code>${identifier}</code> not found in <code>${types.join('|')}</code>` });
224
254
  }
225
255
  break;
226
- case 'Variable':
227
- case 'Function':
256
+ case Variable:
257
+ case Function:
228
258
  identifier = state.sliceDoc(from, node.node.firstChild ? node.node.firstChild.from - 1 : to);
229
- if (!resolveIdentifier(name, identifier, config)) {
230
- diagnostics.push({ from, to, severity: 'error', message: `${node.node.name} "${identifier}" not found` });
259
+ if (!resolveIdentifier(id, identifier, config)) {
260
+ diagnostics.push({ from, to, severity: 'error', message: `${node.node.name} <code>${identifier}</code> not found` });
231
261
  }
232
262
  break;
233
263
  }
234
- if (identifier && ((_g = node.node.parent) === null || _g === void 0 ? void 0 : _g.type.isError)) {
235
- diagnostics.push({ from, to, severity: 'error', message: `Unexpected identifier "${identifier}"` });
264
+ if (identifier && ((_f = node.node.parent) === null || _f === undefined ? undefined : _f.type.isError)) {
265
+ diagnostics.push({ from, to, severity: 'error', message: `Unexpected identifier <code>${identifier}</code>` });
236
266
  }
237
267
  });
238
268
  diagnostics.forEach(d => {
@@ -244,17 +274,23 @@ const expressionLanguageLinterSource = (state) => {
244
274
  });
245
275
  return diagnostics;
246
276
  };
247
- const expressionLanguageLinter = linter(view => expressionLanguageLinterSource(view.state));
277
+ const expressionLanguageLinter = /*@__PURE__*/linter$1(view => expressionLanguageLinterSource(view.state));
278
+
279
+ var linter = /*#__PURE__*//*@__PURE__*/Object.freeze({
280
+ __proto__: null,
281
+ expressionLanguageLinter: expressionLanguageLinter,
282
+ expressionLanguageLinterSource: expressionLanguageLinterSource
283
+ });
248
284
 
249
285
  const autocompleteFunction = (x) => {
250
286
  var _a, _b, _c;
251
287
  return ({
252
- label: `${x.name}(${((_b = (_a = x.args) === null || _a === void 0 ? void 0 : _a.map(x => x.name)) === null || _b === void 0 ? void 0 : _b.join(',')) || ''})`,
288
+ label: `${x.name}(${((_b = (_a = x.args) === null || _a === undefined ? undefined : _a.map(x => x.name)) === null || _b === undefined ? undefined : _b.join(',')) || ''})`,
253
289
  apply: (view, completion, from, to) => {
254
- var _a;
255
- view.dispatch(Object.assign(Object.assign({}, insertCompletionText(view.state, `${x.name}()`, from, to)), { selection: { anchor: from + x.name.length + (((_a = x.args) === null || _a === void 0 ? void 0 : _a.length) > 0 ? 1 : 2) } }));
290
+ var _a, _b;
291
+ view.dispatch(Object.assign(Object.assign({}, insertCompletionText(view.state, `${x.name}()`, from, to)), { selection: { anchor: from + x.name.length + (((_b = (_a = x.args) === null || _a === undefined ? undefined : _a.length) !== null && _b !== undefined ? _b : 0) > 0 ? 1 : 2) } }));
256
292
  },
257
- detail: (_c = x.returnType) === null || _c === void 0 ? void 0 : _c.join('|'),
293
+ detail: (_c = x.returnType) === null || _c === undefined ? undefined : _c.join('|'),
258
294
  info: x.info,
259
295
  type: "function",
260
296
  });
@@ -265,7 +301,7 @@ const autocompleteIdentifier = (x) => {
265
301
  label: x.name,
266
302
  apply: x.name,
267
303
  info: x.info,
268
- detail: x.detail || ((_a = x.type) === null || _a === void 0 ? void 0 : _a.join('|')),
304
+ detail: x.detail || ((_a = x.type) === null || _a === undefined ? undefined : _a.join('|')),
269
305
  type: 'variable',
270
306
  });
271
307
  };
@@ -280,14 +316,14 @@ function completeOperatorKeyword(state, config, tree, from, to, explicit) {
280
316
  info: info,
281
317
  detail,
282
318
  type: "keyword"
283
- }))) !== null && _a !== void 0 ? _a : [],
284
- validFor: (text) => { var _a; return (_a = keywords.some(({ name }) => explicit || name.includes(text))) !== null && _a !== void 0 ? _a : false; },
319
+ }))) !== null && _a !== undefined ? _a : [],
320
+ validFor: (text) => { var _a; return (_a = keywords.some(({ name }) => explicit || name.includes(text))) !== null && _a !== undefined ? _a : false; },
285
321
  };
286
322
  }
287
323
  function completeIdentifier(state, config, tree, from, to) {
288
324
  var _a, _b;
289
- const identifiers = (_a = config.identifiers) !== null && _a !== void 0 ? _a : []; //?.filter(({ name }) => explicit || name.toLowerCase().startsWith(text)) ?? [];
290
- const functions = (_b = config.functions) !== null && _b !== void 0 ? _b : []; //?.filter(({ name }) => explicit || name.toLowerCase().startsWith(text)) ?? [];
325
+ const identifiers = (_a = config.identifiers) !== null && _a !== undefined ? _a : []; //?.filter(({ name }) => explicit || name.toLowerCase().startsWith(text)) ?? [];
326
+ const functions = (_b = config.functions) !== null && _b !== undefined ? _b : []; //?.filter(({ name }) => explicit || name.toLowerCase().startsWith(text)) ?? [];
291
327
  return {
292
328
  from,
293
329
  to,
@@ -296,18 +332,18 @@ function completeIdentifier(state, config, tree, from, to) {
296
332
  };
297
333
  }
298
334
  function completeMember(state, config, tree, from, to, explicit) {
299
- var _a, _b, _c, _d;
300
- if (((_a = tree.parent) === null || _a === void 0 ? void 0 : _a.name) != 'ObjectAccess' || !tree.parent.firstChild) {
335
+ var _a, _b, _c, _d, _e, _f;
336
+ if (!(((_a = tree.parent) === null || _a === undefined ? undefined : _a.type.is(PropertyAccess)) || ((_b = tree.parent) === null || _b === undefined ? undefined : _b.type.is(MethodAccess))) || !((_c = tree.parent) === null || _c === undefined ? undefined : _c.firstChild)) {
301
337
  return null;
302
338
  }
303
339
  const types = resolveTypes(state, tree.parent.firstChild.node, config);
304
- if (!(types === null || types === void 0 ? void 0 : types.size)) {
340
+ if (!(types === null || types === undefined ? undefined : types.size)) {
305
341
  return null;
306
342
  }
307
343
  let options = [];
308
344
  for (const type of types) {
309
- const typeDeclaration = (_b = config.types) === null || _b === void 0 ? void 0 : _b[type];
310
- options.push(...(((_c = typeDeclaration === null || typeDeclaration === void 0 ? void 0 : typeDeclaration.identifiers) === null || _c === void 0 ? void 0 : _c.map(autocompleteIdentifier)) || []), ...(((_d = typeDeclaration === null || typeDeclaration === void 0 ? void 0 : typeDeclaration.functions) === null || _d === void 0 ? void 0 : _d.map(autocompleteFunction)) || []));
345
+ const typeDeclaration = (_d = config.types) === null || _d === undefined ? undefined : _d[type];
346
+ options.push(...(((_e = typeDeclaration === null || typeDeclaration === undefined ? undefined : typeDeclaration.identifiers) === null || _e === undefined ? undefined : _e.map(autocompleteIdentifier)) || []), ...(((_f = typeDeclaration === null || typeDeclaration === undefined ? undefined : typeDeclaration.functions) === null || _f === undefined ? undefined : _f.map(autocompleteFunction)) || []));
311
347
  }
312
348
  return {
313
349
  from,
@@ -317,34 +353,39 @@ function completeMember(state, config, tree, from, to, explicit) {
317
353
  };
318
354
  }
319
355
  function expressionLanguageCompletion(context) {
320
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
356
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
321
357
  const { state, pos, explicit } = context;
322
358
  const tree = syntaxTree(state);
323
359
  const lastChar = state.sliceDoc(pos - 1, pos);
324
360
  const prevNode = tree.resolveInner(pos, lastChar === ')' ? 0 : -1);
325
361
  const config = getExpressionLanguageConfig(state);
326
- const isIdentifier = (node) => { var _a; return ['Variable', 'Function'].includes((_a = node === null || node === void 0 ? void 0 : node.name) !== null && _a !== void 0 ? _a : ''); };
327
- const isMember = (node) => { var _a; return ['Property', 'Method'].includes((_a = node === null || node === void 0 ? void 0 : node.name) !== null && _a !== void 0 ? _a : ''); };
328
- if (prevNode.name == 'String' || prevNode.name == 'BlockComment') {
362
+ const isIdentifier = (node) => (node === null || node === undefined ? undefined : node.type.is(Variable)) || (node === null || node === undefined ? undefined : node.type.is(Function));
363
+ const isMember = (node) => (node === null || node === undefined ? undefined : node.type.is(Property)) || (node === null || node === undefined ? undefined : node.type.is(Method));
364
+ if (prevNode.type.is(String) || prevNode.type.is(BlockComment)) {
329
365
  return null;
330
366
  }
331
- if (((_a = prevNode.parent) === null || _a === void 0 ? void 0 : _a.name) == 'ObjectAccess' && ['ObjectAccess', 'ArrayAccess', 'Variable', 'Call', 'Application'].includes(((_b = prevNode.parent.firstChild) === null || _b === void 0 ? void 0 : _b.name) || '')) {
367
+ if ((((_a = prevNode.parent) === null || _a === undefined ? undefined : _a.type.is(PropertyAccess)) || ((_b = prevNode.parent) === null || _b === undefined ? undefined : _b.type.is(MethodAccess))) && [PropertyAccess, MethodAccess, ArrayAccess, Variable, Call, Application].includes((_c = prevNode.parent.firstChild) === null || _c === undefined ? undefined : _c.type.id)) {
332
368
  return completeMember(state, config, prevNode, isIdentifier(prevNode) || isMember(prevNode) ? prevNode.from : pos, pos);
333
369
  }
334
- if (['Expression', 'UnaryExpression', 'BinaryExpression', 'TernaryExpression'].includes(prevNode.name) && prevNode.lastChild && !((_c = prevNode.lastChild) === null || _c === void 0 ? void 0 : _c.type.isError)
335
- || ['Arguments', 'Array'].includes(prevNode.name) && prevNode.lastChild && !((_d = prevNode.lastChild) === null || _d === void 0 ? void 0 : _d.type.isError)
336
- || ['Expression', 'UnaryExpression', 'BinaryExpression', 'TernaryExpression'].includes((_f = (_e = prevNode.parent) === null || _e === void 0 ? void 0 : _e.name) !== null && _f !== void 0 ? _f : '') && prevNode.type.isError
337
- || ['Variable', 'Function'].includes((_h = (_g = prevNode.parent) === null || _g === void 0 ? void 0 : _g.name) !== null && _h !== void 0 ? _h : '') && prevNode.type.isError) {
338
- return completeOperatorKeyword(state, config, prevNode, !['Expression', 'UnaryExpression', 'BinaryExpression', 'TernaryExpression', 'Arguments'].includes(prevNode.name) ? prevNode.from : pos, pos, explicit);
370
+ if (/^[\sa-z]*$/.test(lastChar) && ([Expression, UnaryExpression, BinaryExpression, TernaryExpression].includes(prevNode.type.id) && prevNode.lastChild && !((_d = prevNode.lastChild) === null || _d === undefined ? undefined : _d.type.isError)
371
+ || [Arguments, Array$1].includes(prevNode.type.id) && prevNode.lastChild && !((_e = prevNode.lastChild) === null || _e === undefined ? undefined : _e.type.isError)
372
+ || [Expression, UnaryExpression, BinaryExpression, TernaryExpression].includes((_f = prevNode.parent) === null || _f === undefined ? undefined : _f.type.id) && prevNode.type.isError
373
+ || [Variable, Function].includes((_g = prevNode.parent) === null || _g === undefined ? undefined : _g.type.id) && prevNode.type.isError)) {
374
+ return completeOperatorKeyword(state, config, prevNode, ![Expression, UnaryExpression, BinaryExpression, TernaryExpression, Arguments].includes(prevNode.type.id) ? prevNode.from : pos, pos, explicit);
339
375
  }
340
- if (!/[0-9]/.test(lastChar) && !['OperatorKeyword'].includes((_j = prevNode.name) !== null && _j !== void 0 ? _j : '') && (['Expression', 'UnaryExpression', 'BinaryExpression', 'TernaryExpression'].includes(prevNode.name) && ((_k = prevNode.lastChild) === null || _k === void 0 ? void 0 : _k.type.isError)
341
- || ['Expression', 'UnaryExpression', 'BinaryExpression', 'TernaryExpression', 'Arguments'].includes((_m = (_l = prevNode.parent) === null || _l === void 0 ? void 0 : _l.name) !== null && _m !== void 0 ? _m : '') && !prevNode.type.isError
342
- || ['Arguments', 'Array'].includes((_o = prevNode.name) !== null && _o !== void 0 ? _o : ''))) {
376
+ if (!/[0-9]/.test(lastChar) && !prevNode.type.is(OperatorKeyword) && ([Expression, UnaryExpression, BinaryExpression, TernaryExpression].includes(prevNode.type.id) && ((_h = prevNode.lastChild) === null || _h === undefined ? undefined : _h.type.isError)
377
+ || [Expression, UnaryExpression, BinaryExpression, TernaryExpression, Arguments].includes((_k = (_j = prevNode.parent) === null || _j === undefined ? undefined : _j.type.id) !== null && _k !== undefined ? _k : -1) && !prevNode.type.isError
378
+ || prevNode.type.is(Arguments) || prevNode.type.is(Array$1))) {
343
379
  return completeIdentifier(state, config, prevNode, isIdentifier(prevNode) ? prevNode.from : pos, pos);
344
380
  }
345
381
  return null;
346
382
  }
347
383
 
384
+ var complete = /*#__PURE__*//*@__PURE__*/Object.freeze({
385
+ __proto__: null,
386
+ expressionLanguageCompletion: expressionLanguageCompletion
387
+ });
388
+
348
389
  function getNodeOrdinal(node) {
349
390
  let ordinal = -1;
350
391
  // noinspection StatementWithEmptyBodyJS
@@ -354,7 +395,7 @@ function getNodeOrdinal(node) {
354
395
  }
355
396
  function resolveArguments(node) {
356
397
  let c = node;
357
- while (c && c.name !== 'Arguments') {
398
+ while (c && !c.type.is(Arguments)) {
358
399
  c = c.parent;
359
400
  }
360
401
  return c;
@@ -377,7 +418,7 @@ function getCursorTooltips(state) {
377
418
  return null;
378
419
  }
379
420
  const n = args.childAfter(range.from - 1);
380
- const argName = (_b = (_a = fn.args) === null || _a === void 0 ? void 0 : _a[n ? getNodeOrdinal(n) : 0]) === null || _b === void 0 ? void 0 : _b.name;
421
+ const argName = (_b = (_a = fn.args) === null || _a === undefined ? undefined : _a[n ? getNodeOrdinal(n) : 0]) === null || _b === undefined ? undefined : _b.name;
381
422
  if (n && n.from !== range.from || !argName) {
382
423
  return null;
383
424
  }
@@ -395,7 +436,7 @@ function getCursorTooltips(state) {
395
436
  };
396
437
  }).filter(x => x);
397
438
  }
398
- const cursorTooltipField = StateField.define({
439
+ const cursorTooltipField = /*@__PURE__*/StateField.define({
399
440
  create: (state) => getCursorTooltips(state),
400
441
  update(tooltips, tr) {
401
442
  if (!tr.docChanged && !tr.selection) {
@@ -405,13 +446,13 @@ const cursorTooltipField = StateField.define({
405
446
  },
406
447
  provide: f => showTooltip.computeN([f], state => state.field(f))
407
448
  });
408
- const keywordTooltip = hoverTooltip((view, pos, side) => {
409
- var _a, _b, _c, _d, _e, _f, _g;
449
+ const keywordTooltip = /*@__PURE__*/hoverTooltip((view, pos, side) => {
450
+ var _a, _b, _c, _d, _e, _f, _g, _h;
410
451
  const config = getExpressionLanguageConfig(view.state);
411
452
  const tree = syntaxTree(view.state).resolveInner(pos, side);
412
- if (tree.name === 'OperatorKeyword') {
453
+ if (tree.type.is(OperatorKeyword)) {
413
454
  const name = view.state.sliceDoc(tree.from, tree.to);
414
- const info = (_a = keywords.find(x => x.name === name)) === null || _a === void 0 ? void 0 : _a.info;
455
+ const info = (_a = keywords.find(x => x.name === name)) === null || _a === undefined ? undefined : _a.info;
415
456
  if (info) {
416
457
  return {
417
458
  pos: tree.from,
@@ -421,25 +462,25 @@ const keywordTooltip = hoverTooltip((view, pos, side) => {
421
462
  };
422
463
  }
423
464
  }
424
- if (!['Function', 'Variable', 'Method', 'Property'].includes(tree.name)) {
465
+ if (![Function, Variable, Method, Property].includes(tree.type.id)) {
425
466
  return null;
426
467
  }
427
468
  const skipEmpty = (x) => x;
428
469
  let info;
429
- if (((_b = tree.parent) === null || _b === void 0 ? void 0 : _b.firstChild) && ((_c = tree.parent) === null || _c === void 0 ? void 0 : _c.name) === 'ObjectAccess' && tree.prevSibling) {
470
+ if (((_b = tree.parent) === null || _b === undefined ? undefined : _b.firstChild) && (((_c = tree.parent) === null || _c === undefined ? undefined : _c.type.is(PropertyAccess)) || ((_d = tree.parent) === null || _d === undefined ? undefined : _d.type.is(MethodAccess))) && tree.prevSibling) {
430
471
  const node = tree.parent.firstChild;
431
472
  const types = Array.from(resolveTypes(view.state, node, config));
432
473
  const name = view.state.sliceDoc(tree.from, tree.to);
433
474
  info = [
434
- ...types.map(type => { var _a, _b, _c, _d; return (_d = (_c = (_b = (_a = config.types) === null || _a === void 0 ? void 0 : _a[type]) === null || _b === void 0 ? void 0 : _b.identifiers) === null || _c === void 0 ? void 0 : _c.find(x => x.name === name)) === null || _d === void 0 ? void 0 : _d.info; }).filter(skipEmpty),
435
- ...types.map(type => { var _a, _b, _c, _d; return (_d = (_c = (_b = (_a = config.types) === null || _a === void 0 ? void 0 : _a[type]) === null || _b === void 0 ? void 0 : _b.functions) === null || _c === void 0 ? void 0 : _c.find(x => x.name === name)) === null || _d === void 0 ? void 0 : _d.info; }).filter(skipEmpty),
475
+ ...types.map(type => { var _a, _b, _c, _d; return (_d = (_c = (_b = (_a = config.types) === null || _a === undefined ? undefined : _a[type]) === null || _b === undefined ? undefined : _b.identifiers) === null || _c === undefined ? undefined : _c.find(x => x.name === name)) === null || _d === undefined ? undefined : _d.info; }).filter(skipEmpty),
476
+ ...types.map(type => { var _a, _b, _c, _d; return (_d = (_c = (_b = (_a = config.types) === null || _a === undefined ? undefined : _a[type]) === null || _b === undefined ? undefined : _b.functions) === null || _c === undefined ? undefined : _c.find(x => x.name === name)) === null || _d === undefined ? undefined : _d.info; }).filter(skipEmpty),
436
477
  ].join('\n');
437
478
  }
438
479
  else {
439
480
  const name = view.state.sliceDoc(tree.from, tree.to);
440
481
  info = [
441
- ...[(_e = (_d = config.identifiers) === null || _d === void 0 ? void 0 : _d.find(x => x.name === name)) === null || _e === void 0 ? void 0 : _e.info].filter(skipEmpty),
442
- ...[(_g = (_f = config.functions) === null || _f === void 0 ? void 0 : _f.find(x => x.name === name)) === null || _g === void 0 ? void 0 : _g.info].filter(skipEmpty),
482
+ ...[(_f = (_e = config.identifiers) === null || _e === undefined ? undefined : _e.find(x => x.name === name)) === null || _f === undefined ? undefined : _f.info].filter(skipEmpty),
483
+ ...[(_h = (_g = config.functions) === null || _g === undefined ? undefined : _g.find(x => x.name === name)) === null || _h === undefined ? undefined : _h.info].filter(skipEmpty),
443
484
  ].join('\n');
444
485
  }
445
486
  if (!info) {
@@ -453,7 +494,13 @@ const keywordTooltip = hoverTooltip((view, pos, side) => {
453
494
  };
454
495
  });
455
496
 
456
- const baseTheme = EditorView.baseTheme({
497
+ var tooltip = /*#__PURE__*//*@__PURE__*/Object.freeze({
498
+ __proto__: null,
499
+ cursorTooltipField: cursorTooltipField,
500
+ keywordTooltip: keywordTooltip
501
+ });
502
+
503
+ const baseTheme = /*@__PURE__*/EditorView.baseTheme({
457
504
  ".cm-tooltip.cm-tooltip-cursor": {
458
505
  boxShadow: 'rgba(0, 0, 0, .15) 0 1px 2px',
459
506
  border: "1px solid rgba(127, 127, 127, .2)",
@@ -482,24 +529,24 @@ const baseTheme = EditorView.baseTheme({
482
529
  },
483
530
  });
484
531
 
485
- const ELLanguage = LRLanguage.define({
486
- parser: parser.configure({
532
+ const ELLanguage = /*@__PURE__*/LRLanguage.define({
533
+ parser: /*@__PURE__*/parser.configure({
487
534
  props: [
488
- indentNodeProp.add({
489
- Application: delimitedIndent({ closing: ")", align: false }),
490
- Arguments: delimitedIndent({ closing: ")", align: false }),
491
- Object: delimitedIndent({ closing: "}", align: false }),
535
+ /*@__PURE__*/indentNodeProp.add({
536
+ Application: /*@__PURE__*/delimitedIndent({ closing: ")", align: false }),
537
+ Arguments: /*@__PURE__*/delimitedIndent({ closing: ")", align: false }),
538
+ Object: /*@__PURE__*/delimitedIndent({ closing: "}", align: false }),
492
539
  }),
493
- foldNodeProp.add({
540
+ /*@__PURE__*/foldNodeProp.add({
494
541
  Application: ({ from, to }) => ({ from: from + 1, to: to - 1 }),
495
542
  Arguments: ({ from, to }) => ({ from: from + 1, to: to - 1 }),
496
543
  Object: ({ from, to }) => ({ from: from + 1, to: to - 1 }),
497
544
  }),
498
- styleTags({
545
+ /*@__PURE__*/styleTags({
499
546
  Property: tags.propertyName,
500
547
  Variable: tags.variableName,
501
- Function: tags.function(tags.variableName),
502
- Method: tags.function(tags.propertyName),
548
+ Function: /*@__PURE__*/tags.function(tags.variableName),
549
+ Method: /*@__PURE__*/tags.function(tags.propertyName),
503
550
  Boolean: tags.bool,
504
551
  String: tags.string,
505
552
  Number: tags.number,
@@ -533,4 +580,4 @@ function expressionlanguage(config = {}, extensions = []) {
533
580
  ]);
534
581
  }
535
582
 
536
- export { ELLanguage, expressionlanguage };
583
+ export { ELLanguage, ELScalar, complete as _complete, linter as _linter, tooltip as _tooltip, utils as _utils, expressionlanguage };