You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Configure core lib to use auto-generated blocks (create sims.d.ts file, add it to pxt.json).
Create a simulator file that exposes some blocks in a category:
/** * Provides access to basic micro:bit functionality. *///% color=#1E90FF weight=116 icon="\uf00a"namespacepxsim.basic{/** * Repeat the code forever in the background * @param body code to execute *///% help=functions/forever weight=55//% blockId=device_forever block="forever" afterOnStart=trueexportfunctionforever(body: RefAction): void{thread.forever(body)}/** * Pause for the specified time in milliseconds * @param ms how long to pause for, eg. 100, 200, 500, 1000, 2000 *///% help=functions/pause weight=54//% blockId=device_pause block="pause (ms) %pause"exportfunctionpause(ms: number): void{if(isNaN(ms))ms=20thread.pause(ms)}}
See that sims.d.ts does not contain the category comment:
// Auto-generated from simulator. Do not edit.declarenamespacebasic{/** * Repeat the code forever in the background * @param body code to execute *///% help=functions/forever weight=55//% blockId=device_forever block="forever" afterOnStart=true//% shim=basic::foreverfunctionforever(body: ()=>void): void;/** * Pause for the specified time in milliseconds * @param ms how long to pause for, eg. 100, 200, 500, 1000, 2000 *///% help=functions/pause weight=54//% blockId=device_pause block="pause (ms) %pause"//% shim=basic::pausefunctionpause(ms: number): void;}// Auto-generated. Do not edit. Really.
Expected behavior
The category comment should be present and applied correctly in the editor.
The text was updated successfully, but these errors were encountered:
Bug Template
Describe the bug
When using auto-generation from the simulator, the category comments for namespaces do not work, as they are simply ignored.
To Reproduce
Configure
core
lib to use auto-generated blocks (createsims.d.ts
file, add it topxt.json
).Create a simulator file that exposes some blocks in a category:
See that
sims.d.ts
does not contain the category comment:Expected behavior
The category comment should be present and applied correctly in the editor.
The text was updated successfully, but these errors were encountered: