@xano/xanoscript-language-server 11.1.0 → 11.3.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.
@@ -1,5 +1,4 @@
1
1
  import { documentCache } from "../cache/documentCache.js";
2
- import { debugError, debugLog } from "../debug.js";
3
2
 
4
3
  // Diagnostic severity constants
5
4
  const SEVERITY = {
@@ -61,7 +60,7 @@ export function onDidChangeContent(params, connection) {
61
60
  const document = params.document;
62
61
 
63
62
  if (!document) {
64
- debugError(
63
+ console.error(
65
64
  "onDidChangeContent(): Document not found for URI:",
66
65
  params.textDocument.uri
67
66
  );
@@ -84,7 +83,7 @@ export function onDidChangeContent(params, connection) {
84
83
  }
85
84
 
86
85
  for (const error of parser.errors) {
87
- debugError(
86
+ console.error(
88
87
  `onDidChangeContent(): Error parsing document: ${error.name}`
89
88
  );
90
89
  }
@@ -92,7 +91,7 @@ export function onDidChangeContent(params, connection) {
92
91
  // Create diagnostics in a single pass
93
92
  const diagnostics = createDiagnostics(parser, document);
94
93
 
95
- debugLog(
94
+ console.log(
96
95
  `onDidChangeContent(): sending diagnostic (${parser.errors.length} errors) for scheme:`,
97
96
  scheme
98
97
  );
@@ -1,5 +1,4 @@
1
1
  import { documentCache } from "../cache/documentCache.js";
2
- import { debugError } from "../debug.js";
3
2
 
4
3
  /**
5
4
  * Binary search to find token index at the given offset.
@@ -38,7 +37,7 @@ export function onHoverDocument(params, documents, hoverProviders = []) {
38
37
  const document = documents.get(params.textDocument.uri);
39
38
 
40
39
  if (!document) {
41
- debugError(
40
+ console.error(
42
41
  "onHover(): Document not found for URI:",
43
42
  params.textDocument.uri
44
43
  );
@@ -1,4 +1,3 @@
1
- import { debugLog } from "../debug.js";
2
1
  import { lexDocument } from "../lexer/lexer.js";
3
2
  import { mapTokenToType } from "../lexer/tokens.js";
4
3
  import { encodeTokenType } from "./tokens.js";
@@ -34,7 +33,7 @@ function higlightDefault(text, SemanticTokensBuilder) {
34
33
  0 // No modifiers for now
35
34
  );
36
35
  } else if (tokenType === undefined) {
37
- debugLog(
36
+ console.log(
38
37
  `token type not mapped to a type: ${JSON.stringify(
39
38
  token.tokenType.name
40
39
  )}`
@@ -1,4 +1,3 @@
1
- import { debugError } from "../debug.js";
2
1
  import { getSchemeFromContent } from "../utils";
3
2
  import { higlightText } from "./highlight";
4
3
 
@@ -12,7 +11,7 @@ export function onSemanticCheck(params, documents, SemanticTokensBuilder) {
12
11
  const document = documents.get(params.textDocument.uri);
13
12
 
14
13
  if (!document) {
15
- debugError(
14
+ console.error(
16
15
  "onSemanticCheck(): Document not found for URI:",
17
16
  params.textDocument.uri
18
17
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xano/xanoscript-language-server",
3
- "version": "11.1.0",
3
+ "version": "11.3.0",
4
4
  "description": "Language Server Protocol implementation for XanoScript",
5
5
  "type": "module",
6
6
  "main": "server.js",
@@ -77,7 +77,7 @@ export function queryDeclaration($) {
77
77
  if (!["stream", "standard"].includes(value)) {
78
78
  $.addInvalidValueError(
79
79
  valueToken,
80
- "response_type must be either 'stream' or 'standard'"
80
+ "response_type must be either 'stream' or 'standard'",
81
81
  );
82
82
  }
83
83
  },
@@ -163,6 +163,14 @@ export function queryDeclaration($) {
163
163
  ]);
164
164
  });
165
165
 
166
+ // when not provided, the api_group will default to the api_group.xs file defined in the same folder
167
+ if (!hasApiGroup) {
168
+ $.addWarning(
169
+ "api_group is not provided, defaulting to api_group.xs defined in the same folder",
170
+ parent,
171
+ );
172
+ }
173
+
166
174
  if (!hasInput) {
167
175
  $.addMissingError(parent, "{} is missing an input clause");
168
176
  }
package/server.js CHANGED
@@ -5,7 +5,6 @@ import {
5
5
  TextDocuments,
6
6
  } from "vscode-languageserver/node.js";
7
7
  import { TextDocument } from "vscode-languageserver-textdocument";
8
- import { debugLog } from "./debug.js";
9
8
  import { onCompletion } from "./onCompletion/onCompletion.js";
10
9
  import { onDidChangeContent } from "./onDidChangeContent/onDidChangeContent.js";
11
10
  import { onHover } from "./onHover/onHover.js";
@@ -51,7 +50,7 @@ documents.onDidChangeContent((params) =>
51
50
  onDidChangeContent(params, connection)
52
51
  );
53
52
  connection.onDidOpenTextDocument((params) => {
54
- debugLog("Document opened:", params.textDocument.uri);
53
+ console.log("Document opened:", params.textDocument.uri);
55
54
  // Existing handler logic
56
55
  });
57
56
 
package/debug.js DELETED
@@ -1,18 +0,0 @@
1
- /* global process */
2
- /**
3
- * Debug logging utility.
4
- * Set XS_DEBUG=1 environment variable to enable debug logging.
5
- */
6
- const isDebug = process.env.XS_DEBUG === "1";
7
-
8
- export function debugLog(...args) {
9
- if (isDebug) {
10
- console.log(...args);
11
- }
12
- }
13
-
14
- export function debugError(...args) {
15
- if (isDebug) {
16
- console.error(...args);
17
- }
18
- }