microsoft / microsoft/pxt-microbit

Extension blocks that might reuse existing extension simulator parts

Open
#6,129 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

extension P2 Simulator
Dominant language
TypeScript
Stars
804
Forks
721
Avg merge
2d 9h
Merged PRs (30d)
2

Description

Describe the bug

Arising from two extensions that depend on existing neopixel and servo extensions.
https://github.com/microsoft/pxt-microbit/pull/6123#issuecomment-2731100052
https://github.com/microsoft/pxt-microbit/pull/6121#issuecomment-2730195155

I created some examples with code in custom.ts.

Wrapping existing calls that would show simulator parts, in functions with parameters, causes the simulator to jump down, but no simulated part is shown.
https://makecode.microbit.org/_Ku2KqDDxcPD6

I discovered that it's easy to stop the simulator moving, and parts appearing, by adding, for example,
//% hiddenParts=microservo or //% hiddenParts="neopixel" to any block
https://makecode.microbit.org/_82tEEvb1sdtT

A block with no parameters triggers the servo to appear, but blocks with parameters still seem to have no effect on the simulation.
https://makecode.microbit.org/_2vXK82gF5U8s

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the simulator behavior using the custom.ts examples and the linked MakeCode projects. Compare wrappers around existing neopixel and servo calls, including the examples using hiddenParts, and identify why parameterized blocks do not show simulated parts. Done means the simulator remains positioned correctly and displays the expected servo or neopixel part for these extension blocks.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.