IDE 2.3.2 cant find header files for autocomplete / peek definition

I am on linux primarily, and used Arduino IDE on Ubuntu Noble without major issue. I switched to arch for newer packages for other programs, and when I installed arduino-ide, it launches fine. However, I cannot see pin definitions, member functions, or any autocomplete results in any .ino files I create. They work for the example sketches but not any sketches I create myself.

Tried using wine/winetricks to run the windows version of the IDE but it crashes after loading.

I can compile sketches just fine, but it is a real hindrance to not be able to see the value of preprocessor definitions or even to autocomplete the member functions of classes. I would appreciate any help.

more version info:
uname:

Linux archlinux 6.10.8-arch1-1 #1 SMP PREEMPT_DYNAMIC Wed, 04 Sep 2024 15:16:37 +0000 x86_64 GNU/Linux

arduino-ide version:

Version: 2.3.2
Date: 2024-02-20
CLI Version: 0.35.3

hwinfo --short

cpu:                    
                       Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz, 4544 MHz
                       Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz, 4592 MHz
                       Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz, 4563 MHz
                       Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz, 800 MHz
                       Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz, 4566 MHz
                       Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz, 4596 MHz
                       Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz, 4592 MHz
                       Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz, 800 MHz
                       Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz, 4361 MHz
                       Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz, 4484 MHz
                       Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz, 4315 MHz
                       Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz, 4550 MHz

mouse:
  /dev/input/mice      1A582011:00 06CB:CD73 Mouse
  /dev/input/mice      1A582011:00 06CB:CD73 Touchpad
monitor:
                       LG Display LCD Monitor
graphics card:
                       nVidia TU106M [GeForce RTX 2070 Mobile / Max-Q Refresh]
                       Intel CometLake-H GT2 [UHD Graphics]
sound:
                       Intel Comet Lake PCH cAVS
                       nVidia TU106 High Definition Audio Controller
storage:
                       Samsung Electronics NVMe SSD Controller SM981/PM981/PM983
network:
  enp2s0               Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
  wlan0                Intel Wi-Fi 6 AX201 160MHz
network interface:
  wlan0                WLAN network interface
  enp2s0               Ethernet network interface
  lo                   Loopback network interface
disk:
  /dev/nvme0n1         Samsung Electronics NVMe SSD Controller SM981/PM981/PM983
  /dev/zram0           Disk
partition:
  /dev/nvme0n1p1       Partition
  /dev/nvme0n1p2       Partition
usb controller:
                       nVidia TU106 USB 3.1 Host Controller
                       Intel JHL7540 Thunderbolt 3 USB Controller [Titan Ridge 2C 2018]
                       Intel Comet Lake USB 3.1 xHCI Host Controller
bios:
                       BIOS
bridge:
                       Intel JHL7540 Thunderbolt 3 Bridge [Titan Ridge 2C 2018]
                       Intel Comet Lake LPC Controller
                       Intel 6th-10th Gen Core Processor PCIe Controller (x16)
                       Intel PCI bridge
                       Intel JHL7540 Thunderbolt 3 Bridge [Titan Ridge 2C 2018]
                       Intel 10th Gen Core Processor Host Bridge/DRAM Registers
                       Intel PCI bridge
                       Intel JHL7540 Thunderbolt 3 Bridge [Titan Ridge 2C 2018]
                       Intel Comet Lake PCI Express Root Port #9
                       Intel JHL7540 Thunderbolt 3 Bridge [Titan Ridge 2C 2018]
hub:
                       Linux Foundation 3.0 root hub
                       Linux Foundation 2.0 root hub
                       Linux Foundation 3.0 root hub
                       Linux Foundation 2.0 root hub
                       Linux Foundation 2.0 root hub
                       Linux Foundation 3.0 root hub
memory:
                       Main Memory
bluetooth:
                       Intel Bluetooth Device
unknown:
                       FPU
                       DMA controller
                       PIC
                       Keyboard controller
                       Intel Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Thermal Subsystem
                       Intel Comet Lake HECI Controller
                       Intel Comet Lake PCH SPI Controller
                       Intel Comet Lake PCH Serial IO UART Host Controller #0
                       Intel Comet Lake PCH Thermal Controller
                       Intel JHL7540 Thunderbolt 3 NHI [Titan Ridge 2C 2018]
                       Intel Comet Lake PCH Serial IO I2C Controller #0
                       nVidia TU106 USB Type-C UCSI Controller
                       Intel Comet Lake PCH Shared SRAM
                       Intel Comet Lake PCH SMBus Controller

Hi @deconstructme

Is there anything notable about the path under which you saved those sketches?

No, I used the default path. Thank you for the quick reply!

Uhh I'm not going to consider this solved because I still have no idea what happened or how to fix it if it happens again but after I installed wine/winetricks and arduino-ide for windows, and hwinfo for some reason I am now seeing all the information I wasn't. Didn't relaunch the app or reboot my computer or anything. I am going to look at my package manager logs real quick. I swear I didn't just make this post right after I saw the issue, I've been debugging this all day.

