@@ -38,7 +38,6 @@ import { MUTATOR_BLOCK_NAME, PARAM_CONTAINER_BLOCK_NAME, MethodMutatorArgBlock }
3838export const BLOCK_NAME = 'mrc_class_method_def' ;
3939
4040export const FIELD_METHOD_NAME = 'NAME' ;
41- export const RETURN_VALUE = 'RETURN' ;
4241
4342type Parameter = {
4443 name : string ,
@@ -55,7 +54,6 @@ interface ClassMethodDefMixin extends ClassMethodDefMixinType {
5554 mrcParameters : Parameter [ ] ,
5655 mrcPythonMethodName : string ,
5756 mrcFuncName : string | null ,
58- mrcUpdateReturnInput ( ) : void ,
5957}
6058type ClassMethodDefMixinType = typeof CLASS_METHOD_DEF ;
6159
@@ -181,7 +179,6 @@ const CLASS_METHOD_DEF = {
181179 ( this as Blockly . BlockSvg ) . setMutator ( null ) ;
182180 }
183181 this . mrcUpdateParams ( ) ;
184- this . mrcUpdateReturnInput ( ) ;
185182 } ,
186183 compose : function ( this : ClassMethodDefBlock , containerBlock : any ) {
187184 // Parameter list.
@@ -253,21 +250,6 @@ const CLASS_METHOD_DEF = {
253250 }
254251 }
255252 } ,
256- mrcUpdateReturnInput : function ( this : ClassMethodDefBlock ) {
257- // Remove existing return input if it exists
258- if ( this . getInput ( RETURN_VALUE ) ) {
259- this . removeInput ( RETURN_VALUE ) ;
260- }
261-
262- // Add return input if return type is not 'None'
263- if ( this . mrcReturnType && this . mrcReturnType !== 'None' ) {
264- this . appendValueInput ( RETURN_VALUE )
265- . setAlign ( Blockly . inputs . Align . RIGHT )
266- . appendField ( Blockly . Msg . PROCEDURES_DEFRETURN_RETURN ) ;
267- // Move the return input to be before the statement input
268- this . moveInputBefore ( RETURN_VALUE , 'STACK' ) ;
269- }
270- } ,
271253 removeParameterFields : function ( input : Blockly . Input ) {
272254 const fieldsToRemove = input . fieldRow
273255 . filter ( field => field . name ?. startsWith ( 'PARAM_' ) )
@@ -520,23 +502,6 @@ export function createCustomMethodBlock(): toolboxItems.Block {
520502 return new toolboxItems . Block ( BLOCK_NAME , extraState , fields , null ) ;
521503}
522504
523- export function createCustomMethodBlockWithReturn ( ) : toolboxItems . Block {
524- const extraState : ClassMethodDefExtraState = {
525- canChangeSignature : true ,
526- canBeCalledWithinClass : true ,
527- canBeCalledOutsideClass : true ,
528- returnType : 'Any' ,
529- params : [ ] ,
530- } ;
531- const fields : { [ key : string ] : any } = { } ;
532- fields [ FIELD_METHOD_NAME ] = 'my_method_with_return' ;
533- const inputs : { [ key : string ] : any } = { } ;
534- inputs [ RETURN_VALUE ] = {
535- 'type' : 'input_value' ,
536- } ;
537- return new toolboxItems . Block ( BLOCK_NAME , extraState , fields , inputs ) ;
538- }
539-
540505export function getBaseClassBlocks (
541506 baseClassName : string ) : toolboxItems . Block [ ] {
542507 const blocks : toolboxItems . Block [ ] = [ ] ;
0 commit comments