Big update to prettier-extension-monkeyc

I've posted about prettier-extension-monkeyc before, but I've added a bunch of new features that developers will probably like (well, I've been missing them, so maybe you have too).

The new features it implements for VSCode include:

  • Goto Definition. Point at a symbol, Ctrl/Cmd click, and it will take you to the definition. Or F12
  • Goto References. Right click on a symbol and select "Goto References". It will show you all the references. Or Shift-F12
  • Peek Definition/Peek References. Same as above, but in a popup window so you don't lose your place in the original document.
  • Rename Symbol. Right click on a local, function, class or module name, and select "Rename Symbol". It will rename all the references. It doesn't yet work for class members/methods.
  • Goto Symbol. Type Ctrl/Cmd-Shift-O and pick a symbol from the drop down (which has a hierarchical view of all symbols in the current file). This also appears as an outline across the top of the file.
  • Open Symbol By Name. Type Ctrl/Cmd-T, then start typing letters from a symbol name. A drop down will be populated with all matching symbols from anywhere in your project.

Older features include a prettier based formatter for monkeyc, and a monkeyc optimizer that will build/run/export an optimized version of your project.

[edit: My last couple of replies seem to have just disappeared, and the whole conversation seems to be in a jumbled order, so tldr: there's a new test-release at https://github.com/markw65/prettier-extension-monkeyc/releases/tag/v2.0.9 which seems to work for me on linux. I'll do more verification tomorrow, and push a proper update to the vscode store once I'm sure everything is working]

  • Maybe is safe on condition they update mir, json etc. (in my case problem was with venusq, fr55 so it means mir wasn't updated).

    Increasing version in json cause users who doesn't want to upgrade firmware (I know such users, sometimes I do it myself due to bug in firmware) cant' install new app.

    And what about APAC user, wait have to wait years for new firmware.

  • I'm not sure if that assumption is really true. If even Garmin had a related bug, then maybe it's not worth risking it. That being said, I do the same optimization, but manually (using jungle), but even that is based on assumptions I will never be able to confirm 100% (namely what is the real minimum version each device can have, that is the lowest version such device ever came out of the factory, which as noted unfortunately is not what one might think based on the data of the compiler/simulator json files) The difference is however that if I make a mistake then my one app won't work on one old device, and if it's reported to me I can quickly fix it, but Prettier Monkey C is a general use tool that should work for many apps.

  • Increasing version in json cause users who doesn't want to upgrade firmware (I know such users, sometimes I do it myself due to bug in firmware) cant' install new app

    My point is that if you compile with the latest device files, your users will be forced to update anyway. Or at least, that's what appears to have happened with my app.

    My app doesn't use, or test for any 4.2 features, but I did build it using the latest device files (ie, I run the sdk manager regularly, and download any new sdk, and any new/updated device files on a fairly regular basis). My build says it requires 1.2.0 or later, so it would definitely have run correctly on an fr955 with 4.1.x. But the store wouldn't let me download it without updating the firmware.

    And what about APAC user, wait have to wait years for new firmware

    That's fine, because the compiler.json has a separate ciq version for APAC.

  • I'm not sure if that assumption is really true

    I'm not quite sure what assumption you're referring to there.

    It seems that the ciq store enforces the versions listed in the compiler.json file at the time you build your app (as illustrated by my fr955 example). If thats the case it should be safe to optimize based on the assumption that the minimum version is at least that listed in the current compiler.json file.

  • "It seems"... "If that is the case" These are assumptions. Based on anecdotal reports from 1.5 users via a developer. I'm not saying that it's not true, but I am not convinced. If Garmin could say anything about it would be very useful...

    My assumption is that what triggers the firmware needs to be upgraded notification is not related to which app you try to install, but maybe something like the minimal fw version ConnectIQ requires on that device. But maybe I'm wrong. The only time I've seen such notification was at the first time I used the watch after unboxing it.

  • "It seems"... "If that is the case" These are assumptions. Based on anecdotal reports from 1.5 users via a developer. I'm not saying that it's not true, but I am not convinced. If Garmin could say anything about it would be very useful...

    My assumption is that what triggers the firmware needs to be upgraded notification is not related to which app you try to install, but maybe something like the minimal fw version ConnectIQ requires on that device. But maybe I'm wrong. The only time I've seen such notification was at the first time I used the watch after unboxing it.

  • I'm not saying that it's not true, but I am not convinced.

    For what it's worth, makes sense to me. It seems that the assumption could be tested by changing the version in the device files by hand, assuming that the store won't reject your app if you've set the device version to be too new or something.

    My assumption is that what triggers the firmware needs to be upgraded notification is not related to which app you try to install, but maybe something like the minimal fw version ConnectIQ requires on that device.

    But the firmware is what provides "Connect IQ" to the user / app. "Connect IQ" seemingly doesn't require anything, it's a given CIQ app that seems to require a certain version of firmware / Connect IQ. This can be seen when looking at how the minApiVersion build setting works. For devices that have APAC variants which are behind their WW counterparts in CIQ version (both in the real world and in the device files), if you set minApiVersion too high, the app won't even be built for the APAC part numbers in question.

    I realize none of that proves anything, but the assumption is at least testable in theory. Create a regular beta app with lowest minApiVersion possible and try to install it on your watch which has a firmware version >= to the version in the device file. It should install without issues. Now bump up the firmware version in the device file, build again, and try to install it again. Assuming the store doesn't reject the upload, what happens next should either prove or disprove the theory: the app should either install without issues, or the store should tell you to upgrade your device firmware.

    It might help if you have a device which was never upgraded to the latest firmware which is listed in the device file. That way you could avoid any possible issues with the back end trying to validate the version that it sees in the app. Ofc then you'd have to decrease the version in the device file for testing.

    Also, I opened an old exported IQ file, and manifest.xml looks like this (reformatted for readability):

        <iq:application apiVersion="4.1.5"
          entry="someApp"
          id="..."
          launcherIcon="@Drawables.LauncherIcon"
          minSdkVersion="1.3.0"
          name="@Strings.AppName"
          type="datafield"
          version="0.0.0">
            <iq:products>
                <iq:product
                   connectIqVersion="2.4.2"
                   filename="006-B2497-00/someApp.prg"
                   id="vivoactive_hr"
                   minFirmwareVersion="440"
                   partNumber="006-B2497-00"

    The fact each device has a connectIqVersion property and minFirmwareVersion property in the manifest lends credence to the theory.

  • So I saw the following stickied post in the CIQ Discussions forum:

    forums.garmin.com/.../apac-device-configuration-updates

    We published updates to the device configurations for the APAC versions of the following products today to address a a problem some customers may encounter when attempting to install apps from the app store:

    • fenix 6 Pro
    • fenix 6S Pro
    • fenix 6X Pro
    • Forerunner 55
    • MARQ Adventurer
    • MARQ Athlete
    • MARQ Aviator
    • MARQ Captain
    • MARQ Commander
    • MARQ Driver
    • MARQ Expedition
    • MARQ Golfer

    If your apps support any of these devices, please update your device configurations with SDK Manager, rebuild, and update your apps on the app store. Apologies for any inconvenience!

    Before updating my devices, I made a copy of the existing folder.

    This is the change for fenix6xpro's compiler.json (previous contents on the "left"):

    > diff -u "Devices - Copy"/fenix6xpro Devices/Fenix6xpro
    --- "Devices - Copy/fenix6xpro/compiler.json"   2023-07-02 16:53:20.480442900 -0400
    +++ Devices/Fenix6xpro/compiler.json    2023-07-13 17:29:12.870642900 -0400
    @@ -269,8 +269,8 @@
                 "number": "006-B3291-00"
             },
             {
    -            "connectIQVersion": "3.4.2",
    -            "firmwareVersion": 2589,
    +            "connectIQVersion": "3.4.1",
    +            "firmwareVersion": 2510,
                 "languages": [
                     {
                         "code": "eng",
    @@ -312,8 +312,8 @@
                 "number": "006-B3516-00"
             },
             {
    -            "connectIQVersion": "3.4.2",
    -            "firmwareVersion": 2589,
    +            "connectIQVersion": "3.4.1",
    +            "firmwareVersion": 2510,
                 "languages": [
                     {
                         "code": "eng",

    It's just anecdotal evidence but I'd guess this change was made bc APAC doesn't have firmware 25.89 / CIQ 3.4.2 yet (maybe it isn't 100% rolled out), which means that they would be unable to install CIQ apps which were built with that configuration.

    The fact is that having the "wrong" firmware / CIQ version in compiler.json caused a problem with installing apps in the store (if we take that post at face value). Since users don't literally install a "CIQ version" on their device, they install a version of firmware (which includes a version of CIQ), it stands to reason that it's the firmware version in compiler.json that was causing a problem. I assume that the CIQ version is for the compiler (e.g. in order to implement the behavior of minApiVersion which excludes part numbers from the build which don't support the specified min API version..)

  • The fact each device has a connectIqVersion property and minFirmwareVersion property in the manifest lends credence to the theory

    Nice find! That seals it for me - this is clearly what the field is there for.

  • Before updating my devices, I made a copy of the existing folder

    Another great find!