I'm not seeing anything related to arduino since I installed it (on the 4th), the issue seems to have solved itself for now, I fell asleep right after I installed wine-mono and iirc it still wasn't working until I installed hwinfo. It seems to still work after I kill and restart arduino-ide. I would really like to look into what caused this however.
I am unsure where to continue debugging from here. I don't want to consider this solved because I have no idea why it would randomly start working. I've been keeping all my packages up to date every time I use this computer, which is daily. Any help would still be appreciated.

That happens to me as well on my Mac. I have yet to notice a pattern, but some work some don't (Not my sketches, system or library)
I wonder if it has anything to do with the message I sometimes see lower left about indexing something?

Maybe, I know that the issue persisted after the indexing was done, so I don't know. If I were to guess I would say that the wine installation of arduino IDE somehow retrieved some dependencies that the native version didn't retrieve, and then now that the native version has those dependencies it can run fine.

Though I would be surprised if that was the case or at least the whole story, as I haven't found any similar issues online. It could have been a fluke, maybe I interrupted some startup routine that never got run again for the native version.

Wait, I think I maybe figured it out. I need someone from Arduino Team to confirm but I think the issue just happened again when I lost internet connection. The IDE stopped showing me info from included libraries until I killed and restarted the IDE when I regained connection.
I'll update this if it happens again.

One of the heavyweights here told me about an option to enable keyboard control of the 'suggestions'. On my Mac it's control spacebar, windows is Cmd spacebar? also Linux?
To enable, bring up the command palette which for me is shift command p, not sure about windows/linux. Another useful keystroke is show parameters which is shift command space for Mac, Attached are what they look like.




1 Like

When the issue is occurring it just shows suggestions based on text in the file I am currently editing. For example, if I have a variable foo and type f and then CTRL+SPACE it suggests foo, however if I #include <Wire.h> and then type Wire. and then CTRL+SPACE it suggests nothing related to the Wire library or class.

Working fine for me, your experience now suggests a messed up installation.

I just tried with Wire. I am not real familiar with what I should see but looking at an examp[le I can see there are a couple that start with b.
Are you on a Mac? Control on a Mac is NOT the same on a Win/Linux, I think it's Command.

I am on Linux. The image you posted is the expected result. I just tested this again, and weirdly, it works for one file I made,

but not another.

(Note: the issue persists regardless of the target board selected)

Was that triggered by keyboard? Did you notice if the msg re indexing bottom left was still running or not.

Hey @ptillisch . Could you please check the new posts on this thread? I am still suffering from this issue. I have tried a full reinstall, purging all arduino directories. I have tried changing the target board, I have tried creating a new file and copying the code from the problem file to the new one, I have tried everything I can think of save for reinstalling my distro, which I doubt would help as I have had no issue with any other programs.

I triggered the suggestion boxes on both images with the keyboard. I waited until the indexing was done for both images. Thanks for the quick reply, by the way :slight_smile:

Interestingly, in the problem file, the Serial library (which is included by default) does in fact show autocomplete suggestions (for now).

20240914_14h19m04s_grim

However any library I include myself does not

Pictured below are my includes, for reference.

20240914_14h21m27s_grim

The "context-aware" features (e.g., autocomplete, "IntelliSense", suggestions, "Go to Definition") only work for objects from a library after one of these events occurs following the time of the addition of the #include directive for a library's header file in a sketch:

  • The sketch is opened in Arduino IDE
  • A different board is selected in the Arduino IDE menus
  • The sketch is compiled

The reason for the deferred awareness of objects from libraries compared to the awareness of other objects in the sketch (which is updated after every edit to the code) is that the awareness of library objects is dependent on a process known as "library discovery", where Arduino IDE scans all installed libraries for a header files matching the #include directives of the sketch program and picks which libraries to add to the compiler's "search path". That "library discovery" process is somewhat resource intensive. The overhead of that resource usage is insignificant when it is done as part of the occasional manually triggered compile operation, but more significant when it comes to the continuous processing that is done to support the "context-aware" features. The developers decided to change to this "deferred discovery" approach for the "context-aware" feature support in response to user complaints that the previous approach was too heavy for lower spec PCs.

1 Like

Thank you for the response, I have tried all three of these things. The result is that now neither sketch shows the intended behavior on bringing up the autocomplete menu.

I am going to install a windows VM at this point because I cant get it to work on WINE either (crashes to desktop at best) and any posts regarding getting ide v2 working on WINE is quickly (and rudely) shut down by another forum member. I will post here again if anything notable happens.

I just did a small test, before compile no work, after compile it works. BUT, my memory (highly flawed at 82) is it is flaky, sometimes works, sometimes does not. Is that 'Index' thing not involved also?