@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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xano/xanoscript-language-server",
3
- "version": "12.6.0",
3
+ "version": "12.6.1",
4
4
  "description": "Language Server Protocol implementation for XanoScript",
5
5
  "type": "module",
6
6
  "main": "server.js",
@@ -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
- $.addWarning(
34
- `Using \`$\` prefixed properties '${token.image}' is discouraged.`,
35
- token
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