@bpmn-io/lang-feel 4.0.1 → 4.0.2

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.
@@ -7,7 +7,6 @@ export declare function contextualKeyword(options: {
7
7
  keyword: string;
8
8
  }): CompletionSource;
9
9
  export declare const keywordCompletions: CompletionSource[];
10
- export declare const dontCompleteLiteral: string[];
11
10
  export declare const dontCompleteExpression: string[];
12
11
  export declare const doCompleteExpression: string[];
13
12
  export declare function ifNode(completionSource: CompletionSource, { include, exclude }: {
@@ -15,8 +14,6 @@ export declare function ifNode(completionSource: CompletionSource, { include, ex
15
14
  exclude: string[];
16
15
  }): (context: CompletionContext) => import("@codemirror/autocomplete").CompletionResult | Promise<import("@codemirror/autocomplete").CompletionResult | null> | null;
17
16
  export declare function ifExpression(completionSource: CompletionSource): CompletionSource;
18
- export declare function ifExpressionOrIdentifier(completionSource: CompletionSource): CompletionSource;
19
- export declare function combineCompletionSources(sources: CompletionSource[]): CompletionSource;
20
17
  export declare function snippetCompletion(snippets: readonly Completion[]): CompletionSource;
21
18
  export declare function matchLeft(node: SyntaxNode, position: number, nodes: (string | undefined)[]): SyntaxNode | null;
22
19
  export declare function matchRight(node: SyntaxNode, position: number, nodes: (string | undefined)[]): SyntaxNode | null;
package/dist/index.js CHANGED
@@ -43,16 +43,6 @@ const snippets = [snippetCompletion$1('function(${params}) ${body}', {
43
43
  type: 'keyword'
44
44
  })];
45
45
 
46
- function _extends() {
47
- return _extends = Object.assign ? Object.assign.bind() : function (n) {
48
- for (var e = 1; e < arguments.length; e++) {
49
- var t = arguments[e];
50
- for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
51
- }
52
- return n;
53
- }, _extends.apply(null, arguments);
54
- }
55
-
56
46
  function contextualKeyword(options) {
57
47
  const {
58
48
  context: nodes,
@@ -91,8 +81,7 @@ const keywordCompletions = [contextualKeyword({
91
81
  after: 'InExpressions',
92
82
  keyword: 'return'
93
83
  })];
94
- const dontCompleteLiteral = ['StringLiteral', 'LineComment', 'BlockComment', 'PathExpression', 'Context', 'Key', 'ParameterName'];
95
- const dontCompleteExpression = ['Identifier', ...dontCompleteLiteral];
84
+ const dontCompleteExpression = ['Name', 'StringLiteral', 'LineComment', 'BlockComment', 'PathExpression', 'Context', 'Key', 'ParameterName'];
96
85
  const doCompleteExpression = ['Expr', 'ContextEntry'];
97
86
  function ifNode(completionSource, {
98
87
  include,
@@ -120,45 +109,8 @@ function ifExpression(completionSource) {
120
109
  exclude: dontCompleteExpression
121
110
  });
122
111
  }
123
- function ifExpressionOrIdentifier(completionSource) {
124
- return ifNode(completionSource, {
125
- include: doCompleteExpression,
126
- exclude: dontCompleteLiteral
127
- });
128
- }
129
- function combineCompletionSources(sources) {
130
- return async context => {
131
- const results = await Promise.all(sources.map(source => source(context)));
132
- const matchedResults = results.filter(r => !!r);
133
- if (!matchedResults.length) {
134
- return null;
135
- }
136
- if (matchedResults.length === 1) {
137
- return matchedResults[0];
138
- }
139
- return {
140
- from: Math.min(...matchedResults.map(r => r.from)),
141
- options: matchedResults.flatMap(r => r.options)
142
- };
143
- };
144
- }
145
112
  function snippetCompletion(snippets) {
146
- const taggedSnippets = snippets.map(s => _extends({}, s, {
147
- type: 'text'
148
- }));
149
- // split literal completions from other completions
150
- // literal completions may appear in place of <Identifier> nodes,
151
- // other snippets may only appear in place of <Expression> nodes
152
- const literalSnippets = taggedSnippets.filter(s => s.detail === 'literal');
153
- const regularSnippets = taggedSnippets.filter(s => s.detail !== 'literal');
154
- const sources = [];
155
- if (regularSnippets.length) {
156
- sources.push(ifExpression(completeFromList(regularSnippets)));
157
- }
158
- if (literalSnippets.length) {
159
- sources.push(ifExpressionOrIdentifier(completeFromList(literalSnippets)));
160
- }
161
- return combineCompletionSources(sources);
113
+ return ifExpression(completeFromList(snippets));
162
114
  }
163
115
  function matchLeft(node, position, nodes) {
164
116
  return matchChildren(node, position, nodes, -1);
@@ -306,5 +258,5 @@ function feel(config = {}) {
306
258
  }))]);
307
259
  }
