@lcap/nasl-language-server-core 4.5.0-beta.2 → 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 +22 -5
- 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/collectGlobalDefs.d.ts.map +1 -1
- package/out/typer/collectGlobalDefs.js +18 -0
- package/out/typer/collectGlobalDefs.js.map +1 -1
- package/out/typer/dispatch-call.d.ts.map +1 -1
- package/out/typer/dispatch-call.js +7 -1
- 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.d.ts.map +1 -1
- package/out/typer/dispatch-view.js +9 -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/sem-diag.js +1 -1
- package/out/typer/sem-diag.js.map +1 -1
- package/out/typer/solver.d.ts.map +1 -1
- package/out/typer/solver.js +19 -29
- package/out/typer/solver.js.map +1 -1
- package/out/typer/type-manager.d.ts.map +1 -1
- package/out/typer/type-manager.js +5 -1
- package/out/typer/type-manager.js.map +1 -1
- package/out/typer/type-predicate.d.ts +5 -0
- package/out/typer/type-predicate.d.ts.map +1 -1
- package/out/typer/type-predicate.js +25 -18
- package/out/typer/type-predicate.js.map +1 -1
- package/out/typer/typer.d.ts +12 -2
- package/out/typer/typer.d.ts.map +1 -1
- package/out/typer/typer.js +81 -5
- package/out/typer/typer.js.map +1 -1
- package/out/typer/unifier.d.ts +35 -0
- package/out/typer/unifier.d.ts.map +1 -1
- package/out/typer/unifier.js +117 -21
- 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/out/utils/parseTsClassType.d.ts.map +1 -1
- package/out/utils/parseTsClassType.js +6 -0
- package/out/utils/parseTsClassType.js.map +1 -1
- package/package.json +6 -6
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,eAA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YAAY,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,gBAC/C,CAAC,GAAG,EAAE,UAAU,KAAK,OAAO,qBACvB,MAAM,EAAE,oBACT,CAAC,YAAY,EAAE,UAAU,KAAK,UAAU,EAAE,KAC3D,kBAAkB,GAAG,IAAI;EAwF7B;AAqED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IAEX,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,QAAQ,CAAC;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;
|
|
@@ -271,6 +272,7 @@ function createErrorDiagnoser(context) {
|
|
|
271
272
|
let inPlayground = 0;
|
|
272
273
|
let inAuthLogic = false;
|
|
273
274
|
let inFrontendType = false;
|
|
275
|
+
let currentFrameworkKind = 'vue2';
|
|
274
276
|
let currentFrontendKind = '';
|
|
275
277
|
let dbType = '';
|
|
276
278
|
let curVarCounter = 0;
|
|
@@ -363,10 +365,15 @@ function createErrorDiagnoser(context) {
|
|
|
363
365
|
aggregatedContext[arrayField] = values;
|
|
364
366
|
}
|
|
365
367
|
}
|
|
366
|
-
|
|
368
|
+
const newDetail = {
|
|
367
369
|
...diagnostic,
|
|
368
370
|
...aggregatedContext,
|
|
369
371
|
};
|
|
372
|
+
// 若已有 error 级别,后续 warn 不能降级 severity
|
|
373
|
+
if (finalNode.tsErrorDetail?.severity === Severity.ERROR && newDetail.severity !== Severity.ERROR) {
|
|
374
|
+
return;
|
|
375
|
+
}
|
|
376
|
+
finalNode.tsErrorDetail = newDetail;
|
|
370
377
|
}
|
|
371
378
|
else {
|
|
372
379
|
finalNode.tsErrorDetail = diagnostic;
|
|
@@ -529,12 +536,13 @@ function createErrorDiagnoser(context) {
|
|
|
529
536
|
vusionValidator = new nasl_concepts_1.VusionValidator({}, {}, conceptValidator.rules, {}) || {};
|
|
530
537
|
validatorMap.set(validatorMapKey, vusionValidator);
|
|
531
538
|
}
|
|
539
|
+
const nodeTitle = (0, nasl_concepts_1.getConceptConstructor)(concept).nodeTitle;
|
|
532
540
|
const res = vusionValidator.validateSync(toBeVerifiedName, [], {
|
|
533
|
-
label:
|
|
541
|
+
label: nodeTitle,
|
|
534
542
|
alwaysResolve: true,
|
|
535
543
|
});
|
|
536
544
|
if (res) {
|
|
537
|
-
error(node,
|
|
545
|
+
error(node, `${nodeTitle}【${toBeVerifiedName}】命名非法:${res}`, {
|
|
538
546
|
checkRule: 'no-invalid-names',
|
|
539
547
|
});
|
|
540
548
|
}
|
|
@@ -778,7 +786,7 @@ function createErrorDiagnoser(context) {
|
|
|
778
786
|
if (!info)
|
|
779
787
|
return;
|
|
780
788
|
const { ctx, afterItemPath, currentName } = info;
|
|
781
|
-
if (!afterItemPath)
|
|
789
|
+
if (!afterItemPath || currentFrameworkKind !== 'vue3')
|
|
782
790
|
return;
|
|
783
791
|
error(errorNode, `组件列表 ${ctx.node.name || ctx.node.tag} 内部存在对数据源数据 ${currentName}.item.${afterItemPath} 的修改,请切换成表单模式,并且需要将“数据源”属性切换为使用“表单数据”属性`);
|
|
784
792
|
}
|
|
@@ -3570,7 +3578,15 @@ function createErrorDiagnoser(context) {
|
|
|
3570
3578
|
* @param node
|
|
3571
3579
|
*/
|
|
3572
3580
|
function* checkCallConnector(node) {
|
|
3573
|
-
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
|
+
}
|
|
3574
3590
|
return env.getType(node);
|
|
3575
3591
|
}
|
|
3576
3592
|
/**
|
|
@@ -5256,6 +5272,7 @@ function createErrorDiagnoser(context) {
|
|
|
5256
5272
|
inAuthLogic = false;
|
|
5257
5273
|
const frontendType = node.getAncestor?.('FrontendType');
|
|
5258
5274
|
inFrontendType = !!frontendType;
|
|
5275
|
+
currentFrameworkKind = frontendType?.frameworkKind || 'vue2';
|
|
5259
5276
|
currentFrontendKind = frontendType?.kind || '';
|
|
5260
5277
|
fileNodes.push(node);
|
|
5261
5278
|
let diagnostics = diagnosticMap.get(node);
|