microsoft / microsoft/pxt

Makecode: Function rename

Open
#10,329 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
2.3k
Forks
641
Avg merge
12h 4m
Merged PRs (30d)
57

Description

I can rename function in Makecode. When I do so, I do not see new function in the list of "calls" for function, I see old name. It is a bug in the Makecode editor.

DEMO:

  1. Create block for custom function test1. Create block for custom function test2.
  2. Check the list of available functions in Advanced/Functions, you should see test1 and test2.
  3. Rename function 'test2' to something else, maybe test3.
  4. Check the list of available functions in Advanced/Functions, you should see test1 and test3 but you will see test1 and test2. The BUG

To call function test3 I have to click on function definition and select Create "call test3"
When I use test2 block from the list, it really calls test2 but such definition is not on the desk...

DEMO in Makecode editor

It seems that once projecty is reopned, list of functions are updated, so you cannot see the issue in the example above. When I saved project there were functions test1 and test2 but when I open shared project, I see functions test1 and test3, that is expected... Anyway, you can rename function test3 to test4 and you will see the issue again... ;-)

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 rename flow in the linked Makecode editor or DEMO: create test1 and test2, rename test2, and inspect Advanced/Functions. Done means the available function list immediately shows the new name and no longer offers the old call block, without reopening the project.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.