Skip to content

Code card rendering should use api name from 'blockAliasFor=' #10852

@ganicke

Description

@ganicke

Rendering of code cards uses the api name from the decompile info even when the attrs have blockAliasFor set. I'm thinking that if both the blocks and ```sig rendering use the alias name, the TS code cards should do the same?

The example here shows the api name with the _ while the alias name is set as onItemDropped.

//% blockId=events_onItemDropped
//% blockAliasFor="events.onItemDropped"
//% block="on $item dropped with $count"
//% draggableParameters="reporter"
//% group="Items"
//% weight=80 help=events/on-item-dropped
export function _onItemDropped(handler: (item: number, count: number) => void) {
    events.onItemDropped(handler);
}
image

RE: https://github.com/microsoft/pxt-minecraft/pull/2846#issuecomment-3222206254

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions