@valtzu/codemirror-lang-el 0.7.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};
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!^OPOOQ!cQPOOO#aQPO'#CeO$tQPO'#CnO${QPO'#CoOYQPO'#CuOYQPO'#CwOOQO'#DS'#DSO%SQPO'#CdO%XQPO'#CdOOQO'#Cl'#ClOOQO'#Cm'#CmOOQO'#Cv'#CvP%^OQO'#C]POOO)C>r)C>rO%iQPO,58yOYQPO,58}OYQPO,59_OYQPO,59]O%nQPO'#CtOOQO'#Ct'#CtO%sQPO'#Ct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}mazma~P!cOoey!Weyxey}eyzey!Uey~P!cO}!]O!U!bO~O!W!cO~P!cO}nq!Unq~P!cO_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",
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+$TOYQPO7+$bO+QQPO7+$_O+[QPO,59dOOQO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 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
23
  maxTerm: 68,
24
24
  nodeProps: [
25
- [t, 14,"number",15,"string",16,"bool",17,"null"]
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!h*Z#X#Y*Z~)}S^~!Q![)x!g!h*Z#R#S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#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: 536
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,72 +204,93 @@ 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
- let i = 0;
202
- let n = node.node.firstChild;
203
- while (n) {
204
- if (n.name !== 'BlockComment' && ++i > args.length) {
205
- diagnostics.push({ from: n.from, to: n.to, severity: 'error', message: `Unexpected argument` });
231
+ for (let n = node.node.firstChild, i = 0; n != null; n = n.nextSibling) {
232
+ if (n.type.is(BlockComment)) {
233
+ continue;
206
234
  }
207
- n = n.nextSibling;
235
+ if (i > args.length - 1) {
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'}` });
237
+ continue;
238
+ }
239
+ const typesUsed = Array.from(resolveTypes(state, n, config));
240
+ const typesExpected = args[i].type;
241
+ if (typesExpected && !typesExpected.includes(ELScalar.Any) && !typesUsed.some(x => typesExpected.includes(x))) {
242
+ diagnostics.push({ from: n.from, to: n.to, severity: 'error', message: `<code>${typesExpected.join('|')}</code> expected, got <code>${typesUsed.join('|')}</code>` });
243
+ }
244
+ i++;
208
245
  }
209
246
  break;
210
- case 'Property':
211
- case 'Method':
212
- 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;
213
250
  const types = Array.from(resolveTypes(state, leftArgument, config));
214
251
  identifier = state.sliceDoc(from, to);
215
- if (!types.find(type => { var _a; return resolveIdentifier(name, identifier, (_a = config.types) === null || _a === void 0 ? void 0 : _a[type]); })) {
216
- 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>` });
217
254
  }
218
255
  break;
219
- case 'Variable':
220
- case 'Function':
256
+ case Variable:
257
+ case Function:
221
258
  identifier = state.sliceDoc(from, node.node.firstChild ? node.node.firstChild.from - 1 : to);
222
- if (!resolveIdentifier(name, identifier, config)) {
223
- 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` });
224
261
  }
225
262
  break;
226
263
  }
227
- if (identifier && ((_g = node.node.parent) === null || _g === void 0 ? void 0 : _g.type.isError)) {
228
- 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>` });
229
266
  }
230
267
  });
268
+ diagnostics.forEach(d => {
269
+ d.renderMessage = () => {
270
+ const span = document.createElement('span');
271
+ span.innerHTML = d.message;
272
+ return span;
273
+ };
274
+ });
231
275
  return diagnostics;
232
276
  };
233
- 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
+ });
234
284
 
235
285
  const autocompleteFunction = (x) => {
236
286
  var _a, _b, _c;
237
287
  return ({
238
- 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(',')) || ''})`,
239
289
  apply: (view, completion, from, to) => {
240
- var _a;
241
- 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) } }));
242
292
  },
243
- detail: (_c = x.returnType) === null || _c === void 0 ? void 0 : _c.join('|'),
293
+ detail: (_c = x.returnType) === null || _c === undefined ? undefined : _c.join('|'),
244
294
  info: x.info,
245
295
  type: "function",
246
296
  });
@@ -251,7 +301,7 @@ const autocompleteIdentifier = (x) => {
251
301
  label: x.name,
252
302
  apply: x.name,
253
303
  info: x.info,
254
- 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('|')),
255
305
  type: 'variable',
256
306
  });
257
307
  };
@@ -266,14 +316,14 @@ function completeOperatorKeyword(state, config, tree, from, to, explicit) {
266
316
  info: info,
267
317
  detail,
268
318
  type: "keyword"
269
- }))) !== null && _a !== void 0 ? _a : [],
270
- 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; },
271
321
  };
