microsoft / microsoft/pxt-microbit
Disappearanced code of main.ts when editing custom.js
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 804
- Forks
- 721
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 2
Description
Describe the bug
Disappearanced code of main.ts when editing custom.js
To Reproduce
Steps to reproduce the behavior:
- Create new project (name is 'test')
- Change to editor as javascript
- Open explorer, click '+', and create new custom.ts
- Change to editor as javascript
- Write following codes
basic.forever(function () {
custom.foo(5, "Hello", MyEnum.One)
})
- Open custom.ts
- Rename "foo" to "foo2"
- Change to editor as javascript
Change "custom.foo(" to "custom.foo2("
- Change to editor as blocks
Expected behavior
The blocks are displayed correctly
Screenshots
Added screenshots as Step7, 8, 9
micro:bit version (please complete the following information):
micro:bit v2.0, Interface Version: 0257
Desktop (please complete the following information):
- OS: Windows 10 Home 22H2 build 19045.2364
- Browser: Chrome 108.0.5359.100(Official Build)(64 bit)
Additional context



Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the editor sequence in the issue: create custom.ts, define custom.foo, rename it to custom.foo2 in JavaScript, and switch back to blocks. Compare the displayed blocks with the expected code, paying attention to the main.ts and custom.js/custom.ts references. Done means the blocks remain correctly displayed after the rename.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100