@xano/xanoscript-language-server 12.9.0 → 12.10.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.9.0",
3
+ "version": "12.10.0",
4
4
  "description": "Language Server Protocol implementation for XanoScript",
5
5
  "type": "module",
6
6
  "main": "server.js",
@@ -1,3 +1,4 @@
1
+ import { ServerToken } from "../lexer/channel.js";
1
2
  import { ChannelTriggerToken } from "../lexer/channel_trigger.js";
2
3
  import { EqualToken, LCurly, RCurly } from "../lexer/control.js";
3
4
  import { StringLiteral } from "../lexer/literal.js";
@@ -8,6 +9,7 @@ export function channelTriggerDeclaration($) {
8
9
  return () => {
9
10
  let hasActions = false;
10
11
  let hasActive = false;
12
+ let hasServer = false;
11
13
  let hasChannel = false;
12
14
  let hasDescription = false;
13
15
  let hasGuid = false;
@@ -62,6 +64,18 @@ export function channelTriggerDeclaration($) {
62
64
  $.SUBRULE($.booleanValue);
63
65
  },
64
66
  },
67
+ {
68
+ GATE: () => !hasServer,
69
+ ALT: () => {
70
+ hasServer = true;
71
+ const subParent = $.CONSUME(ServerToken); // "server"
72
+ $.CONSUME3(EqualToken); // "="
73
+ const result = $.CONSUME2(StringLiteral); // "server_name"
74
+ if (result.image === `""`) {
75
+ $.addMissingError(subParent, "server cannot be empty");
76
+ }
77
+ },
78
+ },
65
79
  {
66
80
  GATE: () => !hasChannel,
67
81
  ALT: () => {
@@ -121,6 +135,10 @@ export function channelTriggerDeclaration($) {
121
135
  ]);
122
136
  });
123
137
 
138
+ if (!hasServer) {
139
+ $.addMissingError(parent, "{} is missing a server clause");
140
+ }
141
+
124
142
  if (!hasChannel) {
125
143
  $.addMissingError(parent, "{} is missing a channel clause");
126
144
  }
@@ -1,3 +1,4 @@
1
+ import { ServerToken } from "../lexer/channel.js";
1
2
  import { EqualToken, LCurly, RCurly } from "../lexer/control.js";
2
3
  import { StringLiteral } from "../lexer/literal.js";
3
4
  import { DeliverToToken, MessageToken } from "../lexer/message.js";
@@ -6,6 +7,7 @@ import { AuthToken, Identifier, NewlineToken } from "../lexer/tokens.js";
6
7
  export function messageDeclaration($) {
7
8
  return () => {
8
9
  let hasAuth = false;
10
+ let hasServer = false;
9
11
  let hasChannel = false;
10
12
  let hasDeliverTo = false;
11
13
  let hasDescription = false;
@@ -42,6 +44,18 @@ export function messageDeclaration($) {
42
44
  $.CONSUME2(StringLiteral); // "user"
43
45
  },
44
46
  },
47
+ {
48
+ GATE: () => !hasServer,
49
+ ALT: () => {
50
+ hasServer = true;
51
+ const subParent = $.CONSUME(ServerToken); // "server"
52
+ $.CONSUME3(EqualToken); // "="
53
+ const result = $.CONSUME3(StringLiteral); // "server_name"
54
+ if (result.image === `""`) {
55
+ $.addMissingError(subParent, "server cannot be empty");
56
+ }
57
+ },
58
+ },
45
59
  {
46
60
  GATE: () => !hasChannel,
47
61
  ALT: () => {
@@ -125,6 +139,13 @@ export function messageDeclaration($) {
125
139
  ]);
126
140
  });
127
141
 
142
+ if (!hasServer) {
143
+ $.addMissingError(
144
+ parent,
145
+ `{} ${nameToken.image} is missing a server clause`,
146
+ );
147
+ }
148
+
128
149
  if (!hasChannel) {
129
150
  $.addMissingError(
130
151
  parent,