308
260
 
309
- export { combineCompletionSources, contextualKeyword, doCompleteExpression, dontCompleteExpression, dontCompleteLiteral, expressionLanguage, feel, feelLanguage, ifExpression, ifExpressionOrIdentifier, ifInside, ifNode, keywordCompletions, matchChildren, matchLeft, matchRight, snippetCompletion, snippets, unaryTestsLanguage };
261
+ export { contextualKeyword, doCompleteExpression, dontCompleteExpression, expressionLanguage, feel, feelLanguage, ifExpression, ifInside, ifNode, keywordCompletions, matchChildren, matchLeft, matchRight, snippetCompletion, snippets, unaryTestsLanguage };
310
262
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/snippets.ts","../src/completion.ts","../src/feel.ts"],"sourcesContent":["import { Completion, snippetCompletion } from '@codemirror/autocomplete';\n\n/**\n * A collection of FEEL-related [snippets](#autocomplete.snippet).\n */\nexport const snippets: readonly Completion[] = [\n snippetCompletion('function(${params}) ${body}', {\n label: 'function',\n detail: 'definition',\n type: 'keyword'\n }),\n snippetCompletion('for ${var} in ${collection} return ${value}', {\n label: 'for',\n detail: 'expression',\n type: 'keyword'\n }),\n snippetCompletion('every ${var} in ${collection} satisfies ${condition}', {\n label: 'every',\n detail: 'quantified expression',\n type: 'keyword'\n }),\n snippetCompletion('some ${var} in ${collection} satisfies ${condition}', {\n label: 'some',\n detail: 'quantified expression',\n type: 'keyword'\n }),\n snippetCompletion('if ${condition} then ${value} else ${other value}', {\n label: 'if',\n detail: 'block',\n type: 'keyword'\n }),\n snippetCompletion('{ ${key}: ${value} }', {\n label: 'context',\n detail: 'block',\n type: 'keyword'\n }),\n snippetCompletion('null', {\n label: 'null',\n detail: 'literal',\n type: 'keyword'\n }),\n snippetCompletion('true', {\n label: 'true',\n detail: 'literal',\n type: 'keyword'\n }),\n snippetCompletion('false', {\n label: 'false',\n detail: 'literal',\n type: 'keyword'\n })\n];\n","import { syntaxTree } from '@codemirror/language';\nimport { SyntaxNode } from '@lezer/common';\n\nimport {\n CompletionSource,\n Completion,\n completeFromList,\n CompletionContext\n} from '@codemirror/autocomplete';\n\n\nexport function contextualKeyword(options: {\n before?: string,\n after?: string,\n context: string,\n keyword: string\n}) : CompletionSource {\n\n const {\n context: nodes,\n after,\n before,\n keyword\n } = options;\n\n return ifInside({ nodes, before, after, keyword }, completeFromList([\n { label: keyword, type: 'keyword', boost: 10 }\n ]));\n}\n\nexport const keywordCompletions = [\n contextualKeyword({\n context: 'InExpression',\n keyword: 'in'\n }),\n contextualKeyword({\n context: 'IfExpression',\n keyword: 'then',\n after: 'if',\n before: 'else'\n }),\n contextualKeyword({\n context: 'IfExpression',\n keyword: 'else',\n after: 'then'\n }),\n contextualKeyword({\n context: 'QuantifiedExpression',\n keyword: 'satisfies'\n }),\n contextualKeyword({\n context: 'ForExpression',\n after: 'InExpressions',\n keyword: 'return'\n })\n];\n\nexport const dontCompleteLiteral = [\n 'StringLiteral',\n 'LineComment', 'BlockComment',\n 'PathExpression', 'Context',\n 'Key', 'ParameterName'\n];\n\nexport const dontCompleteExpression = [\n 'Identifier',\n ...dontCompleteLiteral\n];\n\nexport const doCompleteExpression = [\n 'Expr',\n 'ContextEntry'\n];\n\nexport function ifNode(completionSource: CompletionSource, {\n include,\n exclude\n} : {\n include: string[],\n exclude: string[]\n}) {\n\n const allNodes = [ ...exclude, ...include ];\n\n return (context: CompletionContext) => {\n\n const { state, pos } = context;\n\n const match = matchUp(syntaxTree(state).resolveInner(pos, -1), allNodes);\n\n if (match) {\n\n const [ _, name ] = match;\n\n if (exclude.includes(name)) {\n return null;\n }\n }\n\n return completionSource(context);\n };\n}\n\nexport function ifExpression(completionSource: CompletionSource) : CompletionSource {\n return ifNode(completionSource, {\n include: doCompleteExpression,\n exclude: dontCompleteExpression\n });\n}\n\nexport function ifExpressionOrIdentifier(completionSource: CompletionSource) : CompletionSource {\n return ifNode(completionSource, {\n include: doCompleteExpression,\n exclude: dontCompleteLiteral\n });\n}\n\nexport function combineCompletionSources(sources: CompletionSource[]) : CompletionSource {\n\n return async (context) => {\n const results = await Promise.all(\n sources.map(source => source(context))\n );\n\n const matchedResults = results.filter(r => !!r);\n\n if (!matchedResults.length) {\n return null;\n }\n\n if (matchedResults.length === 1) {\n return matchedResults[0];\n }\n\n return {\n from: Math.min(...matchedResults.map(r => r.from)),\n options: matchedResults.flatMap(r => r.options)\n };\n };\n}\n\nexport function snippetCompletion(snippets: readonly Completion[]) : CompletionSource {\n\n const taggedSnippets = snippets.map(s => ({ ...s, type: 'text' }));\n\n // split literal completions from other completions\n // literal completions may appear in place of <Identifier> nodes,\n // other snippets may only appear in place of <Expression> nodes\n const literalSnippets = taggedSnippets.filter(s => s.detail === 'literal');\n const regularSnippets = taggedSnippets.filter(s => s.detail !== 'literal');\n\n const sources: CompletionSource[] = [];\n\n if (regularSnippets.length) {\n sources.push(ifExpression(\n completeFromList(regularSnippets)\n ));\n }\n\n if (literalSnippets.length) {\n sources.push(ifExpressionOrIdentifier(\n completeFromList(literalSnippets)\n ));\n }\n\n return combineCompletionSources(sources);\n}\n\nexport function matchLeft(node: SyntaxNode, position: number, nodes: (string|undefined)[]) : SyntaxNode | null {\n return matchChildren(node, position, nodes, -1);\n}\n\nexport function matchRight(node: SyntaxNode, position: number, nodes: (string|undefined)[]) : SyntaxNode | null {\n return matchChildren(node, position, nodes, 1);\n}\n\nexport function matchChildren(node: SyntaxNode, position: number, nodes: (string|undefined)[], direction: 1 | -1) : SyntaxNode | null {\n\n let child = node[direction > 0 ? 'childAfter' : 'childBefore'](position);\n\n while (child) {\n if (nodes.includes(child.name)) {\n return child;\n }\n\n if (child.type.isError && child.firstChild) {\n if (nodes.includes(child.firstChild.name)) {\n return child.firstChild;\n }\n }\n\n child = child[direction > 0 ? 'nextSibling' : 'prevSibling'];\n }\n\n return null;\n}\n\nfunction matchUp(node: SyntaxNode, nodeNames: string | string[]) : [ SyntaxNode, string ] | null {\n\n if (!Array.isArray(nodeNames)) {\n nodeNames = [ nodeNames ];\n }\n\n for (; node; node = node.parent!) {\n\n const nodeType = node.type;\n\n const matchedName = nodeNames.find(name => name && nodeType.is(name));\n\n if (matchedName) {\n return [ node, matchedName ];\n }\n\n if (nodeType.isTop) {\n break;\n }\n }\n\n return null;\n}\n\nexport function ifInside(options: {\n nodes: string | string[],\n keyword: string,\n before?: string,\n after?: string\n}, source: CompletionSource): CompletionSource {\n\n const {\n nodes,\n before,\n after,\n keyword\n } = options;\n\n return (context) => {\n\n const { state, pos } = context;\n\n const match = matchUp(syntaxTree(state).resolveInner(pos, -1), nodes);\n\n if (!match) {\n return null;\n }\n\n const [ node ] = match;\n\n if (matchLeft(node, pos, [ keyword, before ])) {\n return null;\n }\n\n if (matchRight(node, pos, [ keyword, after ])) {\n return null;\n }\n\n if (after && !matchLeft(node, pos, [ after ])) {\n return null;\n }\n\n return source(context);\n };\n}","import {\n parser,\n trackVariables\n} from '@bpmn-io/lezer-feel';\n\nimport {\n LRLanguage,\n LanguageSupport,\n delimitedIndent,\n continuedIndent,\n indentNodeProp,\n foldNodeProp,\n foldInside\n} from '@codemirror/language';\n\nimport {\n snippets\n} from './snippets.js';\n\nimport {\n keywordCompletions,\n snippetCompletion\n} from './completion.js';\n\nimport {\n CompletionSource\n} from '@codemirror/autocomplete';\n\n\n/**\n * A FEEL language provider based on the\n * [Lezer FEEL parser](https://github.com/nikku/lezer-feel),\n * extended with highlighting and indentation information.\n */\nexport const feelLanguage = LRLanguage.define({\n parser: parser.configure({\n props: [\n indentNodeProp.add({\n 'Context': delimitedIndent({\n closing: '}'\n }),\n 'List FilterExpression': delimitedIndent({\n closing: ']'\n }),\n 'ParenthesizedExpression FunctionInvocation': continuedIndent({\n except: /^\\s*\\)/\n }),\n 'ForExpression QuantifiedExpression IfExpression': continuedIndent({\n except: /^\\s*(then|else|return|satisfies)\\b/\n }),\n 'FunctionDefinition': continuedIndent({\n except: /^\\s*(\\(|\\))/\n })\n }),\n foldNodeProp.add({\n Context: foldInside,\n List: foldInside,\n ParenthesizedExpression: foldInside,\n FunctionDefinition(node) {\n const last = node.getChild(')');\n\n if (!last) return null;\n\n return {\n from: last.to,\n to: node.to\n };\n }\n })\n ]\n }),\n languageData: {\n indentOnInput: /^\\s*(\\)|\\}|\\]|then|else|return|satisfies)$/,\n commentTokens: {\n line: '//',\n block: {\n open: '/*',\n close: '*/'\n }\n }\n }\n});\n\nexport type FeelConfig = {\n dialect?: 'expression' | 'unaryTests',\n parserDialect?: string,\n completions?: CompletionSource[],\n context?: Record<string, unknown>\n};\n\n/**\n * A language provider for FEEL Unary Tests\n */\nexport const unaryTestsLanguage = feelLanguage.configure({\n top: 'UnaryTests',\n}, 'FEEL unary tests');\n\n/**\n * Language provider for FEEL Expression\n */\nexport const expressionLanguage = feelLanguage.configure({\n top: 'Expression'\n}, 'FEEL expression');\n\n\n\n/**\n * Feel language support for CodeMirror.\n *\n * Includes [snippet](#lang-feel.snippets)\n */\nexport function feel(config: FeelConfig = {}) {\n const language = config.dialect === 'unaryTests' ? unaryTestsLanguage : expressionLanguage;\n\n const dialect = config.parserDialect;\n const contextTracker = trackVariables(config.context);\n\n const contextualLang = language.configure({\n contextTracker,\n dialect\n });\n\n const completions = config.completions || [\n snippetCompletion(snippets),\n keywordCompletions,\n ].flat();\n\n return new LanguageSupport(contextualLang, [\n ...(\n completions.map(autocomplete => contextualLang.data.of({\n autocomplete\n }))\n )\n ]);\n\n}"],"names":["snippets","snippetCompletion","label","detail","type","contextualKeyword","options","context","nodes","after","before","keyword","ifInside","completeFromList","boost","keywordCompletions","dontCompleteLiteral","dontCompleteExpression","doCompleteExpression","ifNode","completionSource","include","exclude","allNodes","state","pos","match","matchUp","syntaxTree","resolveInner","_","name","includes","ifExpression","ifExpressionOrIdentifier","combineCompletionSources","sources","results","Promise","all","map","source","matchedResults","filter","r","length","from","Math","min","flatMap","taggedSnippets","s","_extends","literalSnippets","regularSnippets","push","matchLeft","node","position","matchChildren","matchRight","direction","child","isError","firstChild","nodeNames","Array","isArray","parent","nodeType","matchedName","find","is","isTop","feelLanguage","LRLanguage","define","parser","configure","props","indentNodeProp","add","delimitedIndent","closing","continuedIndent","except","foldNodeProp","Context","foldInside","List","ParenthesizedExpression","FunctionDefinition","last","getChild","to","languageData","indentOnInput","commentTokens","line","block","open","close","unaryTestsLanguage","top","expressionLanguage","feel","config","language","dialect","parserDialect","contextTracker","trackVariables","contextualLang","completions","flat","LanguageSupport","autocomplete","data","of"],"mappings":";;;;AAEA;;AAEG;MACUA,QAAQ,GAA0B,CAC7CC,mBAAiB,CAAC,6BAA6B,EAAE;AAC/CC,EAAAA,KAAK,EAAE,UAAU;AACjBC,EAAAA,MAAM,EAAE,YAAY;AACpBC,EAAAA,IAAI,EAAE,SAAA;CACP,CAAC,EACFH,mBAAiB,CAAC,6CAA6C,EAAE;AAC/DC,EAAAA,KAAK,EAAE,KAAK;AACZC,EAAAA,MAAM,EAAE,YAAY;AACpBC,EAAAA,IAAI,EAAE,SAAA;CACP,CAAC,EACFH,mBAAiB,CAAC,sDAAsD,EAAE;AACxEC,EAAAA,KAAK,EAAE,OAAO;AACdC,EAAAA,MAAM,EAAE,uBAAuB;AAC/BC,EAAAA,IAAI,EAAE,SAAA;CACP,CAAC,EACFH,mBAAiB,CAAC,qDAAqD,EAAE;AACvEC,EAAAA,KAAK,EAAE,MAAM;AACbC,EAAAA,MAAM,EAAE,uBAAuB;AAC/BC,EAAAA,IAAI,EAAE,SAAA;CACP,CAAC,EACFH,mBAAiB,CAAC,mDAAmD,EAAE;AACrEC,EAAAA,KAAK,EAAE,IAAI;AACXC,EAAAA,MAAM,EAAE,OAAO;AACfC,EAAAA,IAAI,EAAE,SAAA;CACP,CAAC,EACFH,mBAAiB,CAAC,sBAAsB,EAAE;AACxCC,EAAAA,KAAK,EAAE,SAAS;AAChBC,EAAAA,MAAM,EAAE,OAAO;AACfC,EAAAA,IAAI,EAAE,SAAA;CACP,CAAC,EACFH,mBAAiB,CAAC,MAAM,EAAE;AACxBC,EAAAA,KAAK,EAAE,M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AS,CAAC;AACvDyB,EAAAA,GAAG,EAAE,YAAA;CACN,EAAE,iBAAiB,EAAC;AAIrB;;;;AAIG;AACa,SAAAE,IAAIA,CAACC,MAAA,GAAqB,EAAE,EAAA;EAC1C,MAAMC,QAAQ,GAAGD,MAAM,CAACE,OAAO,KAAK,YAAY,GAAGN,kBAAkB,GAAGE,kBAAkB,CAAA;AAE1F,EAAA,MAAMI,OAAO,GAAGF,MAAM,CAACG,aAAa,CAAA;AACpC,EAAA,MAAMC,cAAc,GAAGC,cAAc,CAACL,MAAM,CAACnG,OAAO,CAAC,CAAA;AAErD,EAAA,MAAMyG,cAAc,GAAGL,QAAQ,CAAC7B,SAAS,CAAC;IACxCgC,cAAc;AACdF,IAAAA,OAAAA;AACD,GAAA,CAAC,CAAA;AAEF,EAAA,MAAMK,WAAW,GAAGP,MAAM,CAACO,WAAW,IAAI,CACxChH,iBAAiB,CAACD,QAAQ,CAAC,EAC3Be,kBAAkB,CACnB,CAACmG,IAAI,EAAE,CAAA;AAER,EAAA,OAAO,IAAIC,eAAe,CAACH,cAAc,EAAE,CACzC,GACEC,WAAW,CAACzE,GAAG,CAAC4E,YAAY,IAAIJ,cAAc,CAACK,IAAI,CAACC,EAAE,CAAC;AACrDF,IAAAA,YAAAA;GACD,CAAC,CACH,CACF,CAAC,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../src/snippets.ts","../src/completion.ts","../src/feel.ts"],"sourcesContent":["import { Completion, snippetCompletion } from '@codemirror/autocomplete';\n\n/**\n * A collection of FEEL-related [snippets](#autocomplete.snippet).\n */\nexport const snippets: readonly Completion[] = [\n snippetCompletion('function(${params}) ${body}', {\n label: 'function',\n detail: 'definition',\n type: 'keyword'\n }),\n snippetCompletion('for ${var} in ${collection} return ${value}', {\n label: 'for',\n detail: 'expression',\n type: 'keyword'\n }),\n snippetCompletion('every ${var} in ${collection} satisfies ${condition}', {\n label: 'every',\n detail: 'quantified expression',\n type: 'keyword'\n }),\n snippetCompletion('some ${var} in ${collection} satisfies ${condition}', {\n label: 'some',\n detail: 'quantified expression',\n type: 'keyword'\n }),\n snippetCompletion('if ${condition} then ${value} else ${other value}', {\n label: 'if',\n detail: 'block',\n type: 'keyword'\n }),\n snippetCompletion('{ ${key}: ${value} }', {\n label: 'context',\n detail: 'block',\n type: 'keyword'\n }),\n snippetCompletion('null', {\n label: 'null',\n detail: 'literal',\n type: 'keyword'\n }),\n snippetCompletion('true', {\n label: 'true',\n detail: 'literal',\n type: 'keyword'\n }),\n snippetCompletion('false', {\n label: 'false',\n detail: 'literal',\n type: 'keyword'\n })\n];\n","import { syntaxTree } from '@codemirror/language';\nimport { SyntaxNode } from '@lezer/common';\n\nimport {\n CompletionSource,\n Completion,\n completeFromList,\n CompletionContext\n} from '@codemirror/autocomplete';\n\n\nexport function contextualKeyword(options: {\n before?: string,\n after?: string,\n context: string,\n keyword: string\n}) : CompletionSource {\n\n const {\n context: nodes,\n after,\n before,\n keyword\n } = options;\n\n return ifInside({ nodes, before, after, keyword }, completeFromList([\n { label: keyword, type: 'keyword', boost: 10 }\n ]));\n}\n\nexport const keywordCompletions = [\n contextualKeyword({\n context: 'InExpression',\n keyword: 'in'\n }),\n contextualKeyword({\n context: 'IfExpression',\n keyword: 'then',\n after: 'if',\n before: 'else'\n }),\n contextualKeyword({\n context: 'IfExpression',\n keyword: 'else',\n after: 'then'\n }),\n contextualKeyword({\n context: 'QuantifiedExpression',\n keyword: 'satisfies'\n }),\n contextualKeyword({\n context: 'ForExpression',\n after: 'InExpressions',\n keyword: 'return'\n })\n];\n\nexport const dontCompleteExpression = [\n 'Name',\n 'StringLiteral',\n 'LineComment', 'BlockComment',\n 'PathExpression', 'Context',\n 'Key', 'ParameterName'\n];\n\nexport const doCompleteExpression = [\n 'Expr',\n 'ContextEntry'\n];\n\nexport function ifNode(completionSource: CompletionSource, {\n include,\n exclude\n} : {\n include: string[],\n exclude: string[]\n}) {\n\n const allNodes = [ ...exclude, ...include ];\n\n return (context: CompletionContext) => {\n\n const { state, pos } = context;\n\n const match = matchUp(syntaxTree(state).resolveInner(pos, -1), allNodes);\n\n if (match) {\n\n const [ _, name ] = match;\n\n if (exclude.includes(name)) {\n return null;\n }\n }\n\n return completionSource(context);\n };\n}\n\nexport function ifExpression(completionSource: CompletionSource) : CompletionSource {\n return ifNode(completionSource, {\n include: doCompleteExpression,\n exclude: dontCompleteExpression\n });\n}\n\nexport function snippetCompletion(snippets: readonly Completion[]) : CompletionSource {\n return ifExpression(completeFromList(snippets));\n}\n\nexport function matchLeft(node: SyntaxNode, position: number, nodes: (string|undefined)[]) : SyntaxNode | null {\n return matchChildren(node, position, nodes, -1);\n}\n\nexport function matchRight(node: SyntaxNode, position: number, nodes: (string|undefined)[]) : SyntaxNode | null {\n return matchChildren(node, position, nodes, 1);\n}\n\nexport function matchChildren(node: SyntaxNode, position: number, nodes: (string|undefined)[], direction: 1 | -1) : SyntaxNode | null {\n\n let child = node[direction > 0 ? 'childAfter' : 'childBefore'](position);\n\n while (child) {\n if (nodes.includes(child.name)) {\n return child;\n }\n\n if (child.type.isError && child.firstChild) {\n if (nodes.includes(child.firstChild.name)) {\n return child.firstChild;\n }\n }\n\n child = child[direction > 0 ? 'nextSibling' : 'prevSibling'];\n }\n\n return null;\n}\n\nfunction matchUp(node: SyntaxNode, nodeNames: string | string[]) : [ SyntaxNode, string ] | null {\n\n if (!Array.isArray(nodeNames)) {\n nodeNames = [ nodeNames ];\n }\n\n for (; node; node = node.parent!) {\n\n const nodeType = node.type;\n\n const matchedName = nodeNames.find(name => name && nodeType.is(name));\n\n if (matchedName) {\n return [ node, matchedName ];\n }\n\n if (nodeType.isTop) {\n break;\n }\n }\n\n return null;\n}\n\nexport function ifInside(options: {\n nodes: string | string[],\n keyword: string,\n before?: string,\n after?: string\n}, source: CompletionSource): CompletionSource {\n\n const {\n nodes,\n before,\n after,\n keyword\n } = options;\n\n return (context) => {\n\n const { state, pos } = context;\n\n const match = matchUp(syntaxTree(state).resolveInner(pos, -1), nodes);\n\n if (!match) {\n return null;\n }\n\n const [ node ] = match;\n\n if (matchLeft(node, pos, [ keyword, before ])) {\n return null;\n }\n\n if (matchRight(node, pos, [ keyword, after ])) {\n return null;\n }\n\n if (after && !matchLeft(node, pos, [ after ])) {\n return null;\n }\n\n return source(context);\n };\n}","import {\n parser,\n trackVariables\n} from '@bpmn-io/lezer-feel';\n\nimport {\n LRLanguage,\n LanguageSupport,\n delimitedIndent,\n continuedIndent,\n indentNodeProp,\n foldNodeProp,\n foldInside\n} from '@codemirror/language';\n\nimport {\n snippets\n} from './snippets.js';\n\nimport {\n keywordCompletions,\n snippetCompletion\n} from './completion.js';\n\nimport {\n CompletionSource\n} from '@codemirror/autocomplete';\n\n\n/**\n * A FEEL language provider based on the\n * [Lezer FEEL parser](https://github.com/nikku/lezer-feel),\n * extended with highlighting and indentation information.\n */\nexport const feelLanguage = LRLanguage.define({\n parser: parser.configure({\n props: [\n indentNodeProp.add({\n 'Context': delimitedIndent({\n closing: '}'\n }),\n 'List FilterExpression': delimitedIndent({\n closing: ']'\n }),\n 'ParenthesizedExpression FunctionInvocation': continuedIndent({\n except: /^\\s*\\)/\n }),\n 'ForExpression QuantifiedExpression IfExpression': continuedIndent({\n except: /^\\s*(then|else|return|satisfies)\\b/\n }),\n 'FunctionDefinition': continuedIndent({\n except: /^\\s*(\\(|\\))/\n })\n }),\n foldNodeProp.add({\n Context: foldInside,\n List: foldInside,\n ParenthesizedExpression: foldInside,\n FunctionDefinition(node) {\n const last = node.getChild(')');\n\n if (!last) return null;\n\n return {\n from: last.to,\n to: node.to\n };\n }\n })\n ]\n }),\n languageData: {\n indentOnInput: /^\\s*(\\)|\\}|\\]|then|else|return|satisfies)$/,\n commentTokens: {\n line: '//',\n block: {\n open: '/*',\n close: '*/'\n }\n }\n }\n});\n\nexport type FeelConfig = {\n dialect?: 'expression' | 'unaryTests',\n parserDialect?: string,\n completions?: CompletionSource[],\n context?: Record<string, unknown>\n};\n\n/**\n * A language provider for FEEL Unary Tests\n */\nexport const unaryTestsLanguage = feelLanguage.configure({\n top: 'UnaryTests',\n}, 'FEEL unary tests');\n\n/**\n * Language provider for FEEL Expression\n */\nexport const expressionLanguage = feelLanguage.configure({\n top: 'Expression'\n}, 'FEEL expression');\n\n\n\n/**\n * Feel language support for CodeMirror.\n *\n * Includes [snippet](#lang-feel.snippets)\n */\nexport function feel(config: FeelConfig = {}) {\n const language = config.dialect === 'unaryTests' ? unaryTestsLanguage : expressionLanguage;\n\n const dialect = config.parserDialect;\n const contextTracker = trackVariables(config.context);\n\n const contextualLang = language.configure({\n contextTracker,\n dialect\n });\n\n const completions = config.completions || [\n snippetCompletion(snippets),\n keywordCompletions,\n ].flat();\n\n return new LanguageSupport(contextualLang, [\n ...(\n completions.map(autocomplete => contextualLang.data.of({\n autocomplete\n }))\n )\n ]);\n\n}"],"names":["snippets","snippetCompletion","label","detail","type","contextualKeyword","options","context","nodes","after","before","keyword","ifInside","completeFromList","boost","keywordCompletions","dontCompleteExpression","doCompleteExpression","ifNode","completionSource","include","exclude","allNodes","state","pos","match","matchUp","syntaxTree","resolveInner","_","name","includes","ifExpression","matchLeft","node","position","matchChildren","matchRight","direction","child","isError","firstChild","nodeNames","Array","isArray","parent","nodeType","matchedName","find","is","isTop","source","feelLanguage","LRLanguage","define","parser","configure","props","indentNodeProp","add","delimitedIndent","closing","continuedIndent","except","foldNodeProp","Context","foldInside","List","ParenthesizedExpression","FunctionDefinition","last","getChild","from","to","languageData","indentOnInput","commentTokens","line","block","open","close","unaryTestsLanguage","top","expressionLanguage","feel","config","language","dialect","parserDialect","contextTracker","trackVariables","contextualLang","completions","flat","LanguageSupport","map","autocomplete","data","of"],"mappings":";;;;AAEA;;AAEG;MACUA,QAAQ,GAA0B,CAC7CC,mBAAiB,CAAC,6BAA6B,EAAE;AAC/CC,EAAAA,KAAK,EAAE,UAAU;AACjBC,EAAAA,MAAM,EAAE,YAAY;AACpBC,EAAAA,IAAI,EAAE,SAAA;CACP,CAAC,E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,EAAE,IAAA;AACR,OAAA;AACF,KAAA;AACF,GAAA;AACF,CAAA,EAAC;AASF;;AAEG;MACUC,kBAAkB,GAAG7B,YAAY,CAACI,SAAS,CAAC;AACvD0B,EAAAA,GAAG,EAAE,YAAA;CACN,EAAE,kBAAkB,EAAC;AAEtB;;AAEG;MACUC,kBAAkB,GAAG/B,YAAY,CAACI,SAAS,CAAC;AACvD0B,EAAAA,GAAG,EAAE,YAAA;CACN,EAAE,iBAAiB,EAAC;AAIrB;;;;AAIG;AACa,SAAAE,IAAIA,CAACC,MAAA,GAAqB,EAAE,EAAA;EAC1C,MAAMC,QAAQ,GAAGD,MAAM,CAACE,OAAO,KAAK,YAAY,GAAGN,kBAAkB,GAAGE,kBAAkB,CAAA;AAE1F,EAAA,MAAMI,OAAO,GAAGF,MAAM,CAACG,aAAa,CAAA;AACpC,EAAA,MAAMC,cAAc,GAAGC,cAAc,CAACL,MAAM,CAAC9E,OAAO,CAAC,CAAA;AAErD,EAAA,MAAMoF,cAAc,GAAGL,QAAQ,CAAC9B,SAAS,CAAC;IACxCiC,cAAc;AACdF,IAAAA,OAAAA;AACD,GAAA,CAAC,CAAA;AAEF,EAAA,MAAMK,WAAW,GAAGP,MAAM,CAACO,WAAW,IAAI,CACxC3F,iBAAiB,CAACD,QAAQ,CAAC,EAC3Be,kBAAkB,CACnB,CAAC8E,IAAI,EAAE,CAAA;AAER,EAAA,OAAO,IAAIC,eAAe,CAACH,cAAc,EAAE,CACzC,GACEC,WAAW,CAACG,GAAG,CAACC,YAAY,IAAIL,cAAc,CAACM,IAAI,CAACC,EAAE,CAAC;AACrDF,IAAAA,YAAAA;GACD,CAAC,CACH,CACF,CAAC,CAAA;AAEJ;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bpmn-io/lang-feel",
3
- "version": "4.0.1",
3
+ "version": "4.0.2",
4
4
  "description": "FEEL language support for the CodeMirror code editor",
5
5
  "scripts": {
6
6
  "all": "run-s lint build test",
@@ -62,7 +62,7 @@
62
62
  },
63
63
  "repository": {
64
64
  "type": "git",
65
- "url": "https://github.com/nikku/lang-feel.git"
65
+ "url": "https://github.com/bpmn-io/lang-feel.git"
66
66
  },
67
67
  "engines": {
68
68
  "node": ">= 20.12.0"