microsoft / microsoft/pxt-microbit

Disappearanced code of main.ts when editing custom.js

Open
#4,896 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

explorer P2
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:

  1. Create new project (name is 'test')
  2. Change to editor as javascript
  3. Open explorer, click '+', and create new custom.ts
  4. Change to editor as javascript
  5. Write following codes

basic.forever(function () {
custom.foo(5, "Hello", MyEnum.One)
})

  1. Open custom.ts
  2. Rename "foo" to "foo2"
  3. Change to editor as javascript

Change "custom.foo(" to "custom.foo2("

  1. 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

step7
step8
step9

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.