File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -547,6 +547,25 @@ const CALL_PYTHON_FUNCTION = {
547547 let foundComponent = false ;
548548 const componentsInScope : storageModuleContent . Component [ ] = [ ] ;
549549 componentsInScope . push ( ...this . getComponentsFromRobot ( ) ) ;
550+
551+ // If we're in a robot context, also include components from mechanisms
552+ if ( editor . getCurrentModuleType ( ) === storageModule . ModuleType . ROBOT ) {
553+ editor . getMechanismsFromRobot ( ) . forEach ( mechanismInRobot => {
554+ const mechanism = editor . getMechanism ( mechanismInRobot ) ;
555+ if ( mechanism ) {
556+ const mechanismComponents = editor . getComponentsFromMechanism ( mechanism ) ;
557+ mechanismComponents . forEach ( component => {
558+ // Create a copy of the component with the mechanism-prefixed name
559+ const prefixedComponent = {
560+ ...component ,
561+ name : mechanismInRobot . name + '.' + component . name
562+ } ;
563+ componentsInScope . push ( prefixedComponent ) ;
564+ } ) ;
565+ }
566+ } ) ;
567+ }
568+
550569 if ( editor . getCurrentModuleType ( ) === storageModule . ModuleType . MECHANISM ) {
551570 componentsInScope . push ( ...editor . getComponentsFromWorkspace ( ) ) ;
552571 }
You can’t perform that action at this time.
0 commit comments