@xano/xanoscript-language-server 12.6.0 → 12.6.1
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/package.json
CHANGED
|
@@ -14,6 +14,12 @@ export function chainedIdentifier($) {
|
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
/**
|
|
18
|
+
* `$` prefixed properties that are allowed without a warning, e.g.
|
|
19
|
+
* `$my_var.$search` or `$my_var.$this`.
|
|
20
|
+
*/
|
|
21
|
+
const ALLOWED_DOLLAR_PROPERTIES = new Set(["$search", "$this"]);
|
|
22
|
+
|
|
17
23
|
/**
|
|
18
24
|
* to be used after a variable to reference a single property depth
|
|
19
25
|
* like foo.bar , foo[1] or foo["key"]
|
|
@@ -30,10 +36,12 @@ export function singleChainedIdentifier($) {
|
|
|
30
36
|
{
|
|
31
37
|
ALT: () => {
|
|
32
38
|
const token = $.CONSUME(ShortFormVariable);
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
39
|
+
if (!ALLOWED_DOLLAR_PROPERTIES.has(token.image)) {
|
|
40
|
+
$.addWarning(
|
|
41
|
+
`Using \`$\` prefixed properties '${token.image}' is discouraged.`,
|
|
42
|
+
token
|
|
43
|
+
);
|
|
44
|
+
}
|
|
37
45
|
},
|
|
38
46
|
}, // e.g., .bar
|
|
39
47
|
{ ALT: () => $.CONSUME(Identifier) }, // e.g., .bar
|