microsoft / pxt-arcade

Arcade game editor based on Microsoft MakeCode
https://arcade.makecode.com
MIT License
484 stars 210 forks source link

Renaming kinds disallowed for user-made kinds, allowed for built-in kinds #5965

Closed kimprice closed 1 year ago

kimprice commented 1 year ago

Describe the bug I think it has to do with the status bars extension. It allows me to rename a built-in kind and not a user-made kind.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://arcade.makecode.com/stable
  2. Import https://arcade.makecode.com/S63783-19068-25507-81035
  3. Try to rename "Energy" in the 'create status bar sprite...' block and see it doesn't let you.
  4. Try to rename "Food" in the 'create status bar sprite...' block and see it lets you and then causes errors throughout the code.

Expected behavior You should be able to rename "Energy" and not "Food."

Screenshots RenameKindsError

jwunderl commented 1 year ago

Ah now I see why I couldn't repro the behavior on my end; energy is actually the built in StatusBarKind for status bars, so that part's correct: https://github.com/jwunderl/pxt-status-bar/blob/master/status-bar.ts#L61 and food is the kind the user made; the issue here is that it tried to change Food's of the other kind and not just the ones that are statusbarkinds

@riknoll bit of an edge case I suppose. I'd guess we might actually have wanted to disallow the user from creating a kind with the same name in different 'namespaces' in the first place?

jwunderl commented 1 year ago

fixed in https://github.com/microsoft/pxt/pull/9590