@xano/xanoscript-language-server 11.12.0 → 11.12.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/.claude/memory/feedback_no_git.md +11 -0
- package/.claude/settings.local.json +13 -28
- package/lexer/cast.js +3 -3
- package/lexer/control.js +0 -2
- package/lexer/literal.js +2 -2
- package/lexer/security.js +2 -2
- package/package.json +1 -1
- package/parser/attributes/columnDefaultValueAttribute.js +10 -3
- package/parser/attributes/inputFilterFn.js +11 -4
- package/parser/clauses/flexibleStringClause.js +2 -2
- package/parser/clauses/nakedStackFn.js +43 -36
- package/parser/clauses/nakedStackFn.spec.js +10 -0
- package/parser/clauses/responseClause.spec.js +5 -0
- package/parser/definitions/columnDefinition.js +7 -2
- package/parser/functions/array/arrayNoValueAs.js +1 -1
- package/parser/functions/array/arrayPopFn.js +1 -3
- package/parser/functions/controls/forEachFn.spec.js +8 -0
- package/parser/functions/controls/preconditionFn.js +3 -0
- package/parser/functions/db/dbExternalDirectQueryFn.js +1 -0
- package/parser/functions/db/dbQueryFn.spec.js +31 -0
- package/parser/functions/schema/schemaParseConstantFn.js +11 -10
- package/parser/functions/varFn.js +14 -2
- package/parser/functions/varFn.spec.js +20 -12
- package/parser/generic/asVariable.spec.js +12 -8
- package/parser/generic/assignableVariableAs.js +50 -11
- package/parser/generic/assignableVariableAs.spec.js +29 -7
- package/parser/generic/assignableVariableProperty.js +22 -10
- package/parser/generic/assignableVariableProperty.spec.js +21 -12
- package/parser/generic/expressionFn.js +9 -2
- package/parser/generic/expressionFn.spec.js +5 -0
- package/parser/generic/filterNames.js +9 -0
- package/parser/multidoc.js +38 -17
- package/parser/multidoc.spec.js +7 -1
- package/parser/query_parser.js +11 -3
- package/parser/query_parser.spec.js +0 -3
- package/parser/tests/function/function_parser.spec.js +4 -4
- package/parser/tests/multidoc/multidoc_parser.spec.js +55 -0
- package/parser/tests/multidoc/valid_sources/function_stack.xs +130603 -0
- package/parser/tests/query/query_parser.spec.js +3 -3
- package/parser/tool_parser.js +12 -3
- package/parser/tool_parser.spec.js +19 -6
|
@@ -9,13 +9,13 @@ describe("Xanoscript Query Parser", () => {
|
|
|
9
9
|
it("parses all the valid sources", () => {
|
|
10
10
|
const errors = [];
|
|
11
11
|
const files = readdirSync(
|
|
12
|
-
join(dirname("./"), "parser/tests/query/valid_sources")
|
|
12
|
+
join(dirname("./"), "parser/tests/query/valid_sources"),
|
|
13
13
|
);
|
|
14
14
|
|
|
15
15
|
files.forEach((file) => {
|
|
16
16
|
const source = readFileSync(
|
|
17
17
|
join(dirname("./"), "parser/tests/query/valid_sources", file),
|
|
18
|
-
"utf8"
|
|
18
|
+
"utf8",
|
|
19
19
|
);
|
|
20
20
|
const parser = xanoscriptParser(source);
|
|
21
21
|
|
|
@@ -27,7 +27,7 @@ describe("Xanoscript Query Parser", () => {
|
|
|
27
27
|
error.previousToken.image,
|
|
28
28
|
{
|
|
29
29
|
length: 20,
|
|
30
|
-
}
|
|
30
|
+
},
|
|
31
31
|
)})`
|
|
32
32
|
: "N/A",
|
|
33
33
|
file: error.token
|
package/parser/tool_parser.js
CHANGED
|
@@ -111,15 +111,24 @@ export function toolDeclaration($) {
|
|
|
111
111
|
});
|
|
112
112
|
|
|
113
113
|
if (!hasInput) {
|
|
114
|
-
$.addMissingError(
|
|
114
|
+
$.addMissingError(
|
|
115
|
+
parent,
|
|
116
|
+
`{} ${nameToken.image} is missing an input clause`,
|
|
117
|
+
);
|
|
115
118
|
}
|
|
116
119
|
|
|
117
120
|
if (!hasStack) {
|
|
118
|
-
$.addMissingError(
|
|
121
|
+
$.addMissingError(
|
|
122
|
+
parent,
|
|
123
|
+
`{} ${nameToken.image} is missing a stack clause`,
|
|
124
|
+
);
|
|
119
125
|
}
|
|
120
126
|
|
|
121
127
|
if (!hasResponse) {
|
|
122
|
-
$.addMissingError(
|
|
128
|
+
$.addMissingError(
|
|
129
|
+
parent,
|
|
130
|
+
`{} ${nameToken.image} is missing a response clause`,
|
|
131
|
+
);
|
|
123
132
|
}
|
|
124
133
|
|
|
125
134
|
$.MANY1(() => $.CONSUME1(NewlineToken)); // optional new line
|
|
@@ -19,15 +19,28 @@ describe("tool_parser", () => {
|
|
|
19
19
|
|
|
20
20
|
it("should parse a basic a string tool url", () => {
|
|
21
21
|
const parser = xanoscriptParser(`tool "foo/bar" {
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
input {
|
|
23
|
+
}
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
stack {
|
|
26
|
+
}
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
response = null
|
|
29
|
+
}`);
|
|
30
|
+
|
|
31
|
+
expect(parser.errors).to.be.empty;
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it("should parse a tool with a string as a response", () => {
|
|
35
|
+
const parser = xanoscriptParser(`tool silent_exception {
|
|
36
|
+
input {
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
stack {
|
|
40
|
+
}
|
|
30
41
|
|
|
42
|
+
response = "something is wrong"
|
|
43
|
+
}`);
|
|
31
44
|
expect(parser.errors).to.be.empty;
|
|
32
45
|
});
|
|
33
46
|
|