272
322
  }
273
323
  function completeIdentifier(state, config, tree, from, to) {
274
324
  var _a, _b;
275
- const identifiers = (_a = config.identifiers) !== null && _a !== void 0 ? _a : []; //?.filter(({ name }) => explicit || name.toLowerCase().startsWith(text)) ?? [];
276
- 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)) ?? [];
277
327
  return {
278
328
  from,
279
329
  to,
@@ -282,18 +332,18 @@ function completeIdentifier(state, config, tree, from, to) {
282
332
  };
283
333
  }
284
334
  function completeMember(state, config, tree, from, to, explicit) {
285
- var _a, _b, _c, _d;
286
- 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)) {
287
337
  return null;
288
338
  }
289
339
  const types = resolveTypes(state, tree.parent.firstChild.node, config);
290
- if (!(types === null || types === void 0 ? void 0 : types.size)) {
340
+ if (!(types === null || types === undefined ? undefined : types.size)) {
291
341
  return null;
292
342
  }
293
343
  let options = [];
294
344
  for (const type of types) {
295
- const typeDeclaration = (_b = config.types) === null || _b === void 0 ? void 0 : _b[type];
296
- 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)) || []));
297
347
  }
298
348
  return {
299
349
  from,
@@ -303,34 +353,39 @@ function completeMember(state, config, tree, from, to, explicit) {
303
353
  };
304
354
  }
305
355
  function expressionLanguageCompletion(context) {
306
- 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;
307
357
  const { state, pos, explicit } = context;
308
358
  const tree = syntaxTree(state);
309
359
  const lastChar = state.sliceDoc(pos - 1, pos);
310
360
  const prevNode = tree.resolveInner(pos, lastChar === ')' ? 0 : -1);
311
361
  const config = getExpressionLanguageConfig(state);
312
- const isIdentifier = (node) => { var _a; return ['Variable', 'Function'].includes((_a = node === null || node === void 0 ? void 0 : node.name) !== null && _a !== void 0 ? _a : ''); };
313
- const isMember = (node) => { var _a; return ['Property', 'Method'].includes((_a = node === null || node === void 0 ? void 0 : node.name) !== null && _a !== void 0 ? _a : ''); };
314
- 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)) {
315
365
  return null;
316
366
  }
317
- 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)) {
318
368
  return completeMember(state, config, prevNode, isIdentifier(prevNode) || isMember(prevNode) ? prevNode.from : pos, pos);
319
369
  }
320
- if (['Expression', 'UnaryExpression', 'BinaryExpression', 'TernaryExpression'].includes(prevNode.name) && prevNode.lastChild && !((_c = prevNode.lastChild) === null || _c === void 0 ? void 0 : _c.type.isError)
321
- || ['Arguments', 'Array'].includes(prevNode.name) && prevNode.lastChild && !((_d = prevNode.lastChild) === null || _d === void 0 ? void 0 : _d.type.isError)
322
- || ['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
323
- || ['Variable', 'Function'].includes((_h = (_g = prevNode.parent) === null || _g === void 0 ? void 0 : _g.name) !== null && _h !== void 0 ? _h : '') && prevNode.type.isError) {
324
- 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);
325
375
  }
326
- 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)
327
- || ['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
328
- || ['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))) {
329
379
  return completeIdentifier(state, config, prevNode, isIdentifier(prevNode) ? prevNode.from : pos, pos);
330
380
  }
331
381
  return null;
332
382
  }
333
383
 
384
+ var complete = /*#__PURE__*//*@__PURE__*/Object.freeze({
385
+ __proto__: null,
386
+ expressionLanguageCompletion: expressionLanguageCompletion
387
+ });
388
+
334
389
  function getNodeOrdinal(node) {
335
390
  let ordinal = -1;
336
391
  // noinspection StatementWithEmptyBodyJS
@@ -340,7 +395,7 @@ function getNodeOrdinal(node) {
340
395
  }
341
396
  function resolveArguments(node) {
342
397
  let c = node;
343
- while (c && c.name !== 'Arguments') {
398
+ while (c && !c.type.is(Arguments)) {
344
399
  c = c.parent;
345
400
  }
346
401
  return c;
@@ -363,7 +418,7 @@ function getCursorTooltips(state) {
363
418
  return null;
364
419
  }
365
420
  const n = args.childAfter(range.from - 1);
366
- 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;
367
422
  if (n && n.from !== range.from || !argName) {
368
423
  return null;
369
424
  }
@@ -381,7 +436,7 @@ function getCursorTooltips(state) {
381
436
  };
382
437
  }).filter(x => x);
383
438
  }
