Monkey C Visual Studio Code Extension
The Monkey C extension adds support for using the Connect IQ SDK, including a syntax highlighting editor, build integration, and integrated debugger. The Monkey C extension requires Visual Studio Code, version 11 or higher of the Oracle Java™ Runtime Environment, and Connect IQ SDK version 4.0.6 or higher.
This Monkey C extension offers several features, including:
Real-Time Errors and Warnings – These will display when editing Monkey C, Jungle, Settings, MSS and Resource XML files. Any reported errors or warnings will display in the Problems tab.
Autocompletion – When editing Monkey C, Jungle and MSS files, autocompletion suggestions will be based on the detected scope. In the Monkey C editor, you can autocomplete functions with argument and type information by autocompleting the function keyword in a class or module.
References – You can find all references of any class or module member by right-clicking on it and selecting “Find all References” from the context menu. You can also search for a symbol in the document by summoning the command palette and typing @symbol name or search the entire workspace by summoning the command palette and typing #symbol name.
Hovering – See type information about a variable, function name, class or module by hovering the mouse over the symbol in question.
Go to Definition – You can jump to the definition of any class or module member by selecting “Go to Definition” from the context menu.
Folding Ranges – Comments, imports and regions of code can now be folded.
To fully take advantage of these features, your project needs to have a type check level of gradual or higher. Real time errors will be for the last device the project was built for, or the first product in the manifest if no product has been built during your current session.
Installing the Monkey C Extension
In Visual Studio Code go to the View > Extension
In the Extensions Marketplace search box type "Monkey C"
Select the Monkey C extension from Garmin
Use the Install button to install the extension in Visual Studio Code. This will require a restart of Visual Studio Code.
After Visual Studio Code restarts, summon the command palette with Ctrl + Shift + P (Command + Shift + P on Mac)
Type "Verify Installation" and select Monkey C: Verify Installation
Project Management
The following commands can be used to create a new project and export it:
| Command | Description |
|---|---|
| Monkey C: New Project | Create a new Connect IQ app or Monkey Barrel |
| Monkey C: Build Current Project | Compiles the current project against a specified device |
| Monkey C: Build for Device | Export wizard to generate a side loaded PRG for a device |
| Monkey C: Clean Project | Deletes any cached artifacts generated by the build system |
| Monkey C: Export Project | Creates an IQ or barrel file for the project |
Manifest Editing
The following commands can be used to edit and update the manifest.xml of your project:
| Command | Description |
|---|---|
| Monkey C: Edit Products | Edits the products in the manifest.xml. Only allows selecting products that support the minimum SDK version |
| Monkey C: Edit Permissions | Edits the permissions in the manifest.xml |
| Monkey C: Edit Languages | Edits the languages in the manifest.xml |
| Monkey C: Edit Application | Edits the application metadata (name, label, identifier) in the manifest.xml |
| Monkey C: Configure Barrel | Wizard to add or remove Monkey Barrels from your project |
| Monkey C: Set Products by Connect IQ Version | Allows mass selection of all products that meet a Connect IQ version |
| Monkey C: Edit Annotations | Allows adding new annotations to Monkey Barrel projects |
| Monkey C: Regenerate UUID | Creates a new application UUID for your project |
Interfacing with the Connect IQ SDK
The following commands allow you to access the SDK tools and documentation from Visual Studio Code:
| Command | Description |
|---|---|
| Monkey C: Open ERA Viewer | Opens the Error Reporting Application tool |
| Monkey C: Open Monkey Graph | Opens the Monkey Graph tool |
| Monkey C: Open Monkey Motion | Opens the Monkey Motion tool |
| Monkey C: Open SDK Manager | Opens the Connect IQ SDK Manager |
| Monkey C: View Documentation | Provides access to all of the Connect IQ SDK documentation |
Running the Program
Before running the program, make sure you have one of your source files (In the source folder with the .mc extension) open and selected in the editor.
Select Run > Run Without Debugging (Command + F5 on Mac, Ctrl + F5 on other platforms)
You will be prompted with the list of products your application supports. Select one from the list.
If all goes well, the simulator will start up and the selected watch will appear:

Running Run No Evil Tests
You can use the following command to run tests:
| Command | Description |
|---|---|
| Monkey C: Run Tests | Runs all the Run No Evil tests in your application |
Running Complication Publisher and Complication Subscriber Apps
You can use the following command to run and debug both the complication publisher and the complication subscriber apps:
| Command | Description |
|---|---|
| Monkey C: Launch Complication | Runs the complication apps in debugger |
You can also run the complication apps with or without debugging via the launch.json by adding the "Run Complication Apps" launch configuration to it.
Running App in Sensor Pairing Mode
You can use the following command to launch and debug the app in sensor pairing mode:
| Command | Description |
|---|---|
| Monkey C: Launch Native Pairing | Runs the app in sensor native pairing mode in debugger |
You can also run the app in sensor pairing mode with or without debugging via the launch.json by adding the "Run Native Pairing" launch configuration to it.
Editing the Launch Configuration
The extension will create a launch.json for your project when you run or debug your product. The launch.json provides many customization options for adding launch functionality
| Property | Required | Type | Description |
|---|---|---|---|
prg | x | Path | Absolute path to project prg file |
prgDebugXml | x | Path | Absolute path to project debug xml file |
stopAtLaunch | Boolean | When debugging, break immediately when the program launches. | |
runTests | Boolean | Run runNoEvil test cases when running this configuration | |
device | Product Identifier | Device to run or ${command:GetTargetDevice} to choose a new device each run | |
settingsJson | Path | Absolute path to project settings file | |
tests | Array of Strings | An optional array of strings listing the test names to run | |
runNativePairing | Boolean | Run app in sensor native pairing mode | |
complicationPublisherFolder | Path | Absolute path to the project folder of a complication publisher | |
complicationSubscriberFolder | Path | Absolute path to the project folder of a complication subscriber |