sweetpad-dev / sweetpad

Develop Swift/iOS projects using VSCode
https://marketplace.visualstudio.com/items?itemName=sweetpad.sweetpad
MIT License
619 stars 20 forks source link

command `> SweetPad: Stop simulator` doesn't work #24

Closed aelam closed 4 months ago

aelam commented 4 months ago

probably it should show a secondary list to choose a simulator to stop

{
  "message": "Cannot read properties of undefined (reading 'udid')",
  "level": 3,
  "time": "2024-07-06T15:47:40.392Z",
  "command": "sweetpad.simulators.stop",
  "error": {}
}
hyzyla commented 4 months ago

Thanks! Fixed in that commit https://github.com/sweetpad-dev/sweetpad/commit/4fcd94b812d5fc5e2b9eff75d2a53ed7b518c8b. I'm going to release that fix later this week.

The general problem exists because to each button on sidebar view attached one command, and that command also exists outside of the sidebar item. Every time a new command for a sidebar item is created, it should include logic for working without a selected item. I haven't found a solution to define a command specific to the context menu without also contributing it to the command palette.

CleanShot 2024-07-06 at 18 58 31@2x

hyzyla commented 4 months ago

I also added the same logic for the "Start Simulator" command. If you try to execute the "Start Simulator" command from the Command Palette, the extension will ask you to choose which simulator to start. https://github.com/sweetpad-dev/sweetpad/commit/5816d92bbfa5b93c946104163d21618a0908a522

hyzyla commented 4 months ago

This fix is released in new version