# Weird Block Formatting Breaks Code

**URL:** https://forum.makecode.com/t/weird-block-formatting-breaks-code/20318
**Category:** Help
**Tags:** extension
**Created:** [May 31, 2023, 4:54pm UTC](https://forum.makecode.com/t/weird-block-formatting-breaks-code/20318 "2023-05-31T16:54:19Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![meeeeeeeep1](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/meeeeeeeep1/32/7912_2.png) [@meeeeeeeep1](https://forum.makecode.com/u/meeeeeeeep1)
#### Post date: [May 31, 2023, 4:54pm UTC](https://forum.makecode.com/t/weird-block-formatting-breaks-code/20318/1 "2023-05-31T16:54:20Z")

</div>

I’m creating a custom block with quite weird formatting and whenever I go to blocks from javascript the `function(){ }` parameter disappears.

* * *

This is the shape of block:  
 ![Screenshot 2023-05-29 at 19-49-51 Microsoft MakeCode Arcade](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/1/190e4ae52821f8f40e37ffbe5bd749035222f166.png)  
This is the code for the block:

```typescript
    //% value.defl=function () { }
    //% block="JSON"
    //% handlerStatement=1
    export function json(handler: () => void): {} {
        return {}
    }

```

Once I go to the blocks tab, the code goes from this: `custom.json(function() { })` to this: `custom.json()`

It also gives me this error:

```auto
Line 1: Expected 1 arguments, but got 0.

```

This is mainly for the MakeCode team, but if anyone else could help me that would be great!

---

<div class="post-metadata">

### Author: ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)
#### Post date: [May 31, 2023, 4:55pm UTC](https://forum.makecode.com/t/weird-block-formatting-breaks-code/20318/2 "2023-05-31T16:55:42Z")

</div>

Unfortunately, this is not supported; blocks that take function parameters are not allowed to return values.

Out of curiosity, what’s your scenario for this?

---

<div class="post-metadata">

### Author: ![meeeeeeeep1](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/meeeeeeeep1/32/7912_2.png) [@meeeeeeeep1](https://forum.makecode.com/u/meeeeeeeep1)
#### Post date: [May 31, 2023, 9:16pm UTC](https://forum.makecode.com/t/weird-block-formatting-breaks-code/20318/3 "2023-05-31T21:16:36Z")

</div>

I’m making an extension that lets you create a json object with blocks like this:  
 ![98b6e8cc1357170f](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/f/f077ecd15f565fea48281c02439e63436b970af3.png)

---

<div class="post-metadata">

### Author: ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)
#### Post date: [May 31, 2023, 10:40pm UTC](https://forum.makecode.com/t/weird-block-formatting-breaks-code/20318/4 "2023-05-31T22:40:24Z")

</div>

ah, makes sense! Unfortunately, I don’t think we have plans to add this right now but you can open an issue here: [https://github.com/microsoft/pxt-arcade/issues](https://github.com/microsoft/pxt-arcade/issues)

---

<div class="post-metadata">

### Author: ![labfox29](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/labfox29/32/9252_2.png) [@labfox29](https://forum.makecode.com/u/labfox29)
#### Post date: [June 1, 2023, 5:02pm UTC](https://forum.makecode.com/t/weird-block-formatting-breaks-code/20318/5 "2023-06-01T17:02:19Z")

</div>

Why are you on [Code.org](http://Code.org)?
