VSCode monkeyC autocomplete not using my variables / methods etc

I'm probably doing something wrong, or at least I hope that the official Garmin plugin is not that simple, but damn the development in VSCode is so uncomfortable. I have the official Garmin Monkey C plugin installed, it does compile, debug, handles manifest so those parts are good, but the coding support is terrible.

One bug among many is that variables and methods I created myself are not offered by the code plugin. The API methods, classes, variables, constants are more or less offered, if I want to enter a variable , method, function etc that I created myself, it is not offered.

However, if I manually type it again once, it will "inserted into the dictionary" and bring it up. It's the same with e.g. my own classes, nothing is offered, only if I enter it manually - but then it's just a simple word, it's in the list, it doesn't really recognize it.

The other thing I miss is that even if I comment something, it doesn't display any of it - this is also the case with the factory API, if there is a comment at all.

But it also doesn't care if I hover my mouse over something, it doesn't even try to interpret it, whether it's a language instruction, an API or its own code.

It's not possible to click on a method to get to its definition, and even the quick navigation in the right sidebar doesn't work, because it doesn't recognize any symbol.

Is this how it "normally" works, or is there something I have configured wrong, missing etc?

Top Replies

  • the coding support is terrible

    The good news is a lot of language-related features have been added in the 8.0.0 beta SDK, such as:

    - real time errors/warnings as you type

    - list of symbols…

All Replies

  • the coding support is terrible

    The good news is a lot of language-related features have been added in the 8.0.0 beta SDK, such as:

    - real time errors/warnings as you type

    - list of symbols in the Outline pane

    - smart autocomplete for symbols, which offers symbols available in the current context (e.g. at the current scope or at a specified class/instance/module name), including symbols that you define yourself

    (It looks like they finally implemented a Monkey C language server for VS Code.)

    You may have to (successfully) build at least once after switching to 8.0.0 to kick off support for these features.

    You can't export projects for upload to the store with a beta SDK, and the beta SDK has known bugs, so to take full of advantage of these features we'll all have to wait until a non-beta 8.x.x SDK is released.

    See this announcement for more info:

    https://forums.garmin.com/developer/connect-iq/b/news-announcements/posts/system-8-beta-now-available

    I've tried out the beta, and it looks like some of the promised features don't (yet) work properly (or at all), such as finding all references of a symbol or going to the definition of a symbol. Since they're listed in the announcement, I assume they will work properly at some point.

    One annoying limitation is that a lot of these features - such as hovering or the outline - stop working if you introduce a syntax error in your code. I'm guessing this is due to the fact that the parser they use (ANTLR afaik) isn't able to partially parse source which contains syntax errors, so any further analysis isn't possible until your program is syntactically correct. (I can think of a way around this, but they apparently didn't go that route.)

  • Thanks for the good news! Yes, I see the new SDK but I prefer to stay on stable, I have enough problem without beta testing :D So that I wrote is the normal plugin working, no need to find any misconfiguration and so on. We hope the new improved SDK will stable soon.

  • I saw that announcement but when I tried 8.0.0-Beta without the Prettier Monkey C plugin, then I had the impression that it doesn't really work.

  • Like I said, afaict, some of the features work (outline, real-time errors/warnings, autocomplete, hovering) and others do not (go to definition, find all references).

    You do have to manually build once before any of the features will work, in my experience. This kind of makes sense as the language server wouldn’t know which device to use it for its own build process otherwise.