@lcap/nasl-concepts 3.13.0-alpha.microapp-1 → 3.13.0-beta.10
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/common/BaseNode.d.ts +3 -3
- package/out/common/BaseNode.d.ts.map +1 -1
- package/out/common/BaseNode.js +11 -7
- package/out/common/BaseNode.js.map +1 -1
- package/out/concepts/Abort__.js +1 -1
- package/out/concepts/Abort__.js.map +1 -1
- package/out/concepts/App__.d.ts +83 -0
- package/out/concepts/App__.d.ts.map +1 -1
- package/out/concepts/App__.js +106 -2
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/AuthLogicForCallInterface__.js +1 -1
- package/out/concepts/AuthLogicForCallInterface__.js.map +1 -1
- package/out/concepts/BackendVariable__.js +2 -2
- package/out/concepts/BackendVariable__.js.map +1 -1
- package/out/concepts/Backend__.js +1 -1
- package/out/concepts/Backend__.js.map +1 -1
- package/out/concepts/BatchAssignment__.d.ts +25 -2
- package/out/concepts/BatchAssignment__.d.ts.map +1 -1
- package/out/concepts/BatchAssignment__.js +436 -69
- package/out/concepts/BatchAssignment__.js.map +1 -1
- package/out/concepts/BindAttribute__.d.ts.map +1 -1
- package/out/concepts/BindAttribute__.js +9 -2
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.d.ts.map +1 -1
- package/out/concepts/BindDirective__.js +7 -1
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.js +1 -1
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/Break__.d.ts +33 -0
- package/out/concepts/Break__.d.ts.map +1 -0
- package/out/concepts/Break__.js +120 -0
- package/out/concepts/Break__.js.map +1 -0
- package/out/concepts/BusinessComponent__.d.ts.map +1 -1
- package/out/concepts/BusinessComponent__.js +3 -2
- package/out/concepts/BusinessComponent__.js.map +1 -1
- package/out/concepts/CallLogic__.d.ts +1 -0
- package/out/concepts/CallLogic__.d.ts.map +1 -1
- package/out/concepts/CallLogic__.js +16 -3
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.d.ts +14 -5
- package/out/concepts/CallQueryComponent__.d.ts.map +1 -1
- package/out/concepts/CallQueryComponent__.js +90 -56
- package/out/concepts/CallQueryComponent__.js.map +1 -1
- package/out/concepts/CompletionProperty__.d.ts.map +1 -1
- package/out/concepts/CompletionProperty__.js +7 -0
- package/out/concepts/CompletionProperty__.js.map +1 -1
- package/out/concepts/ConfigProperty__.js +2 -2
- package/out/concepts/ConfigProperty__.js.map +1 -1
- package/out/concepts/Connection__.js +2 -2
- package/out/concepts/Connection__.js.map +1 -1
- package/out/concepts/ConnectorTrigger__.js +1 -1
- package/out/concepts/ConnectorTrigger__.js.map +1 -1
- package/out/concepts/Continue__.d.ts +33 -0
- package/out/concepts/Continue__.d.ts.map +1 -0
- package/out/concepts/Continue__.js +120 -0
- package/out/concepts/Continue__.js.map +1 -0
- package/out/concepts/DataSource__.d.ts +12 -1
- package/out/concepts/DataSource__.d.ts.map +1 -1
- package/out/concepts/DataSource__.js +58 -5
- package/out/concepts/DataSource__.js.map +1 -1
- package/out/concepts/DefaultValue__.d.ts +1 -0
- package/out/concepts/DefaultValue__.d.ts.map +1 -1
- package/out/concepts/DefaultValue__.js +9 -0
- package/out/concepts/DefaultValue__.js.map +1 -1
- package/out/concepts/Dependency__.js +1 -1
- package/out/concepts/Dependency__.js.map +1 -1
- package/out/concepts/Destination__.js +1 -1
- package/out/concepts/End__.d.ts.map +1 -1
- package/out/concepts/End__.js +34 -2
- package/out/concepts/End__.js.map +1 -1
- package/out/concepts/Entity__.d.ts +13 -0
- package/out/concepts/Entity__.d.ts.map +1 -1
- package/out/concepts/Entity__.js +49 -9
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/Enum__.js +2 -2
- package/out/concepts/Enum__.js.map +1 -1
- package/out/concepts/ExternalDestination__.js +1 -1
- package/out/concepts/ForEachStatement__.d.ts.map +1 -1
- package/out/concepts/ForEachStatement__.js +10 -8
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/FrontendType__.js +1 -1
- package/out/concepts/FrontendType__.js.map +1 -1
- package/out/concepts/Frontend__.d.ts +0 -3
- package/out/concepts/Frontend__.d.ts.map +1 -1
- package/out/concepts/Frontend__.js +1 -25
- package/out/concepts/Frontend__.js.map +1 -1
- package/out/concepts/InterfaceParam__.d.ts +1 -0
- package/out/concepts/InterfaceParam__.d.ts.map +1 -1
- package/out/concepts/InterfaceParam__.js +35 -0
- package/out/concepts/InterfaceParam__.js.map +1 -1
- package/out/concepts/Interface__.d.ts +1 -0
- package/out/concepts/Interface__.d.ts.map +1 -1
- package/out/concepts/Interface__.js +45 -2
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/JSBlock__.d.ts.map +1 -1
- package/out/concepts/JSBlock__.js +1 -3
- package/out/concepts/JSBlock__.js.map +1 -1
- package/out/concepts/LogicItem__.d.ts +1 -1
- package/out/concepts/LogicItem__.d.ts.map +1 -1
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.d.ts +12 -1
- package/out/concepts/Logic__.d.ts.map +1 -1
- package/out/concepts/Logic__.js +56 -21
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MemberExpression__.d.ts +4 -0
- package/out/concepts/MemberExpression__.d.ts.map +1 -1
- package/out/concepts/MemberExpression__.js +16 -0
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/MetadataType__.js +2 -2
- package/out/concepts/MetadataType__.js.map +1 -1
- package/out/concepts/Module__.d.ts +7 -1
- package/out/concepts/Module__.d.ts.map +1 -1
- package/out/concepts/Module__.js +40 -2
- package/out/concepts/Module__.js.map +1 -1
- package/out/concepts/Namespace__.js +1 -1
- package/out/concepts/Namespace__.js.map +1 -1
- package/out/concepts/NewComposite__.d.ts +35 -3
- package/out/concepts/NewComposite__.d.ts.map +1 -1
- package/out/concepts/NewComposite__.js +465 -67
- package/out/concepts/NewComposite__.js.map +1 -1
- package/out/concepts/OperatePermissionV2__.d.ts +9 -1
- package/out/concepts/OperatePermissionV2__.d.ts.map +1 -1
- package/out/concepts/OperatePermissionV2__.js +24 -3
- package/out/concepts/OperatePermissionV2__.js.map +1 -1
- package/out/concepts/OqlQueryComponent__.d.ts +2 -0
- package/out/concepts/OqlQueryComponent__.d.ts.map +1 -1
- package/out/concepts/OqlQueryComponent__.js +10 -0
- package/out/concepts/OqlQueryComponent__.js.map +1 -1
- package/out/concepts/OverriddenLogic__.d.ts.map +1 -1
- package/out/concepts/OverriddenLogic__.js +2 -1
- package/out/concepts/OverriddenLogic__.js.map +1 -1
- package/out/concepts/Param__.d.ts +1 -0
- package/out/concepts/Param__.d.ts.map +1 -1
- package/out/concepts/Param__.js +38 -2
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/PermissionForSharedScope__.d.ts +34 -0
- package/out/concepts/PermissionForSharedScope__.d.ts.map +1 -0
- package/out/concepts/PermissionForSharedScope__.js +73 -0
- package/out/concepts/PermissionForSharedScope__.js.map +1 -0
- package/out/concepts/ProcessElementV2__.d.ts +4 -0
- package/out/concepts/ProcessElementV2__.d.ts.map +1 -1
- package/out/concepts/ProcessElementV2__.js +75 -10
- package/out/concepts/ProcessElementV2__.js.map +1 -1
- package/out/concepts/ProcessElement__.js +1 -1
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/ProcessV2__.d.ts.map +1 -1
- package/out/concepts/ProcessV2__.js +1 -8
- package/out/concepts/ProcessV2__.js.map +1 -1
- package/out/concepts/Process__.js +1 -1
- package/out/concepts/Process__.js.map +1 -1
- package/out/concepts/QueryFieldExpression__.d.ts +5 -0
- package/out/concepts/QueryFieldExpression__.d.ts.map +1 -1
- package/out/concepts/QueryFieldExpression__.js +15 -4
- package/out/concepts/QueryFieldExpression__.js.map +1 -1
- package/out/concepts/QueryFromExpression__.d.ts +1 -0
- package/out/concepts/QueryFromExpression__.d.ts.map +1 -1
- package/out/concepts/QueryFromExpression__.js +3 -0
- package/out/concepts/QueryFromExpression__.js.map +1 -1
- package/out/concepts/QueryJoinExpression__.d.ts +1 -0
- package/out/concepts/QueryJoinExpression__.d.ts.map +1 -1
- package/out/concepts/QueryJoinExpression__.js +3 -0
- package/out/concepts/QueryJoinExpression__.js.map +1 -1
- package/out/concepts/Return__.d.ts +1 -0
- package/out/concepts/Return__.d.ts.map +1 -1
- package/out/concepts/Return__.js +39 -2
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/Role__.js +1 -1
- package/out/concepts/Role__.js.map +1 -1
- package/out/concepts/SelectMembers__.d.ts +5 -0
- package/out/concepts/SelectMembers__.d.ts.map +1 -1
- package/out/concepts/SelectMembers__.js +66 -0
- package/out/concepts/SelectMembers__.js.map +1 -1
- package/out/concepts/SharedScope__.d.ts +38 -0
- package/out/concepts/SharedScope__.d.ts.map +1 -0
- package/out/concepts/SharedScope__.js +79 -0
- package/out/concepts/SharedScope__.js.map +1 -0
- package/out/concepts/StructureProperty__.d.ts +1 -0
- package/out/concepts/StructureProperty__.d.ts.map +1 -1
- package/out/concepts/StructureProperty__.js +37 -0
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/Structure__.d.ts +1 -1
- package/out/concepts/Structure__.d.ts.map +1 -1
- package/out/concepts/Structure__.js +23 -30
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/SubLogic__.d.ts +3 -1
- package/out/concepts/SubLogic__.d.ts.map +1 -1
- package/out/concepts/SubLogic__.js +127 -2
- package/out/concepts/SubLogic__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.d.ts +21 -0
- package/out/concepts/TypeAnnotation__.d.ts.map +1 -1
- package/out/concepts/TypeAnnotation__.js +82 -0
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/TypeParam__.d.ts +1 -0
- package/out/concepts/TypeParam__.d.ts.map +1 -1
- package/out/concepts/TypeParam__.js +32 -0
- package/out/concepts/TypeParam__.js.map +1 -1
- package/out/concepts/Variable__.js +1 -1
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewElement__.d.ts.map +1 -1
- package/out/concepts/ViewElement__.js +29 -1
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.d.ts.map +1 -1
- package/out/concepts/View__.js +5 -2
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.processV2.d.ts.map +1 -1
- package/out/concepts/basics/stdlib/nasl.processV2.js +279 -129
- package/out/concepts/basics/stdlib/nasl.processV2.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.util.d.ts.map +1 -1
- package/out/concepts/basics/stdlib/nasl.util.js +238 -0
- package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
- package/out/concepts/index__.d.ts +2 -0
- package/out/concepts/index__.d.ts.map +1 -1
- package/out/concepts/index__.js +2 -0
- package/out/concepts/index__.js.map +1 -1
- package/out/concepts/utils/asserts.d.ts +204 -0
- package/out/concepts/utils/asserts.d.ts.map +1 -1
- package/out/concepts/utils/asserts.js +286 -15
- package/out/concepts/utils/asserts.js.map +1 -1
- package/out/concepts/utils/types.d.ts +16 -2
- package/out/concepts/utils/types.d.ts.map +1 -1
- package/out/semantics/localVarCollector.d.ts +11 -0
- package/out/semantics/localVarCollector.d.ts.map +1 -0
- package/out/semantics/localVarCollector.js +41 -0
- package/out/semantics/localVarCollector.js.map +1 -0
- package/out/semantics/semanticData.d.ts +6 -5
- package/out/semantics/semanticData.d.ts.map +1 -1
- package/out/semantics/semanticData.js +69 -62
- package/out/semantics/semanticData.js.map +1 -1
- package/out/service/engine.d.ts.map +1 -1
- package/out/service/engine.js +4 -0
- package/out/service/engine.js.map +1 -1
- package/out/service/entity2LogicNamespace.d.ts.map +1 -1
- package/out/service/entity2LogicNamespace.js +20 -9
- package/out/service/entity2LogicNamespace.js.map +1 -1
- package/out/service/formatTsUtils.d.ts +1 -1
- package/out/service/formatTsUtils.d.ts.map +1 -1
- package/out/service/formatTsUtils.js +38 -25
- package/out/service/formatTsUtils.js.map +1 -1
- package/out/service/genSlotVarRef.d.ts +3 -0
- package/out/service/genSlotVarRef.d.ts.map +1 -0
- package/out/service/genSlotVarRef.js +154 -0
- package/out/service/genSlotVarRef.js.map +1 -0
- package/out/service/getExtensionModules.d.ts.map +1 -1
- package/out/service/getExtensionModules.js +12 -0
- package/out/service/getExtensionModules.js.map +1 -1
- package/out/service/getLogics.d.ts.map +1 -1
- package/out/service/getLogics.js +24 -26
- package/out/service/getLogics.js.map +1 -1
- package/out/service/getMemberIdentifier.d.ts.map +1 -1
- package/out/service/getMemberIdentifier.js +104 -255
- package/out/service/getMemberIdentifier.js.map +1 -1
- package/out/service/getProcesses.d.ts.map +1 -1
- package/out/service/getProcesses.js +31 -29
- package/out/service/getProcesses.js.map +1 -1
- package/out/service/getProcessesV2.js +1 -1
- package/out/service/getProcessesV2.js.map +1 -1
- package/out/utils/traverse.d.ts +14 -2
- package/out/utils/traverse.d.ts.map +1 -1
- package/out/utils/traverse.js +28 -10
- package/out/utils/traverse.js.map +1 -1
- package/package.json +5 -5
|
@@ -37,6 +37,13 @@ exports.NewComposite = void 0;
|
|
|
37
37
|
const utils_1 = require("../utils");
|
|
38
38
|
const nasl_translator_1 = require("@lcap/nasl-translator");
|
|
39
39
|
const quick_info_1 = require("./utils/quick-info");
|
|
40
|
+
var MatchingStrategies;
|
|
41
|
+
(function (MatchingStrategies) {
|
|
42
|
+
MatchingStrategies["BY_NAME"] = "BY_NAME";
|
|
43
|
+
MatchingStrategies["BY_TYPE"] = "BY_TYPE";
|
|
44
|
+
MatchingStrategies["BY_NAME_AND_TYPE"] = "BY_NAME_AND_TYPE";
|
|
45
|
+
MatchingStrategies["BY_TOP_DOWN"] = "BY_TOP_DOWN";
|
|
46
|
+
})(MatchingStrategies || (MatchingStrategies = {}));
|
|
40
47
|
const decorators_1 = require("../decorators");
|
|
41
48
|
const utils = __importStar(require("../utils"));
|
|
42
49
|
const asserts = __importStar(require("./utils/asserts"));
|
|
@@ -85,6 +92,8 @@ let NewComposite = class NewComposite extends LogicItem__1.default {
|
|
|
85
92
|
* 自动连线
|
|
86
93
|
*/
|
|
87
94
|
this.autoConnection = true;
|
|
95
|
+
// 匹配策略
|
|
96
|
+
this.matchingStrategy = MatchingStrategies.BY_TOP_DOWN;
|
|
88
97
|
super.subConstructor(source);
|
|
89
98
|
}
|
|
90
99
|
static from(source, parentNode, parentKey) {
|
|
@@ -384,11 +393,84 @@ let NewComposite = class NewComposite extends LogicItem__1.default {
|
|
|
384
393
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
385
394
|
// 自动生成的代码已结束。下面可以手动编写。
|
|
386
395
|
//================================================================================
|
|
396
|
+
/**
|
|
397
|
+
* 删除左边项
|
|
398
|
+
* @param property
|
|
399
|
+
*/
|
|
400
|
+
deleteProperty(property) {
|
|
401
|
+
let index = -1;
|
|
402
|
+
const properties = this.properties.filter((p, i) => {
|
|
403
|
+
if (p === property) {
|
|
404
|
+
index = i;
|
|
405
|
+
return false;
|
|
406
|
+
}
|
|
407
|
+
return true;
|
|
408
|
+
});
|
|
409
|
+
const newLines = [];
|
|
410
|
+
this.assignmentLines.forEach((line) => {
|
|
411
|
+
const targetIndex = line?.leftIndex;
|
|
412
|
+
if (targetIndex[1] < index) {
|
|
413
|
+
newLines.push(line);
|
|
414
|
+
}
|
|
415
|
+
else if (targetIndex[1] > index) {
|
|
416
|
+
const newLine = {
|
|
417
|
+
...line?.toJSON(),
|
|
418
|
+
leftIndex: [targetIndex[0], targetIndex[1] - 1],
|
|
419
|
+
};
|
|
420
|
+
newLines.push(newLine);
|
|
421
|
+
}
|
|
422
|
+
});
|
|
423
|
+
this.app.emit('collect:start', {
|
|
424
|
+
actionMsg: '删除左边项',
|
|
425
|
+
});
|
|
426
|
+
this.update({
|
|
427
|
+
properties,
|
|
428
|
+
assignmentLines: newLines,
|
|
429
|
+
});
|
|
430
|
+
this.app.emit('collect:end');
|
|
431
|
+
}
|
|
387
432
|
get lines() {
|
|
388
433
|
return this.assignmentLines.length;
|
|
389
434
|
}
|
|
390
|
-
|
|
435
|
+
checkConditions({ isAnnotation, leftName, rightName, leftTypeAnnotation, rightTypeAnnotation, }) {
|
|
436
|
+
// 条件数组
|
|
437
|
+
const conditions = [];
|
|
438
|
+
if ([
|
|
439
|
+
MatchingStrategies.BY_NAME,
|
|
440
|
+
MatchingStrategies.BY_NAME_AND_TYPE,
|
|
441
|
+
].includes(this.matchingStrategy)) {
|
|
442
|
+
conditions.push(() => {
|
|
443
|
+
return leftName === rightName;
|
|
444
|
+
});
|
|
445
|
+
}
|
|
446
|
+
if ([
|
|
447
|
+
MatchingStrategies.BY_TYPE,
|
|
448
|
+
MatchingStrategies.BY_NAME_AND_TYPE,
|
|
449
|
+
].includes(this.matchingStrategy)) {
|
|
450
|
+
conditions.push(() => {
|
|
451
|
+
return isAnnotation || rightTypeAnnotation?.sortedTypeKey === leftTypeAnnotation.sortedTypeKey;
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
if ([
|
|
455
|
+
MatchingStrategies.BY_TOP_DOWN,
|
|
456
|
+
].includes(this.matchingStrategy)) {
|
|
457
|
+
conditions.push(() => {
|
|
458
|
+
return true;
|
|
459
|
+
});
|
|
460
|
+
}
|
|
461
|
+
return conditions.every(condition => condition());
|
|
462
|
+
}
|
|
463
|
+
/**
|
|
464
|
+
* 自动连线算法
|
|
465
|
+
* @param param0
|
|
466
|
+
*/
|
|
467
|
+
batchAutoConnection({ targetRightIndex, reservedRightIndex, reservedLeftIndex, }) {
|
|
391
468
|
const leftLineSet = new Set();
|
|
469
|
+
if (Array.isArray(reservedLeftIndex)) {
|
|
470
|
+
reservedLeftIndex.forEach((index) => {
|
|
471
|
+
leftLineSet.add(index);
|
|
472
|
+
});
|
|
473
|
+
}
|
|
392
474
|
const lineArr = [];
|
|
393
475
|
const AssignmentLine = (0, decorators_1.getConceptConstructor)('AssignmentLine');
|
|
394
476
|
// 系统属性不可自动连线
|
|
@@ -399,75 +481,135 @@ let NewComposite = class NewComposite extends LogicItem__1.default {
|
|
|
399
481
|
leftLineSet.add(Number(line.leftIndex[1]));
|
|
400
482
|
});
|
|
401
483
|
const autoConnection = () => {
|
|
402
|
-
|
|
484
|
+
// 匿名数据结构
|
|
485
|
+
const isAnnotation = this.typeAnnotation?.typeKind === 'anonymousStructure';
|
|
403
486
|
this.app.emit('collect:start', {
|
|
404
487
|
actionMsg: '自动连线',
|
|
405
488
|
});
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
489
|
+
// 目标右侧
|
|
490
|
+
const targetRights = [-1, null, undefined].includes(targetRightIndex) ? this.rights.map((right, index) => {
|
|
491
|
+
return {
|
|
492
|
+
right,
|
|
493
|
+
index,
|
|
494
|
+
};
|
|
495
|
+
}) : [
|
|
496
|
+
{
|
|
497
|
+
right: this.rights?.[targetRightIndex],
|
|
498
|
+
index: targetRightIndex,
|
|
499
|
+
},
|
|
500
|
+
];
|
|
501
|
+
// 右侧父节点也不允许自动连线
|
|
502
|
+
const rightLineSet = new Set();
|
|
503
|
+
if (Array.isArray(reservedRightIndex) && reservedRightIndex.length) {
|
|
504
|
+
reservedRightIndex.forEach((rightIndex) => {
|
|
505
|
+
rightLineSet.add(rightIndex);
|
|
506
|
+
});
|
|
507
|
+
}
|
|
508
|
+
if (targetRights) {
|
|
509
|
+
targetRights.forEach(({ right: targetRight, index, }) => {
|
|
510
|
+
const { members } = targetRight;
|
|
419
511
|
for (let i = 0; i < members.length - 1; i++) {
|
|
420
512
|
const { completeName } = members[i];
|
|
421
513
|
const preCompleteName = members[i + 1].completeName;
|
|
422
514
|
if (preCompleteName.includes(completeName) &&
|
|
423
|
-
completeName.split('.').length !== preCompleteName.split('.').length)
|
|
424
|
-
rightLineSet.add(i);
|
|
515
|
+
completeName.split('.').length !== preCompleteName.split('.').length) {
|
|
516
|
+
rightLineSet.add(`${index}_${i}`);
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
this.assignmentLines.forEach((assignmentLine) => {
|
|
522
|
+
const { rightIndex } = assignmentLine;
|
|
523
|
+
if (rightIndex.length === 1) {
|
|
524
|
+
rightLineSet.add(`${rightIndex?.[0]}`);
|
|
525
|
+
}
|
|
526
|
+
else if (rightIndex.length === 2) {
|
|
527
|
+
const [firstIndex, secondIndex] = rightIndex || [];
|
|
528
|
+
rightLineSet.add(`${firstIndex}_${secondIndex}`);
|
|
529
|
+
}
|
|
530
|
+
});
|
|
531
|
+
this.properties.forEach((property, leftSecondIndex) => {
|
|
532
|
+
const leftName = property.name;
|
|
533
|
+
const leftTypeAnnotation = !isAnnotation && property.__TypeAnnotation;
|
|
534
|
+
targetRights.forEach(({ right: targetRight, index: rightFirstIndex, }) => {
|
|
535
|
+
// 已经有连线的不需要自动连线
|
|
536
|
+
if (leftLineSet.has(leftSecondIndex) || leftLineSet.has(leftName)) {
|
|
537
|
+
return;
|
|
425
538
|
}
|
|
426
|
-
|
|
427
|
-
|
|
539
|
+
const { members, expression } = targetRight;
|
|
540
|
+
if (members?.length) {
|
|
541
|
+
members.forEach((rightMember, rightSecondIndex) => {
|
|
542
|
+
// 已经有连线的不需要自动连线
|
|
543
|
+
if (leftLineSet.has(leftSecondIndex) || leftLineSet.has(leftName)) {
|
|
544
|
+
return;
|
|
545
|
+
}
|
|
546
|
+
if (rightLineSet.has(`${rightFirstIndex}_${rightSecondIndex}`)) {
|
|
547
|
+
return;
|
|
548
|
+
}
|
|
549
|
+
const rightName = rightMember?.property.name;
|
|
550
|
+
if (this.checkConditions({
|
|
551
|
+
isAnnotation,
|
|
552
|
+
leftName,
|
|
553
|
+
rightName,
|
|
554
|
+
leftTypeAnnotation,
|
|
555
|
+
rightTypeAnnotation: rightMember.__TypeAnnotation,
|
|
556
|
+
})) {
|
|
557
|
+
const leftIndex = [0, leftSecondIndex];
|
|
558
|
+
const rightIndex = [rightFirstIndex, rightSecondIndex];
|
|
559
|
+
const Line = new AssignmentLine({ leftIndex, rightIndex });
|
|
560
|
+
lineArr.push(Line);
|
|
561
|
+
leftLineSet.add(leftSecondIndex);
|
|
562
|
+
rightLineSet.add(`${rightFirstIndex}_${rightSecondIndex}`);
|
|
563
|
+
}
|
|
564
|
+
});
|
|
565
|
+
}
|
|
566
|
+
else if (this.checkConditions({
|
|
567
|
+
isAnnotation,
|
|
568
|
+
leftName,
|
|
569
|
+
rightName: expression.name,
|
|
570
|
+
leftTypeAnnotation,
|
|
571
|
+
rightTypeAnnotation: expression.__TypeAnnotation,
|
|
572
|
+
})) {
|
|
573
|
+
if (rightLineSet.has(`${rightFirstIndex}`)) {
|
|
574
|
+
return;
|
|
575
|
+
}
|
|
428
576
|
const Line = new AssignmentLine({
|
|
429
577
|
leftIndex: [0, leftSecondIndex],
|
|
430
578
|
rightIndex: [rightFirstIndex],
|
|
431
579
|
});
|
|
432
580
|
lineArr.push(Line);
|
|
433
581
|
leftLineSet.add(leftSecondIndex);
|
|
434
|
-
|
|
582
|
+
rightLineSet.add(`${rightFirstIndex}`);
|
|
435
583
|
}
|
|
436
|
-
members.forEach((rightMember, rightSecondIndex) => {
|
|
437
|
-
const rightName = rightMember.property.name;
|
|
438
|
-
if (rightLineSet.has(rightSecondIndex) || leftLineSet.has(leftSecondIndex))
|
|
439
|
-
return;
|
|
440
|
-
if (leftName === rightName) {
|
|
441
|
-
const rightTypeAnnotation = rightMember.__TypeAnnotation;
|
|
442
|
-
if (!isAnnotation && leftTypeAnnotation.typeName !== rightTypeAnnotation.typeName)
|
|
443
|
-
return;
|
|
444
|
-
const leftIndex = [0, leftSecondIndex];
|
|
445
|
-
const rightIndex = [rightFirstIndex, rightSecondIndex];
|
|
446
|
-
const Line = new AssignmentLine({ leftIndex, rightIndex });
|
|
447
|
-
lineArr.push(Line);
|
|
448
|
-
leftLineSet.add(leftSecondIndex);
|
|
449
|
-
}
|
|
450
|
-
});
|
|
451
584
|
});
|
|
452
585
|
});
|
|
453
586
|
lineArr.length && this.setAssignmentLines([...this.assignmentLines, ...lineArr]);
|
|
454
587
|
this.app.emit('collect:end');
|
|
455
588
|
};
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
589
|
+
// 跟类型相关的才需要等待
|
|
590
|
+
if ([
|
|
591
|
+
MatchingStrategies.BY_TYPE,
|
|
592
|
+
MatchingStrategies.BY_NAME_AND_TYPE,
|
|
593
|
+
].includes(this.matchingStrategy)) {
|
|
594
|
+
let count = 0;
|
|
595
|
+
const typeAnnotationEnd = () => {
|
|
596
|
+
const l = this.properties.every((item) => item.__isCorrectTypeAnnotation);
|
|
597
|
+
const r = this.rights.every((right) => right.members.every((item) => item.__isCorrectTypeAnnotation) && right.expression.__isCorrectTypeAnnotation);
|
|
598
|
+
count++;
|
|
599
|
+
if (r && l) {
|
|
600
|
+
autoConnection();
|
|
601
|
+
}
|
|
602
|
+
else if (count <= 10) {
|
|
603
|
+
setTimeout(() => {
|
|
604
|
+
typeAnnotationEnd();
|
|
605
|
+
}, 100);
|
|
606
|
+
}
|
|
607
|
+
};
|
|
608
|
+
typeAnnotationEnd();
|
|
609
|
+
}
|
|
610
|
+
else {
|
|
611
|
+
autoConnection();
|
|
612
|
+
}
|
|
471
613
|
}
|
|
472
614
|
connection(leftItem, rightItem, rightToLeft) {
|
|
473
615
|
let newLeftIndex = [0];
|
|
@@ -543,14 +685,207 @@ let NewComposite = class NewComposite extends LogicItem__1.default {
|
|
|
543
685
|
});
|
|
544
686
|
}
|
|
545
687
|
}
|
|
546
|
-
|
|
688
|
+
// 替换变量
|
|
689
|
+
async replaceIdentifier(oldNode, expression, members) {
|
|
690
|
+
// 关闭定时
|
|
691
|
+
this.app._noTimer = true;
|
|
692
|
+
this.app.emit('collect:start', {
|
|
693
|
+
actionMsg: '替换变量',
|
|
694
|
+
});
|
|
695
|
+
// 被替换的第一层属性
|
|
696
|
+
const oldSelectMember = oldNode.parentNode;
|
|
697
|
+
const firstRightIndex = this.rights.findIndex((right) => {
|
|
698
|
+
return oldSelectMember === right;
|
|
699
|
+
});
|
|
700
|
+
const newSelectMember = {
|
|
701
|
+
...(oldSelectMember?.toJSON?.() ?? oldSelectMember),
|
|
702
|
+
expression,
|
|
703
|
+
members: [],
|
|
704
|
+
};
|
|
705
|
+
// 待定的连线(保留的属性的连线也要保留)
|
|
706
|
+
const pendingLinesMap = new Map();
|
|
707
|
+
const newLines = this.assignmentLines.filter((line) => {
|
|
708
|
+
const { rightIndex } = line;
|
|
709
|
+
const [first, second] = rightIndex || [];
|
|
710
|
+
if (rightIndex.length === 2 && first === firstRightIndex) {
|
|
711
|
+
if (!pendingLinesMap.get(second)) {
|
|
712
|
+
pendingLinesMap.set(second, []);
|
|
713
|
+
}
|
|
714
|
+
const lines = pendingLinesMap.get(second);
|
|
715
|
+
lines.push(line);
|
|
716
|
+
return false;
|
|
717
|
+
}
|
|
718
|
+
return true;
|
|
719
|
+
});
|
|
720
|
+
// 先用变量替换右侧的属性
|
|
721
|
+
this.update({
|
|
722
|
+
assignmentLines: newLines,
|
|
723
|
+
rights: [
|
|
724
|
+
...this.rights.slice(0, firstRightIndex),
|
|
725
|
+
newSelectMember,
|
|
726
|
+
...this.rights.slice(firstRightIndex + 1, this.rights.length),
|
|
727
|
+
],
|
|
728
|
+
});
|
|
729
|
+
// 触发ts类型标注
|
|
730
|
+
this.app.naslServer?.embeddedTSEmitter.emit('change', {
|
|
731
|
+
value: [
|
|
732
|
+
{
|
|
733
|
+
originEvent: {
|
|
734
|
+
action: 'update',
|
|
735
|
+
target: this,
|
|
736
|
+
},
|
|
737
|
+
},
|
|
738
|
+
],
|
|
739
|
+
});
|
|
740
|
+
const memberInfoMap = new Map();
|
|
741
|
+
// 获取拖入表达式的类型
|
|
742
|
+
const currTypeAnnotation = await newSelectMember.expression?.getCurrentTypeAnnotation(30000);
|
|
743
|
+
// 当前类型下的所有属性(递归)
|
|
744
|
+
const propertyMap = currTypeAnnotation?.collectPropertyMap?.(this.app);
|
|
745
|
+
if (propertyMap) {
|
|
746
|
+
oldSelectMember?.members.forEach((member, index) => {
|
|
747
|
+
// 完整属性名
|
|
748
|
+
const oldCompletePropertyName = member.completePropertyName;
|
|
749
|
+
const { typeAnnotation, __TypeAnnotation } = member || {};
|
|
750
|
+
// 属性类型
|
|
751
|
+
const memberTypeAnnotation = typeAnnotation || __TypeAnnotation;
|
|
752
|
+
if (propertyMap.get(oldCompletePropertyName)?.typeKey === memberTypeAnnotation?.typeKey) {
|
|
753
|
+
memberInfoMap.set(oldCompletePropertyName, {
|
|
754
|
+
orginIndex: index,
|
|
755
|
+
member,
|
|
756
|
+
});
|
|
757
|
+
}
|
|
758
|
+
});
|
|
759
|
+
}
|
|
760
|
+
members.forEach((member) => {
|
|
761
|
+
const { completePropertyName } = member || {};
|
|
762
|
+
if (!memberInfoMap.has(completePropertyName)) {
|
|
763
|
+
memberInfoMap.set(completePropertyName, {
|
|
764
|
+
orginIndex: -1,
|
|
765
|
+
member,
|
|
766
|
+
});
|
|
767
|
+
}
|
|
768
|
+
});
|
|
769
|
+
const memberInfos = [...memberInfoMap.values()];
|
|
770
|
+
if (propertyMap) {
|
|
771
|
+
memberInfos.sort((member1, member2) => {
|
|
772
|
+
return propertyMap.get(member1?.member?.completePropertyName)?.index - propertyMap.get(member2?.member?.completePropertyName)?.index;
|
|
773
|
+
});
|
|
774
|
+
}
|
|
775
|
+
// 保留的属性
|
|
776
|
+
const reservedRightIndex = [];
|
|
777
|
+
memberInfos.forEach(({ orginIndex, }, index) => {
|
|
778
|
+
if (orginIndex !== -1) {
|
|
779
|
+
reservedRightIndex.push(`${firstRightIndex}_${index}`);
|
|
780
|
+
const pendingLines = pendingLinesMap.get(orginIndex);
|
|
781
|
+
if (Array.isArray(pendingLines)) {
|
|
782
|
+
pendingLines.forEach((pendingLine) => {
|
|
783
|
+
const newLine = {
|
|
784
|
+
...(pendingLine?.toJSON?.() ?? pendingLine),
|
|
785
|
+
rightIndex: [pendingLine.rightIndex[0], index],
|
|
786
|
+
};
|
|
787
|
+
newLines.push(newLine);
|
|
788
|
+
});
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
});
|
|
792
|
+
const right = this.rights[firstRightIndex];
|
|
793
|
+
const MemberExpression = (0, decorators_1.getConceptConstructor)('MemberExpression');
|
|
794
|
+
right.update({
|
|
795
|
+
members: memberInfos.map(({ member, }) => {
|
|
796
|
+
return new MemberExpression({
|
|
797
|
+
...(member?.firstMemberExpressionNode?.()?.toJSON() || {}),
|
|
798
|
+
object: expression?.toJSON(),
|
|
799
|
+
});
|
|
800
|
+
}),
|
|
801
|
+
});
|
|
802
|
+
// 更新属性和连线
|
|
803
|
+
this.update({
|
|
804
|
+
assignmentLines: newLines,
|
|
805
|
+
});
|
|
806
|
+
this.autoConnection && this.batchAutoConnection({
|
|
807
|
+
targetRightIndex: firstRightIndex,
|
|
808
|
+
reservedRightIndex,
|
|
809
|
+
});
|
|
810
|
+
this.app.emit('collect:end');
|
|
811
|
+
}
|
|
812
|
+
changeLeft({ typeAnnotation, batchExpression, }) {
|
|
813
|
+
const properties = [];
|
|
814
|
+
// 新的实体/数据结构下,与原实体/数据结构的属性一致时,保持原有连线状态; -一致即名称和类型均一致
|
|
815
|
+
const newLines = [];
|
|
816
|
+
const reservedLeftIndex = [];
|
|
817
|
+
let autoConnection = this.autoConnection;
|
|
818
|
+
if (typeAnnotation) {
|
|
819
|
+
const propertyMap = typeAnnotation.collectPropertyMap(this.app);
|
|
820
|
+
batchExpression.sort((a, b) => {
|
|
821
|
+
return (propertyMap.get(a.completeName)?.index - propertyMap.get(b.completeName)?.index);
|
|
822
|
+
});
|
|
823
|
+
// 之前的结构属性
|
|
824
|
+
const keepPropertyMap = new Map();
|
|
825
|
+
this.properties.forEach((property) => {
|
|
826
|
+
const typeAnnotation = property?.__TypeAnnotation || property?.typeAnnotation;
|
|
827
|
+
const lines = this.findlines(property, this);
|
|
828
|
+
keepPropertyMap.set(property?.completeName, {
|
|
829
|
+
property,
|
|
830
|
+
lines,
|
|
831
|
+
sortedTypeKey: typeAnnotation?.sortedTypeKey,
|
|
832
|
+
});
|
|
833
|
+
});
|
|
834
|
+
// 需要清除引用,否则nodePath会引用到旧的member节点
|
|
835
|
+
batchExpression.map(({ expression }, index) => {
|
|
836
|
+
const Identifier = (0, decorators_1.getConceptConstructor)('Identifier');
|
|
837
|
+
const ident = new Identifier({
|
|
838
|
+
name: expression.name,
|
|
839
|
+
});
|
|
840
|
+
properties.push(ident);
|
|
841
|
+
const oldPropertyInfo = keepPropertyMap.get(expression.name);
|
|
842
|
+
if (oldPropertyInfo) {
|
|
843
|
+
reservedLeftIndex.push(index);
|
|
844
|
+
const { lines } = oldPropertyInfo || {};
|
|
845
|
+
lines.forEach((line) => {
|
|
846
|
+
const newLine = {
|
|
847
|
+
...line?.toJSON(),
|
|
848
|
+
leftIndex: [line.leftIndex[0], index],
|
|
849
|
+
};
|
|
850
|
+
newLines.push(newLine);
|
|
851
|
+
});
|
|
852
|
+
}
|
|
853
|
+
});
|
|
854
|
+
}
|
|
855
|
+
else {
|
|
856
|
+
autoConnection = false;
|
|
857
|
+
}
|
|
858
|
+
this.update({
|
|
859
|
+
typeAnnotation,
|
|
860
|
+
properties,
|
|
861
|
+
assignmentLines: newLines,
|
|
862
|
+
});
|
|
863
|
+
autoConnection && this.batchAutoConnection({
|
|
864
|
+
targetRightIndex: -1,
|
|
865
|
+
reservedLeftIndex,
|
|
866
|
+
});
|
|
867
|
+
}
|
|
868
|
+
async changeMembers(oldNode, members, expression) {
|
|
869
|
+
// 关闭定时
|
|
870
|
+
this.app._noTimer = true;
|
|
547
871
|
this.app.emit('collect:start', {
|
|
548
872
|
actionMsg: 'New初始赋值修改变量',
|
|
549
873
|
});
|
|
550
|
-
const
|
|
551
|
-
|
|
552
|
-
const
|
|
553
|
-
|
|
874
|
+
const oldSelectMember = oldNode.parentNode;
|
|
875
|
+
// 之前的结构属性
|
|
876
|
+
const keepPropertyMap = new Map();
|
|
877
|
+
oldSelectMember.members.forEach((member) => {
|
|
878
|
+
if (asserts.isMemberExpression(member)) {
|
|
879
|
+
const typeAnnotation = member?.__TypeAnnotation || member?.typeAnnotation;
|
|
880
|
+
const lines = this.findlines(member, oldSelectMember);
|
|
881
|
+
keepPropertyMap.set(member?.completePropertyName, {
|
|
882
|
+
member,
|
|
883
|
+
lines,
|
|
884
|
+
sortedTypeKey: typeAnnotation?.sortedTypeKey,
|
|
885
|
+
});
|
|
886
|
+
}
|
|
887
|
+
});
|
|
888
|
+
const targetRightIndex = this.rights.findIndex((right) => right === oldSelectMember);
|
|
554
889
|
let keepLines = false;
|
|
555
890
|
if (this?.concept === 'NewComposite' &&
|
|
556
891
|
this?.typeAnnotation?.typeKind === 'anonymousStructure' &&
|
|
@@ -559,28 +894,85 @@ let NewComposite = class NewComposite extends LogicItem__1.default {
|
|
|
559
894
|
if (tempNode && tempNode?.calleeName === 'ListSort')
|
|
560
895
|
keepLines = true;
|
|
561
896
|
}
|
|
562
|
-
const newLines = keepLines ? this.assignmentLines : this.assignmentLines.filter(({ rightIndex }) =>
|
|
563
|
-
|
|
897
|
+
const newLines = keepLines ? this.assignmentLines : this.assignmentLines.filter(({ rightIndex, }) => {
|
|
898
|
+
return (rightIndex[0] !== targetRightIndex) || (rightIndex?.length === 1);
|
|
899
|
+
});
|
|
900
|
+
this.update({
|
|
901
|
+
assignmentLines: newLines,
|
|
902
|
+
rights: [
|
|
903
|
+
...this.rights.slice(0, targetRightIndex),
|
|
904
|
+
{
|
|
905
|
+
...(oldSelectMember?.toJSON?.() ?? oldSelectMember),
|
|
906
|
+
expression,
|
|
907
|
+
members,
|
|
908
|
+
},
|
|
909
|
+
...this.rights.slice(targetRightIndex + 1, this.rights.length),
|
|
910
|
+
],
|
|
911
|
+
});
|
|
912
|
+
// 触发ts类型标注
|
|
913
|
+
this.app.naslServer?.embeddedTSEmitter.emit('change', {
|
|
914
|
+
value: [
|
|
915
|
+
{
|
|
916
|
+
originEvent: {
|
|
917
|
+
action: 'update',
|
|
918
|
+
target: this,
|
|
919
|
+
},
|
|
920
|
+
},
|
|
921
|
+
],
|
|
922
|
+
});
|
|
923
|
+
// 表达式的类型
|
|
924
|
+
await expression?.getCurrentTypeAnnotation(30000);
|
|
925
|
+
const propertyMap = new Map();
|
|
926
|
+
if (asserts.isIdentifier(expression)) {
|
|
927
|
+
const { namespace, name } = expression;
|
|
928
|
+
const completeList = [];
|
|
929
|
+
if (namespace) {
|
|
930
|
+
completeList.push(namespace);
|
|
931
|
+
}
|
|
932
|
+
completeList.push(name);
|
|
933
|
+
const completeName = completeList.join('.');
|
|
934
|
+
const count = propertyMap.size;
|
|
935
|
+
// 获取类型注解并提取其结构
|
|
936
|
+
const typeAnnotation = expression?.__TypeAnnotation || expression?.typeAnnotation;
|
|
937
|
+
// 将完整属性名添加到属性映射表中
|
|
938
|
+
propertyMap.set(completeName, {
|
|
939
|
+
index: count,
|
|
940
|
+
typeKey: typeAnnotation?.typeKey,
|
|
941
|
+
});
|
|
942
|
+
let depth = 0;
|
|
943
|
+
typeAnnotation?.collectPropertyMap(this.app, completeName, propertyMap, depth);
|
|
944
|
+
}
|
|
945
|
+
if (propertyMap.size) {
|
|
946
|
+
members.sort((a, b) => {
|
|
947
|
+
return (propertyMap.get(a.completeName)?.index - propertyMap.get(b.completeName)?.index);
|
|
948
|
+
});
|
|
949
|
+
}
|
|
950
|
+
const reservedRightIndex = [];
|
|
564
951
|
// 右侧变量改变后,修改连线
|
|
565
952
|
members.forEach((item, index) => {
|
|
566
|
-
|
|
567
|
-
|
|
953
|
+
const oldPropertyInfo = keepPropertyMap.get(item?.completePropertyName);
|
|
954
|
+
const { sortedTypeKey } = oldPropertyInfo || {};
|
|
955
|
+
const typeAnnotation = item?.__TypeAnnotation || item?.typeAnnotation;
|
|
956
|
+
if (sortedTypeKey === typeAnnotation?.sortedTypeKey) {
|
|
957
|
+
reservedRightIndex.push(`${targetRightIndex}_${index}`);
|
|
958
|
+
const { lines } = oldPropertyInfo || {};
|
|
568
959
|
lines.forEach((line) => {
|
|
569
|
-
const newLine = { ...
|
|
960
|
+
const newLine = { ...line?.toJSON(), rightIndex: [line.rightIndex[0], index] };
|
|
570
961
|
newLines.push(newLine);
|
|
571
|
-
oldLines = oldLines.filter(({ leftIndex }) => leftIndex[1] !== line.leftIndex[1]);
|
|
572
962
|
});
|
|
573
963
|
}
|
|
574
964
|
});
|
|
965
|
+
const newSelectMember = this.rights.find((right, index) => index === targetRightIndex);
|
|
966
|
+
newSelectMember.update({
|
|
967
|
+
members,
|
|
968
|
+
});
|
|
575
969
|
this.update({
|
|
576
970
|
assignmentLines: newLines,
|
|
577
|
-
rights: [
|
|
578
|
-
...this.rights.slice(0, splitIndex),
|
|
579
|
-
newSelectMember,
|
|
580
|
-
...this.rights.slice(splitIndex + 1, this.rights.length),
|
|
581
|
-
],
|
|
582
971
|
});
|
|
583
|
-
this.autoConnection && this.
|
|
972
|
+
this.autoConnection && this.batchAutoConnection({
|
|
973
|
+
targetRightIndex,
|
|
974
|
+
reservedRightIndex,
|
|
975
|
+
});
|
|
584
976
|
this.app.emit('collect:end');
|
|
585
977
|
}
|
|
586
978
|
findlines(member, selectMember) {
|
|
@@ -1187,12 +1579,18 @@ let NewComposite = class NewComposite extends LogicItem__1.default {
|
|
|
1187
1579
|
this.app.emit('collect:start', {
|
|
1188
1580
|
actionMsg: '添加匿名数据结构属性',
|
|
1189
1581
|
});
|
|
1582
|
+
const reservedLeftIndex = Array.from({
|
|
1583
|
+
length: this.properties.length,
|
|
1584
|
+
}, (v, i) => i);
|
|
1190
1585
|
const node = this.addIdentifier({ name: this.getIdentifierUniqueName(newName) });
|
|
1191
1586
|
const struct = StructureProperty.from({
|
|
1192
1587
|
name: node.name,
|
|
1193
1588
|
typeAnnotation: newType,
|
|
1194
1589
|
});
|
|
1195
1590
|
this.typeAnnotation.addStructureProperty(struct);
|
|
1591
|
+
this.autoConnection && this.batchAutoConnection({
|
|
1592
|
+
reservedLeftIndex,
|
|
1593
|
+
});
|
|
1196
1594
|
this.app.emit('collect:end');
|
|
1197
1595
|
}
|
|
1198
1596
|
__deleteIdentifier(property) {
|