@lcap/nasl-language-server-core 4.4.0-beta.20 → 4.4.0-beta.22
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 +17 -2
- package/out/checker.js.map +1 -1
- package/out/reference-manager/symbol-type.d.ts.map +1 -1
- package/out/reference-manager/symbol-type.js +1 -0
- package/out/reference-manager/symbol-type.js.map +1 -1
- package/out/typer/dispatch-stmt.d.ts.map +1 -1
- package/out/typer/dispatch-stmt.js +8 -6
- 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 +23 -8
- package/out/typer/dispatch-view.js.map +1 -1
- package/out/typer/incremental-update.d.ts +2 -2
- package/out/typer/incremental-update.d.ts.map +1 -1
- package/out/typer/incremental-update.js +74 -11
- package/out/typer/incremental-update.js.map +1 -1
- package/out/typer/subster.d.ts.map +1 -1
- package/out/typer/subster.js +37 -13
- package/out/typer/subster.js.map +1 -1
- package/out/typer/topo-sort.d.ts +37 -0
- package/out/typer/topo-sort.d.ts.map +1 -1
- package/out/typer/topo-sort.js +260 -1
- package/out/typer/topo-sort.js.map +1 -1
- package/out/typer/type-predicate.d.ts.map +1 -1
- package/out/typer/type-predicate.js +7 -1
- package/out/typer/type-predicate.js.map +1 -1
- package/out/typer/typer.d.ts +16 -1
- package/out/typer/typer.d.ts.map +1 -1
- package/out/typer/typer.js +31 -0
- package/out/typer/typer.js.map +1 -1
- package/out/typer/unifier.d.ts +2 -0
- package/out/typer/unifier.d.ts.map +1 -1
- package/out/typer/unifier.js +13 -7
- package/out/typer/unifier.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,E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AAG,KAAG,IAAI;;iBAuyFjD,MAAM;kBACL,MAAM;kBACN,MAAM;qBACH,MAAM;;kBAtsKF,UAAU,WAAW,MAAM,YAAY,YAAY;sCAq4D/B,IAAI,GAAG,QAAQ;2CAo2GxC,UAAU,gBACV,CAAC,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
|
@@ -255,6 +255,8 @@ function createErrorDiagnoser(context) {
|
|
|
255
255
|
let app = context.app;
|
|
256
256
|
let env = context.env;
|
|
257
257
|
let isDebug = context.debug;
|
|
258
|
+
// 严格模式
|
|
259
|
+
let isStrictMode = context.isStrictMode;
|
|
258
260
|
// 引用管理器
|
|
259
261
|
let referenceManager = env.refMgr;
|
|
260
262
|
// 检查共享数据是否有更新
|
|
@@ -314,6 +316,16 @@ function createErrorDiagnoser(context) {
|
|
|
314
316
|
diagnosticMap.set(curFileNode, diagnostics);
|
|
315
317
|
}
|
|
316
318
|
if (diagnostics) {
|
|
319
|
+
const parentKey = node?.parentKey;
|
|
320
|
+
const parentConcept = node.parentNode?.concept;
|
|
321
|
+
if (message.startsWith('类型不匹配:') &&
|
|
322
|
+
((parentKey === 'test' && parentConcept === 'IfStatement') || (parentKey === 'condition' && parentConcept === 'IfExpression'))) {
|
|
323
|
+
const map = {
|
|
324
|
+
'IfExpression': 'If表达式',
|
|
325
|
+
'IfStatement': 'If语句',
|
|
326
|
+
};
|
|
327
|
+
message = `${map[parentConcept]}条件槽位${message}`;
|
|
328
|
+
}
|
|
317
329
|
const diagnostic = {
|
|
318
330
|
message,
|
|
319
331
|
severity: inPlayground > 0 ? Severity.WARN : (severity ?? Severity.ERROR),
|
|
@@ -1485,7 +1497,7 @@ function createErrorDiagnoser(context) {
|
|
|
1485
1497
|
yield* checkNode(node);
|
|
1486
1498
|
});
|
|
1487
1499
|
}
|
|
1488
|
-
const dataSourceGroup = app.configuration?.getGroup('dataSource');
|
|
1500
|
+
const dataSourceGroup = app.configuration?.getGroup?.('dataSource');
|
|
1489
1501
|
if (dataSourceGroup) {
|
|
1490
1502
|
const property = dataSourceGroup.getProperty(node.name);
|
|
1491
1503
|
if (property.values?.length) {
|
|
@@ -1757,7 +1769,7 @@ function createErrorDiagnoser(context) {
|
|
|
1757
1769
|
const decimalPlaces = value?.split('.')[1]?.length || 0;
|
|
1758
1770
|
if (decimalPlaces > +scale) {
|
|
1759
1771
|
error(node, `实体字段${node.name}默认值的小数位数不能大于设置的小数位数${scale},否则将会按照小数位数自动截断`, {
|
|
1760
|
-
severity: Severity.WARN,
|
|
1772
|
+
severity: isStrictMode ? Severity.ERROR : Severity.WARN,
|
|
1761
1773
|
});
|
|
1762
1774
|
}
|
|
1763
1775
|
}
|
|
@@ -4659,6 +4671,9 @@ function createErrorDiagnoser(context) {
|
|
|
4659
4671
|
else if (!node.asName) {
|
|
4660
4672
|
error(node, '数据查询:聚合函数别名不能为空。');
|
|
4661
4673
|
}
|
|
4674
|
+
if (node.aggregateParam) {
|
|
4675
|
+
yield* checkNode(node.aggregateParam);
|
|
4676
|
+
}
|
|
4662
4677
|
}
|
|
4663
4678
|
/**
|
|
4664
4679
|
* 检查 SQL 查询
|