@lcap/nasl-language-server-core 4.3.0-beta.8 → 4.3.0-creator.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/out/checker.d.ts +1 -1
- package/out/checker.d.ts.map +1 -1
- package/out/checker.js +104 -33
- package/out/checker.js.map +1 -1
- package/out/reference-manager/reference-manager.d.ts.map +1 -1
- package/out/reference-manager/reference-manager.js +6 -2
- package/out/reference-manager/reference-manager.js.map +1 -1
- package/out/reference-manager/update-nasl-fragment.d.ts.map +1 -1
- package/out/reference-manager/update-nasl-fragment.js +2 -1
- package/out/reference-manager/update-nasl-fragment.js.map +1 -1
- package/out/semantic-rules/index.d.ts +5 -0
- package/out/semantic-rules/index.d.ts.map +1 -0
- package/out/semantic-rules/index.js +8 -0
- package/out/semantic-rules/index.js.map +1 -0
- package/out/semantic-rules/reject-file-types.d.ts +7 -0
- package/out/semantic-rules/reject-file-types.d.ts.map +1 -0
- package/out/semantic-rules/reject-file-types.js +228 -0
- package/out/semantic-rules/reject-file-types.js.map +1 -0
- package/out/typer/dispatch-all.d.ts.map +1 -1
- package/out/typer/dispatch-all.js.map +1 -1
- package/out/typer/dispatch-call.d.ts.map +1 -1
- package/out/typer/dispatch-call.js +27 -54
- 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 +37 -19
- package/out/typer/dispatch-expr.js.map +1 -1
- package/out/typer/dispatch-view.d.ts.map +1 -1
- package/out/typer/dispatch-view.js +17 -10
- 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 +8 -1
- package/out/typer/incremental-update.js.map +1 -1
- package/out/typer/oql-checker/chain-call-transformer.d.ts +2 -0
- package/out/typer/oql-checker/chain-call-transformer.d.ts.map +1 -1
- package/out/typer/oql-checker/chain-call-transformer.js +157 -13
- package/out/typer/oql-checker/chain-call-transformer.js.map +1 -1
- package/out/typer/oql-checker/ts-parser.d.ts.map +1 -1
- package/out/typer/oql-checker/ts-parser.js +76 -42
- package/out/typer/oql-checker/ts-parser.js.map +1 -1
- package/out/typer/overload-helper.d.ts.map +1 -1
- package/out/typer/overload-helper.js +0 -13
- package/out/typer/overload-helper.js.map +1 -1
- package/out/typer/subster.d.ts.map +1 -1
- package/out/typer/subster.js +6 -4
- package/out/typer/subster.js.map +1 -1
- package/out/typer/type-manager.d.ts +2 -0
- package/out/typer/type-manager.d.ts.map +1 -1
- package/out/typer/type-manager.js +12 -2
- package/out/typer/type-manager.js.map +1 -1
- package/out/typer/type-predicate.d.ts.map +1 -1
- package/out/typer/type-predicate.js +41 -10
- package/out/typer/type-predicate.js.map +1 -1
- package/out/typer/unifier.js +3 -0
- package/out/typer/unifier.js.map +1 -1
- package/out/utils/parseTsClassType.d.ts.map +1 -1
- package/out/utils/parseTsClassType.js +19 -0
- package/out/utils/parseTsClassType.js.map +1 -1
- package/out/utils/type-operator.d.ts.map +1 -1
- package/out/utils/type-operator.js +11 -21
- package/out/utils/type-operator.js.map +1 -1
- package/package.json +7 -7
package/out/checker.d.ts
CHANGED
|
@@ -42,7 +42,7 @@ export declare function createErrorDiagnoser(context: DiagnoseContext): {
|
|
|
42
42
|
clearDiagnostics: (node?: SyntaxNode) => void;
|
|
43
43
|
getDiagnostics: (node: SyntaxNode) => NodeDiagnosticsMap | undefined;
|
|
44
44
|
getAllDiagnostics: () => FileDiagnosticsMap;
|
|
45
|
-
getDebugDiagnostics: () => {
|
|
45
|
+
getDebugDiagnostics: (normalize?: boolean) => {
|
|
46
46
|
message: string;
|
|
47
47
|
severity: string;
|
|
48
48
|
nodePath: string;
|
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,EAU2G,GAAG,EAMxH,QAAQ,
|
|
1
|
+
{"version":3,"file":"checker.d.ts","sourceRoot":"","sources":["../src/checker.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,UAAU,EAU2G,GAAG,EAMxH,QAAQ,EAET,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;AAOpE,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;AAMF,MAAM,MAAM,kBAAkB,GAAG,GAAG,CAAC,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;AAEpE,MAAM,MAAM,kBAAkB,GAAG,GAAG,CAAC,UAAU,EAAE,kBAAkB,CAAC,CAAC;AAMrE,KAAK,gBAAgB,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAqBF,KAAK,eAAe,GAAG;IACrB,GAAG,EAAE,GAAG,CAAC;IACT,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,OAAO,CAAC;IACf,yBAAyB,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC/C,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,CAAC;AA4OF;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,eAAe;oCA0yIpB,OAAO;sDAPW,gBAAgB,EAAE;;;;sBAhBjD,UAAU,GAAG,SAAS;;;8BA4Df,UAAU;2BAuBb,UAAU;;;iBAW3B,MAAM;kBACL,MAAM;kBACN,MAAM;qBACH,MAAM;;kBA3zIF,UAAU,WAAW,MAAM,YAAY,YAAY;EA81IzE;AAGD,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
|
@@ -10,8 +10,10 @@ const sem_diag_1 = require("./typer/sem-diag");
|
|
|
10
10
|
const type_predicate_1 = require("./typer/type-predicate");
|
|
11
11
|
const type_manager_1 = require("./typer/type-manager");
|
|
12
12
|
const service_2 = require("@lcap/nasl-concepts/service");
|
|
13
|
+
const asserts_1 = require("@lcap/nasl-concepts/asserts");
|
|
13
14
|
const lodash_1 = require("lodash");
|
|
14
15
|
const helper_1 = require("./typer/helper");
|
|
16
|
+
const semantic_rules_1 = require("./semantic-rules");
|
|
15
17
|
var Severity;
|
|
16
18
|
(function (Severity) {
|
|
17
19
|
Severity["WARN"] = "warning";
|
|
@@ -261,13 +263,14 @@ function createErrorDiagnoser(context) {
|
|
|
261
263
|
const nodeNameCache = new Map();
|
|
262
264
|
const nodeNameGetterMap = {
|
|
263
265
|
View: 'getViewExistingNames',
|
|
266
|
+
BusinessComponent: 'getBusinessComponentExistingNames',
|
|
264
267
|
Logic: 'getLogicExistingNames',
|
|
265
268
|
AuthLogic: 'getAuthLogicExistingNames',
|
|
266
269
|
AuthLogicForCallInterface: 'getAuthLogicForCallInterfaceExistingNames',
|
|
267
270
|
Param: 'getVarExistingNames',
|
|
268
271
|
Return: 'getVarExistingNames',
|
|
269
272
|
Variable: 'getVarExistingNames',
|
|
270
|
-
Enum: '
|
|
273
|
+
Enum: 'getEnumExistingNames',
|
|
271
274
|
EnumItem: 'getEnumItemExistingNames',
|
|
272
275
|
EnumItemInteger: 'getEnumItemExistingNames',
|
|
273
276
|
DataSource: 'getDataSourceExistingNames',
|
|
@@ -2500,6 +2503,7 @@ function createErrorDiagnoser(context) {
|
|
|
2500
2503
|
function* checkLogic(node) {
|
|
2501
2504
|
env.enterScope(node);
|
|
2502
2505
|
checkVariableAndReturnTypeAnnotations(node.variables ?? [], node.returns ?? []);
|
|
2506
|
+
yield* semantic_rules_1.ExtraSemanticRules.rejectFileTypes(node, env, error);
|
|
2503
2507
|
const module = node.getAncestor('Module');
|
|
2504
2508
|
if (!(module?.parentKey === 'dependencies')) {
|
|
2505
2509
|
if (node.params?.length) {
|
|
@@ -2703,36 +2707,59 @@ function createErrorDiagnoser(context) {
|
|
|
2703
2707
|
const ancestorSubLogic = node.getAncestor('SubLogic');
|
|
2704
2708
|
const shouldReportAsyncAsError = !(ancestorSubLogic && ancestorSubLogic !== node) && (0, type_predicate_1.isSyncFuncTy)(ty);
|
|
2705
2709
|
const subLogicNode = node;
|
|
2710
|
+
function isAsyncNode(node) {
|
|
2711
|
+
switch (node.concept) {
|
|
2712
|
+
case 'CallLogic': {
|
|
2713
|
+
if (!node.calleeName) {
|
|
2714
|
+
return false;
|
|
2715
|
+
}
|
|
2716
|
+
else {
|
|
2717
|
+
const syncMap = {
|
|
2718
|
+
jsonSerialize: 'nasl.util',
|
|
2719
|
+
jsonDeserialize: 'nasl.util',
|
|
2720
|
+
INFO: 'nasl.logging',
|
|
2721
|
+
WARN: 'nasl.logging',
|
|
2722
|
+
ERROR: 'nasl.logging',
|
|
2723
|
+
DEBUG: 'nasl.logging',
|
|
2724
|
+
showMessage: 'nasl.ui',
|
|
2725
|
+
};
|
|
2726
|
+
if (syncMap[node.calleeName] === node.calleeNamespace) {
|
|
2727
|
+
return false;
|
|
2728
|
+
}
|
|
2729
|
+
}
|
|
2730
|
+
const callee = context.env.resolveRef(node);
|
|
2731
|
+
if (callee) {
|
|
2732
|
+
const funTy = context.env.getType(callee);
|
|
2733
|
+
if (funTy) {
|
|
2734
|
+
return (0, type_predicate_1.isAsyncFuncTy)(funTy);
|
|
2735
|
+
}
|
|
2736
|
+
}
|
|
2737
|
+
return false;
|
|
2738
|
+
}
|
|
2739
|
+
case 'CallFunction': {
|
|
2740
|
+
if (!node.calleeName) {
|
|
2741
|
+
return false;
|
|
2742
|
+
}
|
|
2743
|
+
// fallthrough
|
|
2744
|
+
}
|
|
2745
|
+
case 'Unparsed':
|
|
2746
|
+
case 'CallConnector':
|
|
2747
|
+
case 'JSBlock':
|
|
2748
|
+
case 'CallInterface': {
|
|
2749
|
+
return true;
|
|
2750
|
+
}
|
|
2751
|
+
default: {
|
|
2752
|
+
return false;
|
|
2753
|
+
}
|
|
2754
|
+
}
|
|
2755
|
+
}
|
|
2706
2756
|
function checkAsync(current, subLogicNode) {
|
|
2707
2757
|
if (shouldReportAsyncAsError) {
|
|
2708
2758
|
current.traverseStrictChildren((n) => {
|
|
2709
2759
|
if (!n)
|
|
2710
2760
|
return;
|
|
2711
2761
|
if (isAsyncNode(n)) {
|
|
2712
|
-
error(n, `同步执行的子逻辑 ${subLogicNode.name}
|
|
2713
|
-
}
|
|
2714
|
-
function isAsyncNode(node) {
|
|
2715
|
-
switch (node.concept) {
|
|
2716
|
-
case 'CallLogic': {
|
|
2717
|
-
const callee = context.env.resolveRef(node);
|
|
2718
|
-
if (callee) {
|
|
2719
|
-
const funTy = context.env.getType(callee);
|
|
2720
|
-
if (funTy) {
|
|
2721
|
-
return (0, type_predicate_1.isAsyncFuncTy)(funTy);
|
|
2722
|
-
}
|
|
2723
|
-
}
|
|
2724
|
-
}
|
|
2725
|
-
case 'Unparsed':
|
|
2726
|
-
case 'CallConnector':
|
|
2727
|
-
case 'CallFunction':
|
|
2728
|
-
case 'JSBlock':
|
|
2729
|
-
case 'CallInterface': {
|
|
2730
|
-
return true;
|
|
2731
|
-
}
|
|
2732
|
-
default: {
|
|
2733
|
-
return false;
|
|
2734
|
-
}
|
|
2735
|
-
}
|
|
2762
|
+
error(n, `同步执行的子逻辑 ${subLogicNode.name} 中不支持使用该${formatNodeConcept(n)}`);
|
|
2736
2763
|
}
|
|
2737
2764
|
});
|
|
2738
2765
|
}
|
|
@@ -2858,6 +2885,7 @@ function createErrorDiagnoser(context) {
|
|
|
2858
2885
|
if (node.calleeName === 'ListSort' || node.calleeName === 'ListSortAsync') {
|
|
2859
2886
|
checkListSort(node);
|
|
2860
2887
|
}
|
|
2888
|
+
yield* semantic_rules_1.ExtraSemanticRules.rejectFileTypes(node, env, error);
|
|
2861
2889
|
if (node.typeArguments?.length) {
|
|
2862
2890
|
yield* (0, nasl_utils_1.wrapForEachToGenerator)(node.typeArguments, function* (node) {
|
|
2863
2891
|
yield* checkNode(node);
|
|
@@ -2927,13 +2955,13 @@ function createErrorDiagnoser(context) {
|
|
|
2927
2955
|
// HACK 取这个字段会修复 arguments 中 keyword 为空的问题
|
|
2928
2956
|
// 参考:流程回退接口报错500 http://projectmanage.netease-official.lcap.163yun.com/dashboard/BugDetail?id=3127862102823424
|
|
2929
2957
|
node.completeArguments;
|
|
2958
|
+
yield* semantic_rules_1.ExtraSemanticRules.rejectFileTypes(node, env, error);
|
|
2930
2959
|
if (inAuthLogic && node.calleeNamespace?.startsWith?.('app.logics')) {
|
|
2931
2960
|
const authLogic = node.getAncestor('AuthLogic');
|
|
2932
2961
|
error(authLogic, `鉴权逻辑 ${authLogic.name} 不允许调用 服务端逻辑`);
|
|
2933
2962
|
}
|
|
2934
2963
|
const viewElement = node.getAncestor('ViewElement');
|
|
2935
2964
|
if (viewElement && viewElement.tag === 'u-download' && node.parentNode.name === 'dataSource') {
|
|
2936
|
-
// node.Pa
|
|
2937
2965
|
const args = ['page', 'size'];
|
|
2938
2966
|
const values = [];
|
|
2939
2967
|
node.arguments && node.arguments.forEach((arg) => {
|
|
@@ -3408,9 +3436,16 @@ function createErrorDiagnoser(context) {
|
|
|
3408
3436
|
if (node.typeAnnotation?.typeKind === 'primitive' && node.typeAnnotation?.typeName === 'Long') {
|
|
3409
3437
|
const MIN_LONG = -9223372036854775808n;
|
|
3410
3438
|
const MAX_LONG = 9223372036854775807n;
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3439
|
+
try {
|
|
3440
|
+
// AI完全可以构造出node.value="2.2"而ty显式指定为Long的东西,让BigInt报错。
|
|
3441
|
+
// 因此需要try catch
|
|
3442
|
+
const value = BigInt(node.value);
|
|
3443
|
+
if (value < MIN_LONG || value > MAX_LONG) {
|
|
3444
|
+
error(node, `整数数值超出合法范围,最小值:${MIN_LONG},最大值:${MAX_LONG}。`);
|
|
3445
|
+
}
|
|
3446
|
+
}
|
|
3447
|
+
catch (error) {
|
|
3448
|
+
console.error(error);
|
|
3414
3449
|
}
|
|
3415
3450
|
}
|
|
3416
3451
|
return env.getType(node);
|
|
@@ -3430,6 +3465,7 @@ function createErrorDiagnoser(context) {
|
|
|
3430
3465
|
* @param node
|
|
3431
3466
|
*/
|
|
3432
3467
|
function* checkStringInterpolation(node) {
|
|
3468
|
+
yield* semantic_rules_1.ExtraSemanticRules.rejectFileTypes(node, env, error);
|
|
3433
3469
|
if (node.expressions?.length) {
|
|
3434
3470
|
yield* (0, nasl_utils_1.wrapForEachToGenerator)(node.expressions, function* (node) {
|
|
3435
3471
|
yield* checkNode(node);
|
|
@@ -3463,6 +3499,7 @@ function createErrorDiagnoser(context) {
|
|
|
3463
3499
|
* @param node
|
|
3464
3500
|
*/
|
|
3465
3501
|
function* checkNewList(node) {
|
|
3502
|
+
yield* semantic_rules_1.ExtraSemanticRules.rejectFileTypes(node, env, error);
|
|
3466
3503
|
// 匿名函数返回值有可能是newList,需要过滤。代码来源:AnonymousFunction.__ts
|
|
3467
3504
|
const grandParent = node.parentNode?.parentNode?.parentNode;
|
|
3468
3505
|
if (isEntityUpdate(grandParent)) {
|
|
@@ -3482,13 +3519,33 @@ function createErrorDiagnoser(context) {
|
|
|
3482
3519
|
});
|
|
3483
3520
|
}
|
|
3484
3521
|
}
|
|
3485
|
-
|
|
3522
|
+
const ty = env.getType(node);
|
|
3523
|
+
function isConcreteTy(ty) {
|
|
3524
|
+
if (ty.typeKind === 'generic') {
|
|
3525
|
+
return !!ty.typeArguments?.every(x => isConcreteTy(x));
|
|
3526
|
+
}
|
|
3527
|
+
else if (ty.typeKind === 'primitive') {
|
|
3528
|
+
return ty !== type_manager_1.naslAnyTy;
|
|
3529
|
+
}
|
|
3530
|
+
return true;
|
|
3531
|
+
}
|
|
3532
|
+
if (!ty || !isConcreteTy(ty)) {
|
|
3533
|
+
const p = node.parentNode;
|
|
3534
|
+
if (p && p.name === 'dataSourceWatch' && (0, asserts_1.isBindAttribute)(p)) {
|
|
3535
|
+
// 🐮
|
|
3536
|
+
}
|
|
3537
|
+
else {
|
|
3538
|
+
error(node, `NewList 无法推导类型,请添加手动类型标注或添加元素`);
|
|
3539
|
+
}
|
|
3540
|
+
}
|
|
3541
|
+
return ty;
|
|
3486
3542
|
}
|
|
3487
3543
|
/**
|
|
3488
3544
|
* 检查 Map 构造器
|
|
3489
3545
|
* @param node
|
|
3490
3546
|
*/
|
|
3491
3547
|
function* checkNewMap(node) {
|
|
3548
|
+
yield* semantic_rules_1.ExtraSemanticRules.rejectFileTypes(node, env, error);
|
|
3492
3549
|
if (node.keys?.length) {
|
|
3493
3550
|
yield* (0, nasl_utils_1.wrapForEachToGenerator)(node.keys, function* (node) {
|
|
3494
3551
|
yield* checkNode(node);
|
|
@@ -3520,6 +3577,7 @@ function createErrorDiagnoser(context) {
|
|
|
3520
3577
|
* @param node
|
|
3521
3578
|
*/
|
|
3522
3579
|
function* checkNewComposite(node) {
|
|
3580
|
+
yield* semantic_rules_1.ExtraSemanticRules.rejectFileTypes(node, env, error);
|
|
3523
3581
|
const type = env.getType(node);
|
|
3524
3582
|
if (node.properties?.length) {
|
|
3525
3583
|
yield* (0, nasl_utils_1.wrapForEachToGenerator)(node.properties, function* (property, index) {
|
|
@@ -3555,6 +3613,9 @@ function createErrorDiagnoser(context) {
|
|
|
3555
3613
|
}
|
|
3556
3614
|
return type;
|
|
3557
3615
|
}
|
|
3616
|
+
function checkNewRegex(node) {
|
|
3617
|
+
return env.getType(node);
|
|
3618
|
+
}
|
|
3558
3619
|
/**
|
|
3559
3620
|
* 检查 赋值语句
|
|
3560
3621
|
* @param node
|
|
@@ -3856,6 +3917,12 @@ function createErrorDiagnoser(context) {
|
|
|
3856
3917
|
env.addDiagnosticsFor(e.message, node);
|
|
3857
3918
|
});
|
|
3858
3919
|
}
|
|
3920
|
+
else {
|
|
3921
|
+
// 无错误时,需要手动根据 codeSourceMap oqlSyntaxError 报错
|
|
3922
|
+
if (node.codeSourceMap?.oqlSyntaxError) {
|
|
3923
|
+
error(node, `SQL查询:语句可能有异常。`);
|
|
3924
|
+
}
|
|
3925
|
+
}
|
|
3859
3926
|
return env.getType(node);
|
|
3860
3927
|
}
|
|
3861
3928
|
/**
|
|
@@ -3884,6 +3951,7 @@ function createErrorDiagnoser(context) {
|
|
|
3884
3951
|
* @param node
|
|
3885
3952
|
*/
|
|
3886
3953
|
function* checkBinaryExpression(node) {
|
|
3954
|
+
yield* semantic_rules_1.ExtraSemanticRules.rejectFileTypes(node, env, error);
|
|
3887
3955
|
if (ensureNodeKeyExists(node, 'left')) {
|
|
3888
3956
|
yield* checkNode(node.left);
|
|
3889
3957
|
}
|
|
@@ -4267,6 +4335,8 @@ function createErrorDiagnoser(context) {
|
|
|
4267
4335
|
return yield* checkNewMap(node);
|
|
4268
4336
|
case 'NewComposite':
|
|
4269
4337
|
return yield* checkNewComposite(node);
|
|
4338
|
+
case 'NewRegex':
|
|
4339
|
+
return checkNewRegex(node);
|
|
4270
4340
|
case 'Assignment':
|
|
4271
4341
|
return yield* checkAssignment(node);
|
|
4272
4342
|
case 'BatchAssignment':
|
|
@@ -4447,7 +4517,7 @@ function createErrorDiagnoser(context) {
|
|
|
4447
4517
|
function getAllDiagnostics() {
|
|
4448
4518
|
return diagnosticMap;
|
|
4449
4519
|
}
|
|
4450
|
-
function getDebugDiagnostics() {
|
|
4520
|
+
function getDebugDiagnostics(normalize = false) {
|
|
4451
4521
|
const diagMap = getAllDiagnostics();
|
|
4452
4522
|
const flattenedDiags = [];
|
|
4453
4523
|
diagMap.forEach((item) => {
|
|
@@ -4456,11 +4526,12 @@ function createErrorDiagnoser(context) {
|
|
|
4456
4526
|
if (!x.message || !x.severity) {
|
|
4457
4527
|
return [];
|
|
4458
4528
|
}
|
|
4529
|
+
const msg = normalize ? (0, lodash_1.sortBy)(x.message).join('') : x.message;
|
|
4459
4530
|
return [{
|
|
4460
|
-
message:
|
|
4531
|
+
message: msg,
|
|
4461
4532
|
severity: x.severity,
|
|
4462
4533
|
nodePath: node.nodePath,
|
|
4463
|
-
nodeConcept: node.concept
|
|
4534
|
+
nodeConcept: node.concept
|
|
4464
4535
|
}];
|
|
4465
4536
|
});
|
|
4466
4537
|
})));
|