@valtzu/codemirror-lang-el 1.1.0 → 1.2.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/CHANGELOG.md CHANGED
@@ -1,6 +1,12 @@
1
1
  CHANGELOG
2
2
  =========
3
3
 
4
+ 1.2
5
+ ---
6
+
7
+ * Add support for typed arrays
8
+ * Add Codex CLI and Docker Compose integration
9
+
4
10
  1.1
5
11
  ---
6
12
 
package/README.md CHANGED
@@ -42,7 +42,7 @@ If you're using Bootstrap UI, check the [Web Component](https://github.com/valtz
42
42
 
43
43
  ```html
44
44
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
45
- <script type="module" src="https://esm.sh/symfony-expression-editor@0.1.0"></script>
45
+ <script type="module" src="https://esm.sh/symfony-expression-editor"></script>
46
46
  <textarea class="form-control" is="expression-editor" rows="1">'foobar' starts with 'foo'</textarea>
47
47
  ```
48
48
 
@@ -72,7 +72,7 @@ See [CONFIGURATION.md](CONFIGURATION.md)
72
72
 
73
73
  ### Example
74
74
 
75
- [Live demo](https://jsfiddle.net/turse2xq/)
75
+ [Live demo](https://jsfiddle.net/32ybaetz/)
76
76
 
77
77
  ```html
78
78
  <div id="editor"></div>
@@ -118,6 +118,15 @@ See [CONFIGURATION.md](CONFIGURATION.md)
118
118
  </script>
119
119
  ```
120
120
 
121
+ ### Using OpenAI codex
122
+
123
+ Create `.env` file with
124
+ ```
125
+ OPENAI_API_KEY="..."
126
+ ```
127
+
128
+ Then use `docker compose run --rm codex` to develop with AI.
129
+
121
130
  ### Contributing
122
131
 
123
132
  Contributions are welcome.
package/dist/index.cjs CHANGED
@@ -154,6 +154,18 @@ function resolveTypes(state, node, config) {
154
154
  (_d = (_c = resolveIdentifier((_a = node.lastChild) === null || _a === void 0 ? void 0 : _a.type.id, 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));
155
155
  });
156
156
  }
157
+ // Array indexing: for typed arrays (e.g. Foo[]) return element type, for generic arrays return any
158
+ else if (node.type.is(ArrayAccess) && node.firstChild) {
159
+ const left = node.firstChild.node;
160
+ resolveTypes(state, left, config).forEach(baseType => {
161
+ if (baseType.endsWith('[]')) {
162
+ types.add(baseType.slice(0, -2));
163
+ }
164
+ else if (baseType === exports.ELScalar.Array) {
165
+ types.add(exports.ELScalar.Any);
166
+ }
167
+ });
168
+ }
157
169
  else if (node.type.is(Application) && node.firstChild) {
158
170
  resolveTypes(state, node.firstChild, config).forEach(x => types.add(x));
159
171
  }
package/dist/index.js CHANGED
@@ -151,6 +151,18 @@ function resolveTypes(state, node, config) {
151
151
  (_d = (_c = resolveIdentifier((_a = node.lastChild) === null || _a === void 0 ? void 0 : _a.type.id, 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));
152
152
  });
153
153
  }
154
+ // Array indexing: for typed arrays (e.g. Foo[]) return element type, for generic arrays return any
155
+ else if (node.type.is(ArrayAccess) && node.firstChild) {
156
+ const left = node.firstChild.node;
157
+ resolveTypes(state, left, config).forEach(baseType => {
158
+ if (baseType.endsWith('[]')) {
159
+ types.add(baseType.slice(0, -2));
160
+ }
161
+ else if (baseType === ELScalar.Array) {
162
+ types.add(ELScalar.Any);
163
+ }
164
+ });
165
+ }
154
166
  else if (node.type.is(Application) && node.firstChild) {
155
167
  resolveTypes(state, node.firstChild, config).forEach(x => types.add(x));
156
168
  }
package/package.json CHANGED
@@ -39,5 +39,5 @@
39
39
  "access": "public",
40
40
  "registry": "https://registry.npmjs.org/"
41
41
  },
42
- "version": "1.1.0"
42
+ "version": "1.2.0"
43
43
  }