@valtzu/codemirror-lang-el 0.4.0 → 0.4.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.
- package/README.md +11 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
|
|
11
11
|

|
|
12
12
|
|
|
13
|
+
[Live demo](https://jsfiddle.net/9xhezam4/)
|
|
14
|
+
|
|
13
15
|
```html
|
|
14
16
|
<div id="editor"></div>
|
|
15
17
|
<script type="importmap">
|
|
@@ -29,7 +31,7 @@
|
|
|
29
31
|
"style-mod": "https://esm.sh/*style-mod@4.1.2",
|
|
30
32
|
"w3c-keyname": "https://esm.sh/*w3c-keyname@2.2.8",
|
|
31
33
|
"crelt": "https://esm.sh/*crelt@1.0.6",
|
|
32
|
-
"@valtzu/codemirror-lang-el": "https://esm.sh/*@valtzu/codemirror-lang-el@0.4.
|
|
34
|
+
"@valtzu/codemirror-lang-el": "https://esm.sh/*@valtzu/codemirror-lang-el@0.4.2"
|
|
33
35
|
}
|
|
34
36
|
}
|
|
35
37
|
</script>
|
|
@@ -38,6 +40,7 @@
|
|
|
38
40
|
import { acceptCompletion } from "@codemirror/autocomplete";
|
|
39
41
|
import { keymap } from "@codemirror/view";
|
|
40
42
|
import { expressionlanguage } from "@valtzu/codemirror-lang-el";
|
|
43
|
+
import { defaultKeymap } from "@codemirror/commands";
|
|
41
44
|
|
|
42
45
|
|
|
43
46
|
let editor = new EditorView({
|
|
@@ -73,4 +76,11 @@
|
|
|
73
76
|
doc: 'is_granted(user, user.self.getGroup())',
|
|
74
77
|
});
|
|
75
78
|
</script>
|
|
79
|
+
<style>
|
|
80
|
+
.cm-completionDetail {
|
|
81
|
+
float: right;
|
|
82
|
+
opacity: 0.5;
|
|
83
|
+
font-style: inherit !important;
|
|
84
|
+
}
|
|
85
|
+
</style>
|
|
76
86
|
```
|
package/dist/index.cjs
CHANGED
|
@@ -37,7 +37,7 @@ const expressionLanguageLinter = (config) => lint.linter(view => {
|
|
|
37
37
|
const leftArgument = node.node.parent.firstChild.node;
|
|
38
38
|
const types = resolveTypes(view.state, leftArgument, config, true);
|
|
39
39
|
const identifier = view.state.sliceDoc(node.from, node.to);
|
|
40
|
-
if (((_d = (_c = node.node.parent) === null || _c === void 0 ? void 0 : _c.parent) === null || _d === void 0 ? void 0 : _d.name) === 'FunctionCall') {
|
|
40
|
+
if (((_d = (_c = node.node.parent) === null || _c === void 0 ? void 0 : _c.parent) === null || _d === void 0 ? void 0 : _d.name) === 'FunctionCall' && !node.node.parent.prevSibling) {
|
|
41
41
|
if (!Array.from(types).find(type => { var _a, _b, _c; return (_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 === identifier); })) {
|
|
42
42
|
diagnostics.push({
|
|
43
43
|
from: node.from,
|
package/dist/index.js
CHANGED
|
@@ -33,7 +33,7 @@ const expressionLanguageLinter = (config) => linter(view => {
|
|
|
33
33
|
const leftArgument = node.node.parent.firstChild.node;
|
|
34
34
|
const types = resolveTypes(view.state, leftArgument, config, true);
|
|
35
35
|
const identifier = view.state.sliceDoc(node.from, node.to);
|
|
36
|
-
if (((_d = (_c = node.node.parent) === null || _c === void 0 ? void 0 : _c.parent) === null || _d === void 0 ? void 0 : _d.name) === 'FunctionCall') {
|
|
36
|
+
if (((_d = (_c = node.node.parent) === null || _c === void 0 ? void 0 : _c.parent) === null || _d === void 0 ? void 0 : _d.name) === 'FunctionCall' && !node.node.parent.prevSibling) {
|
|
37
37
|
if (!Array.from(types).find(type => { var _a, _b, _c; return (_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 === identifier); })) {
|
|
38
38
|
diagnostics.push({
|
|
39
39
|
from: node.from,
|
package/package.json
CHANGED