Skip to content

Commit a008904

Browse files
authored
When validating names, only look at mechanism and component blocks (#352)
* When validating names, only look at mechanism and component blocks. * When validating names, collect the names from other mechanism, component, and event blocks.
1 parent ea86e7a commit a008904

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/blocks/mrc_mechanism_component_holder.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,10 @@ const MECHANISM_COMPONENT_HOLDER = {
221221
setNameOfChildBlock(this: MechanismComponentHolderBlock, child: Blockly.Block): void {
222222
const otherNames: string[] = []
223223
this.getDescendants(true)
224+
.filter(descendant =>
225+
descendant.type === MRC_MECHANISM_NAME ||
226+
descendant.type === MRC_COMPONENT_NAME ||
227+
descendant.type === MRC_EVENT_NAME)
224228
.filter(descendant => descendant.id !== child.id)
225229
.forEach(descendant => {
226230
otherNames.push(descendant.getFieldValue('NAME'));

0 commit comments

Comments
 (0)