pxt icon indicating copy to clipboard operation
pxt copied to clipboard

Makecode: Function rename

Open PSLLSP opened this issue 10 months ago • 2 comments
trafficstars

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... ;-)

PSLLSP avatar Jan 01 '25 15:01 PSLLSP