microsoft / pxt-microbit

A Blocks / JavaScript code editor for the micro:bit built on Microsoft MakeCode
https://makecode.microbit.org
Other
717 stars 589 forks source link

highlight macro broken for spy/python samples #2751

Closed pelikhan closed 4 years ago

pelikhan commented 4 years ago
pelikhan commented 4 years ago

This is not a tutorial engine issue. The python to javascript decompiler messes up the comments:

basic.forever(function() {
    let x = input.acceleration(Dimension.X);
    // @highlight
    let y = input.acceleration(Dimension.Y);
})

becomes

# @highlight
def on_forever():
    x = input.acceleration(Dimension.X)
    y = input.acceleration(Dimension.Y)
basic.forever(on_forever)