Block param definition issue in extension

Hi all,

I’m practicing working on extensions through some personal edits to UnsignedArduino’s fantastic Inventory extension and I’m having an issue in defining blocks.

Currently the string parameter in the snippet below always shows as a var block on the Makecode Blocks Playground. Any idea what I’m doing wrong here?

        /**
         * change the quantity of a chosen item in the toolbar.
         * @item_name: The name of the item that we want to change the quantity of.
         * @value: How much we want to change the quantity of the item by.
         */
        //% block="change quantity of %item_name in toolbar by %value"
        //% weight=35
        //% group="Toolbar"
        public change_item_quantity_by(item_name: string, value: number): void {
            let selected_item = this.get_item_by_name(item_name)
            if (selected_item) {
                selected_item.quantity += value;
                if (selected_item.quantity < 0) {
                    selected_item.quantity = 0;
                }
                this.update();
            }
        }

image_2024-06-20_014840423

3 Likes

That’s interesting …
When I copied your code over to a new project, I got it the way I presume you expect to be:
Block screenshot

I hope someone can pick this up and find out why! :pray: