General VS Code usage questions...

Hi,

Really enjoying VS Code for ConnectIQ, despite some teething troubles. But frustrated with not being able to workout simple things that I am sure are really, really easy if you know how.

And I am certain that I am not alone!

So....

Rather than deluge the forum with lots of related threads, can we have this one as a general discussion thread for Q & A specifically for VS Code?

I'll start:

1. When you start running apps, (Ctrl+Shift+P >> "Connect IQ: Run app") it gives you a nice, searchable list of devices to get you started. But the second time you run it, that list is gone. How can I select a different build target for the simulator without restarting VS Code?

2. For testing an app, I need to use compiler args: Is there a keyboard shortcut to open Connect IQ settings as I need to change them a lot?

  • 1. Do a "Connect IQ: Build Current Project" before you do a "Connect IQ: Run App".  You can select the target at build time.

  • Thanks, Jim.

    One more;

    3. Are breakpoints supported yet? Pressing F9 in VSCode doesn't seem to do anything.

  • 2. For testing an app, I need to use compiler args: Is there a keyboard shortcut to open Connect IQ settings as I need to change them a lot?

    ctrl-, on Windows, cmd-, on Mac

    3. Are breakpoints supported yet? Pressing F9 in VSCode doesn't seem to do anything.

    We haven't added debugging support yet, but it's on the roadmap.

  • ctrl-, on Windows, cmd-, on Mac

    Thanks, and I hope I'm not being too picky, but that only gets to settings in general. I was hoping to be able to preselect the connect iq settings. 

    Otherwise, I have to type in a whole additional seven characters in order to get the right settings!  Slight smile

  • Do a "Connect IQ: Build Current Project"

    This, however, is worth the move all on its own.

    I can test through a gazillion different products without taking my hands off the keyboard even once!

    Ctrl+Shift+F9 to bring last command (which is build for me), Enter to bring up menu, type a few letters of the device I want to select it, Enter to build then F5 to test! Then Alt+Tab, rinse and repeat.

  • Thanks, and I hope I'm not being too picky, but that only gets to settings in general. I was hoping to be able to preselect the connect iq settings. 

    If you right-click on the Settings tab you can choose Pin or Keep Open. If the Settings tab is open and you do the keyboard shortcut to open it, it should bring you to the same place you left it. 

  • The other option is you can create workspaces and customize the CIQ and other settings per workspace.

    This can be useful if you have different settings required per project.

    To get started save a workspace then add your project folder to it.  When you open the settings it will default to the global but there is a workspace tab option at the top of the settings list.

    This has been useful for me as I have a couple apps in the store under a personal dev key and am working on an app for someone else with a separate dev key.  The workspace lets me easily switch between them with out having to reconfigure the settings each time.

  • I've installed VS Code (I'm not very familiar with it) on a MAC (I assume connectIQ will run under a VSCode on a mac as well as windows?).  Have setup and verified the connect IQ installation - all good.  Have run the Build for device command - seems to complete and creates the .prg file in the bin directory.  When I choose Run App from command pallette nothing happens.  I'm expecting the simulator to start, yes - like in eclipse?  I can see the command line is different compared to eclipse:

    Eclipse:

    BUILD: /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/bin/java -Dfile.encoding=UTF-8 -Dapple.awt.UIElement=true -jar /Users/rda/Library/Application Support/Garmin/ConnectIQ/Sdks/connectiq-sdk-mac-3.2.3-2020-10-13-c14e609bd/bin/monkeybrains.jar -o /Users/rda/OneDrive/Home/GarminConnect/eclipse-ws/TrainingPower/bin/TrainingPower.prg -w -y /Users/rda/OneDrive/Home/GarminConnect/developer_key -d edge530_sim -s 3.1.0 -f /Users/rda/OneDrive/Home/GarminConnect/eclipse-ws/TrainingPower/monkey.jungle

    VSCode:

    > Executing task in folder TrainingPower: java -Dfile.encoding=UTF-8 -Dapple.awt.UIElement=true -jar /Users/rda/Library/Application Support/Garmin/ConnectIQ/Sdks/connectiq-sdk-mac-3.2.3-2020-10-13-c14e609bd/bin/monkeybrains.jar -o /Users/rda/OneDrive/Home/GarminConnect/eclipse-ws/TrainingPower/bin/TrainingPower.prg -f /Users/rda/OneDrive/Home/GarminConnect/eclipse-ws/TrainingPower/monkey.jungle -y /Users/rda/OneDrive/Home/GarminConnect/developer_key -d edge530 -r <

    Is there something I'm missing?

    Thanks.

  • Is it possible that the "Run App" on a MAC install is only doing the Build part of a run?  That would be consistent with what I'm seeing - I see that the .PRG file is rebuilt each time i do the "Run App", but nothing else happens.

  • Is it possible that the "Run App" on a MAC install is only doing the Build part of a run?

    I think it is more likely that the build step of the command is working and there is an issue with the run app step.

    If the app build was successful, you should be able to run the app from a Terminal (either in vscode or outside). The steps to temporarily setup your environment to build/run from the command line are in the ConnectIQ Basics documentation here:

        https://developer.garmin.com/connect-iq/connect-iq-basics/getting-started/

    Starting simulator and then launching the app from the command line would potentially produce a warning/error that would help to determine why it is not working.