Skip to content

Add ability to drag returns - #624

Open
alan412 wants to merge 2 commits into
wpilibsuite:mainfrom
alan412:add_return
Open

alan412 wants to merge 2 commits into
wpilibsuite:mainfrom
alan412:add_return

Conversation

@alan412

@alan412 alan412 commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Overview

From methods that allow returns, allow dragging a return from the method block into the method (so you can have early returns). It also gives warnings if the various returns don't all return the same type.

Linked Issues

None.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that causes existing functionality to change)
  • Documentation update
  • Code style/formatting updates
  • Refactoring / Renaming
  • UI change
  • Blocks style change
  • Blocks theme change
  • Python tools
  • Other

How Has This Been Tested?

Create a block with a return. Drag the retun from inside of it into an if
Visually inspect python code generated
Check to see if you get warnings if the two returns return different types.

Screenshots (if applicable)

Showing how you can drag a return:
Screenshot 2026-11-10 at 10 05 16 AM

This is showing what you get when you have disagreeing return types. The reason the warning icon is on the top is because that is where blockly puts it. I can put an additional "fake" warning down by return if we think it is worth it (as an image field that is only visible when there is a return warning) but I am not sure this is worth it.
Screenshot 2026-11-10 at 10 05 37 AM

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have run through the docs/testing_before_pr_checklist.md

Comment thread frontend/blocks/mrc_return.ts Resolved
@alan412
alan412 requested a review from lizlooney November 11, 2026 23:39

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants