forked from scratchfoundation/scratch-gui
-
-
Notifications
You must be signed in to change notification settings - Fork 16
Closed
Copy link
Labels
Description
Problem
The Ruby-to-blocks converter currently uses inconsistent naming for method call registration:
registerCallMethodregisterCallMethodWithBlockregisterCallMyBlock
This naming is inconsistent with the newer registerOnXxx pattern introduced in #399/#400 and doesn't clearly convey that these methods handle onSend events (method calls).
Solution
Rename all registerCallMethod* functions to use consistent registerOnSend* naming:
Proposed Renamings
registerCallMethod→registerOnSendregisterCallMethodWithBlock→registerOnSendWithBlockregisterCallMyBlock→registerOnSendMyBlock
Scope
This affects all converter files that use these registration methods:
- Motion converter
- Looks converter
- Sound converter
- Event converter
- Control converter
- Sensing converter
- Operators converter
- Variables converter
- MyBlocks converter
- Core infrastructure in index.js
Benefits
- Consistency: Aligns with the registerOnXxx pattern established in refactor: migrate remaining onXxx handlers to register pattern #399/feat: implement registerOnXxx infrastructure for Ruby-to-blocks converter #400
- Clarity: Makes it clear these methods handle onSend events (method calls)
- Maintainability: Consistent naming improves code readability
- Semantic Accuracy: Better reflects the actual functionality
Implementation Plan
- Create feature branch
refactor/register-on-send-naming - Refactor each converter category individually with separate commits
- Update core infrastructure in index.js
- Ensure all tests pass
- Update documentation if needed
Acceptance Criteria
- All
registerCallMethod*functions renamed toregisterOnSend* - All converter files updated to use new method names
- Core infrastructure updated in index.js
- All tests pass
- No functional changes - purely a refactoring
- Consistent naming pattern across the codebase
Related Issues
- refactor: migrate remaining onXxx handlers to register pattern #399 - Original registerOnXxx infrastructure design
- feat: implement registerOnXxx infrastructure for Ruby-to-blocks converter #400 - registerOnXxx infrastructure implementation