@lcap/nasl-language-server-core 4.5.0-beta.3 → 4.5.0-beta.4
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/out/checker.d.ts.map +1 -1
- package/out/checker.js +19 -4
- package/out/checker.js.map +1 -1
- package/out/reference-manager/def-key-helpers.d.ts.map +1 -1
- package/out/reference-manager/def-key-helpers.js +8 -0
- package/out/reference-manager/def-key-helpers.js.map +1 -1
- package/out/reference-manager/helper.d.ts.map +1 -1
- package/out/reference-manager/helper.js +2 -0
- package/out/reference-manager/helper.js.map +1 -1
- package/out/reference-manager/reference-manager.d.ts.map +1 -1
- package/out/reference-manager/reference-manager.js +27 -10
- package/out/reference-manager/reference-manager.js.map +1 -1
- package/out/typer/dispatch-call.d.ts.map +1 -1
- package/out/typer/dispatch-call.js +3 -2
- package/out/typer/dispatch-call.js.map +1 -1
- package/out/typer/dispatch-expr.d.ts.map +1 -1
- package/out/typer/dispatch-expr.js +10 -0
- package/out/typer/dispatch-expr.js.map +1 -1
- package/out/typer/dispatch-stmt.d.ts.map +1 -1
- package/out/typer/dispatch-stmt.js +4 -1
- package/out/typer/dispatch-stmt.js.map +1 -1
- package/out/typer/dispatch-view.js +2 -2
- package/out/typer/dispatch-view.js.map +1 -1
- package/out/typer/incremental-update.d.ts.map +1 -1
- package/out/typer/incremental-update.js +14 -1
- package/out/typer/incremental-update.js.map +1 -1
- package/out/typer/solver.d.ts.map +1 -1
- package/out/typer/solver.js +17 -27
- package/out/typer/solver.js.map +1 -1
- package/out/typer/type-manager.js +1 -1
- package/out/typer/type-manager.js.map +1 -1
- package/out/typer/type-predicate.js +1 -1
- package/out/typer/type-predicate.js.map +1 -1
- package/out/typer/typer.d.ts +4 -2
- package/out/typer/typer.d.ts.map +1 -1
- package/out/typer/typer.js +73 -5
- package/out/typer/typer.js.map +1 -1
- package/out/typer/unifier.d.ts +11 -0
- package/out/typer/unifier.d.ts.map +1 -1
- package/out/typer/unifier.js +63 -19
- package/out/typer/unifier.js.map +1 -1
- package/out/utils/bind-expression-hack.d.ts +15 -1
- package/out/utils/bind-expression-hack.d.ts.map +1 -1
- package/out/utils/bind-expression-hack.js +125 -3
- package/out/utils/bind-expression-hack.js.map +1 -1
- package/package.json +5 -5
package/out/checker.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checker.d.ts","sourceRoot":"","sources":["../src/checker.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,UAAU,EAC4C,QAAQ,EAC5B,IAAI,EAQ+E,GAAG,EAMxH,QAAQ,EAGT,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACgE,cAAc,EAGpF,MAAM,qBAAqB,CAAC;AAS7B,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,eAAe,CAAC;AAK5C,OAAO,EAAE,UAAU,IAAI,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"checker.d.ts","sourceRoot":"","sources":["../src/checker.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,UAAU,EAC4C,QAAQ,EAC5B,IAAI,EAQ+E,GAAG,EAMxH,QAAQ,EAGT,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACgE,cAAc,EAGpF,MAAM,qBAAqB,CAAC;AAS7B,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,eAAe,CAAC;AAK5C,OAAO,EAAE,UAAU,IAAI,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAapE,oBAAY,QAAQ;IAClB,IAAI,YAAY;IAChB,KAAK,UAAU;CAChB;AAED,MAAM,MAAM,UAAU,GAAG,kBAAkB,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;AAEnE,KAAK,YAAY,GAAG;IAClB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,CAAC;AAOF,MAAM,MAAM,kBAAkB,GAAG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IACf,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IACrC,mBAAmB,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IACvC,qBAAqB,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;CAC1C;AAMD,eAAO,MAAM,6BAA6B,aAC9B,UAAU,+DAGnB,MAAM,gBAAgB,CAyCxB,CAAC;AAMF,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
package/out/checker.js
CHANGED
|
@@ -15,6 +15,7 @@ const asserts_1 = require("@lcap/nasl-concepts/asserts");
|
|
|
15
15
|
const helper_1 = require("./typer/helper");
|
|
16
16
|
const semantic_rules_1 = require("./semantic-rules");
|
|
17
17
|
const view_element_field_attrs_1 = require("@lcap/nasl-concepts/view-element-field-attrs");
|
|
18
|
+
const reference_manager_1 = require("./reference-manager/reference-manager");
|
|
18
19
|
const regeExp = new nasl_utils_1.ExpressionLexer();
|
|
19
20
|
regeExp.profile = nasl_utils_1.profiles.js;
|
|
20
21
|
var Severity;
|
|
@@ -364,10 +365,15 @@ function createErrorDiagnoser(context) {
|
|
|
364
365
|
aggregatedContext[arrayField] = values;
|
|
365
366
|
}
|
|
366
367
|
}
|
|
367
|
-
|
|
368
|
+
const newDetail = {
|
|
368
369
|
...diagnostic,
|
|
369
370
|
...aggregatedContext,
|
|
370
371
|
};
|
|
372
|
+
// 若已有 error 级别,后续 warn 不能降级 severity
|
|
373
|
+
if (finalNode.tsErrorDetail?.severity === Severity.ERROR && newDetail.severity !== Severity.ERROR) {
|
|
374
|
+
return;
|
|
375
|
+
}
|
|
376
|
+
finalNode.tsErrorDetail = newDetail;
|
|
371
377
|
}
|
|
372
378
|
else {
|
|
373
379
|
finalNode.tsErrorDetail = diagnostic;
|
|
@@ -530,12 +536,13 @@ function createErrorDiagnoser(context) {
|
|
|
530
536
|
vusionValidator = new nasl_concepts_1.VusionValidator({}, {}, conceptValidator.rules, {}) || {};
|
|
531
537
|
validatorMap.set(validatorMapKey, vusionValidator);
|
|
532
538
|
}
|
|
539
|
+
const nodeTitle = (0, nasl_concepts_1.getConceptConstructor)(concept).nodeTitle;
|
|
533
540
|
const res = vusionValidator.validateSync(toBeVerifiedName, [], {
|
|
534
|
-
label:
|
|
541
|
+
label: nodeTitle,
|
|
535
542
|
alwaysResolve: true,
|
|
536
543
|
});
|
|
537
544
|
if (res) {
|
|
538
|
-
error(node,
|
|
545
|
+
error(node, `${nodeTitle}【${toBeVerifiedName}】命名非法:${res}`, {
|
|
539
546
|
checkRule: 'no-invalid-names',
|
|
540
547
|
});
|
|
541
548
|
}
|
|
@@ -3571,7 +3578,15 @@ function createErrorDiagnoser(context) {
|
|
|
3571
3578
|
* @param node
|
|
3572
3579
|
*/
|
|
3573
3580
|
function* checkCallConnector(node) {
|
|
3574
|
-
if (ensureNodeKeyExists(node, 'calleeConnectionName')) {
|
|
3581
|
+
if (ensureNodeKeyExists(node, 'calleeConnectionName') && !isAIStrictMode) {
|
|
3582
|
+
const connectionQName = `${reference_manager_1.ReferenceManager.connectionNsp}.${node.calleeConnectionName}`;
|
|
3583
|
+
const ref = env.refMgr.gQNameDefs.get(connectionQName);
|
|
3584
|
+
if (!ref) {
|
|
3585
|
+
error(node, `找不到连接 ${node.calleeConnectionName}。`, {
|
|
3586
|
+
tag: 'connectionAbsent',
|
|
3587
|
+
});
|
|
3588
|
+
}
|
|
3589
|
+
}
|
|
3575
3590
|
return env.getType(node);
|
|
3576
3591
|
}
|
|
3577
3592
|
/**
|