Autocomplete not working as described

Following the instructions from https://www.arduino.cc/en/Tutorial/getting-started-with-ide-v2/ide-v2-autocomplete-feature/ I cannot make Autocomplete work as described

With a new sketch loaded and Arduino Nano selected as the board type, typing pin as suggested brings up an autocomplete suggestions list with pinMode at the top, and clicking on that or pressing return selects it. uint8_t pin is automatically selected as described, but typing but typing LED does not bring up the suggestion of LED_BUILTIN as described. Typing the name in full and hovering over it does show the fact that it is a macro with a value of 13 and right clicking and selecting Go to Definition opens pins_arduino.h showing how the macro is defined so it is obviously known to the editor

I am also able to reproduce this. What I notice is it only happens when I'm in this mode of auto-selected arguments. If I don't use autocomplete to get pinMode signature, or if I move the cursor away from the autocompleted pinMode signature, then go back and start typing LED_BUILTIN, then it works as expected.

I suspect that the tutorial author happened to do that because they were producing the tutorial at the same time and this is why they didn't notice that it doesn't work as claimed. The fact that "uint8_t mode" is not higlighted in the screenshot also makes me think this.

To me, the fact that this occurs only under specific conditions, and reliably so, indicates that the investigation and fix might be more straightforward than a random autocomplete fail that doesn't seem to have any particular pattern of occurrence (there were some of those in the early days).

Please open a bug report for this on GitHub:

I'm uncertain whether the issue originates in the IDE code or the Arduino Language Server. I took a look at the language server logs (saved to the sketch folder when you have File > Preferences > Enable language server logging checked) and, even though I don't really know what I'm looking at, I get the feeling this is from the IDE. The developers can always transfer it to the Arduino Language Server repository if the problem ends up to be with that software.

Issue #206 added on GitHub

Thanks @UKHeliBob!

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.