@xano/xanoscript-language-server 12.15.0 → 12.16.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xano/xanoscript-language-server",
3
- "version": "12.15.0",
3
+ "version": "12.16.0",
4
4
  "description": "Language Server Protocol implementation for XanoScript",
5
5
  "type": "module",
6
6
  "main": "server.js",
@@ -0,0 +1,20 @@
1
+ import { EqualToken } from "../../lexer/control.js";
2
+ import { ActiveToken } from "../../lexer/realtime_trigger.js";
3
+ import { FalseToken, TrueToken } from "../../lexer/tokens.js";
4
+
5
+ /**
6
+ * @param {import('../base_parser.js').XanoBaseParser} $
7
+ * @returns
8
+ */
9
+ export function activeFieldAttribute($) {
10
+ return () => {
11
+ $.sectionStack.push("activeFieldAttribute");
12
+ $.CONSUME(ActiveToken); // "active"
13
+ $.CONSUME(EqualToken); // "="
14
+ $.OR([
15
+ { ALT: () => $.CONSUME(TrueToken) }, // e.g., true,
16
+ { ALT: () => $.CONSUME(FalseToken) }, // e.g., false
17
+ ]);
18
+ $.sectionStack.pop();
19
+ };
20
+ }
@@ -1,3 +1,4 @@
1
+ import { activeFieldAttribute } from "./activeFieldAttribute.js";
1
2
  import { columnDefaultValueAttribute } from "./columnDefaultValueAttribute.js";
2
3
  import { descriptionFieldAttribute } from "./descriptionFieldAttribute.js";
3
4
  import { disabledFieldAttribute } from "./disabledFieldAttribute.js";
@@ -14,6 +15,10 @@ import { visibilityFieldAttribute } from "./visibilityFieldAttribute.js";
14
15
  * @param {import('../base_parser.js').XanoBaseParser} $
15
16
  */
16
17
  export const register = ($) => {
18
+ $.activeFieldAttribute = $.RULE(
19
+ "activeFieldAttribute",
20
+ activeFieldAttribute($),
21
+ );
17
22
  $.columnDefaultValueAttribute = $.RULE(
18
23
  "columnDefaultValueAttribute",
19
24
  columnDefaultValueAttribute($),
@@ -23,6 +23,7 @@ export function channelDeclaration($) {
23
23
  let hasDescription = false;
24
24
  let hasGuid = false;
25
25
  let hasTags = false;
26
+ let hasActive = false;
26
27
 
27
28
  $.sectionStack.push("channelDeclaration");
28
29
  // Allow leading comments and newlines before the channel declaration
@@ -168,6 +169,13 @@ export function channelDeclaration($) {
168
169
  $.SUBRULE($.tagsAttribute);
169
170
  },
170
171
  },
172
+ {
173
+ GATE: () => !hasActive,
174
+ ALT: () => {
175
+ hasActive = true;
176
+ $.SUBRULE($.activeFieldAttribute);
177
+ },
178
+ },
171
179
  ]);
172
180
  });
173
181
 
@@ -5,6 +5,7 @@ import { SetToken } from "../../../lexer/redis.js";
5
5
  * key = "name"
6
6
  * data = "xano"
7
7
  * ttl = 0
8
+ * create_only = true
8
9
  * }
9
10
  * @param {import('../../base_parser.js').XanoBaseParser} $
10
11
  */
@@ -19,6 +20,7 @@ export function redisSetFn($) {
19
20
  key: "[expression]",
20
21
  data: "[expression]",
21
22
  ttl: "[expression]",
23
+ "create_only?": "[boolean]",
22
24
  "description?": "[string]",
23
25
  "disabled?": "[boolean]",
24
26
  },