384
- const cursorTooltipField = StateField.define({
439
+ const cursorTooltipField = /*@__PURE__*/StateField.define({
385
440
  create: (state) => getCursorTooltips(state),
386
441
  update(tooltips, tr) {
387
442
  if (!tr.docChanged && !tr.selection) {
@@ -391,13 +446,13 @@ const cursorTooltipField = StateField.define({
391
446
  },
392
447
  provide: f => showTooltip.computeN([f], state => state.field(f))
393
448
  });
394
- const keywordTooltip = hoverTooltip((view, pos, side) => {
395
- 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;
396
451
  const config = getExpressionLanguageConfig(view.state);
397
452
  const tree = syntaxTree(view.state).resolveInner(pos, side);
398
- if (tree.name === 'OperatorKeyword') {
453
+ if (tree.type.is(OperatorKeyword)) {
399
454
  const name = view.state.sliceDoc(tree.from, tree.to);
400
- 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;
401
456
  if (info) {
402
457
  return {
403
458
  pos: tree.from,
@@ -407,25 +462,25 @@ const keywordTooltip = hoverTooltip((view, pos, side) => {
407
462
  };
408
463
  }
409
464
  }
410
- if (!['Function', 'Variable', 'Method', 'Property'].includes(tree.name)) {
465
+ if (![Function, Variable, Method, Property].includes(tree.type.id)) {
411
466
  return null;
412
467
  }
413
468
  const skipEmpty = (x) => x;
414
469
  let info;
415
- 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) {
416
471
  const node = tree.parent.firstChild;
417
472
  const types = Array.from(resolveTypes(view.state, node, config));
418
473
  const name = view.state.sliceDoc(tree.from, tree.to);
419
474
  info = [
420
- ...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),
421
- ...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),
422
477
  ].join('\n');
423
478
  }
424
479
  else {
425
480
  const name = view.state.sliceDoc(tree.from, tree.to);
426
481
  info = [
427
- ...[(_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),
428
- ...[(_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),
429
484
  ].join('\n');
430
485
  }
431
486
  if (!info) {
@@ -439,7 +494,13 @@ const keywordTooltip = hoverTooltip((view, pos, side) => {
439
494
  };
440
495
  });
441
496
 
442
- 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({
443
504
  ".cm-tooltip.cm-tooltip-cursor": {
444
505
  boxShadow: 'rgba(0, 0, 0, .15) 0 1px 2px',
445
506
  border: "1px solid rgba(127, 127, 127, .2)",
@@ -461,26 +522,31 @@ const baseTheme = EditorView.baseTheme({
461
522
  opacity: 0.5,
462
523
  fontStyle: "inherit !important",
463
524
  },
525
+ "code": {
526
+ fontSize: ".8em",
527
+ fontStyle: "monospace",
528
+ backgroundColor: "rgba(127, 127, 127, .3)",
529
+ },
464
530
  });
465
531
 
466
- const ELLanguage = LRLanguage.define({
467
- parser: parser.configure({
532
+ const ELLanguage = /*@__PURE__*/LRLanguage.define({
533
+ parser: /*@__PURE__*/parser.configure({
468
534
  props: [
469
- indentNodeProp.add({
470
- Application: delimitedIndent({ closing: ")", align: false }),
471
- Arguments: delimitedIndent({ closing: ")", align: false }),
472
- 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 }),
473
539
  }),
474
- foldNodeProp.add({
540
+ /*@__PURE__*/foldNodeProp.add({
475
541
  Application: ({ from, to }) => ({ from: from + 1, to: to - 1 }),
476
542
  Arguments: ({ from, to }) => ({ from: from + 1, to: to - 1 }),
477
543
  Object: ({ from, to }) => ({ from: from + 1, to: to - 1 }),
478
544
  }),
479
- styleTags({
545
+ /*@__PURE__*/styleTags({
480
546
  Property: tags.propertyName,
481
547
  Variable: tags.variableName,
482
- Function: tags.function(tags.variableName),
483
- Method: tags.function(tags.propertyName),
548
+ Function: /*@__PURE__*/tags.function(tags.variableName),
549
+ Method: /*@__PURE__*/tags.function(tags.propertyName),
484
550
  Boolean: tags.bool,
485
551
  String: tags.string,
486
552
  Number: tags.number,
@@ -514,4 +580,4 @@ function expressionlanguage(config = {}, extensions = []) {
514
580
  ]);
515
581
  }
516
582
 
517
- export { ELLanguage, expressionlanguage };
583
+ export { ELLanguage, ELScalar, complete as _complete, linter as _linter, tooltip as _tooltip, utils as _utils, expressionlanguage };