pxt-microbit
pxt-microbit copied to clipboard
Python basic.show_leds() indents the string incorrectly
https://support.microbit.org/a/tickets/53675 (private)
Describe the bug
In the Python code editor, the basic.show_leds() string argument is not aligned correctly.
This is not an issue with the JavaScript code view.
To Reproduce Steps to reproduce the behavior:
- Go to https://makecode.microbit.org
- Drop the "show LEDs" block
- Switch to Python code
- See the string alignment:
basic.show_leds("""
# . . . .
# . . . .
# . . . .
# . . . .
# . . . .
""")
Expected behavior Each line of the string to have the same indentation.
Screenshots
micro:bit version (please complete the following information):
N/A
Desktop (please complete the following information):
- OS: macOS 11
- Browser: Chome
- Version: 101
Smartphone (please complete the following information): N/A
Additional context
makecode.microbit.org version: 4.0.18
Microsoft MakeCode version: 7.0.14
microbit runtime version: v2.2.0-rc6
codal-microbit-v2 runtime version: v0.2.32
This is somewhat related to https://github.com/microsoft/pxt-microbit/issues/3116, but the misalignment is not the same.
I can reproduce this. The indentation differs in intelligence and when you go to blocks and back. Ideally it should be consistent.
Likely fix in blocks->text compiler and the pyhon intelliense
Also evaluate moving to pyright intellisense instead of our own. https://github.com/microsoft/pyright
closing as dup of https://github.com/microsoft/pxt-microbit/issues/4891 (this one was filed first, but the other one has a few more samples with it being extra bad & @benvillalobos already assigned himself that one~)