Correct configuration of Suggestions and IntelliSense Index

Hello everyone,

try to use a shared library across multiple microcontroller projects using PlatformIO. Therefore I use the lib_extra_dir= tag in the “platform.ino”.

Usually my “platform.ini” looks like

; [env:uno]
; platform = atmelavr
; board = uno
; framework = arduino

platform = atmelavr
board = nanoatmega328
framework = arduino

upload_port = com7
monitor_port = com7
lib_extra_dirs = D:\software\uc\libaries
lib_deps = 

The library folder is in the workspace of the projects in development. The explorer looks like

 - lib1
 -- lib1.h
 -- lib1.cpp
 - lib2
 -- lib2.h
 -- lib2.cpp
 -- lib2_helper.h

 - main.cpp
 - Somefiles.h

 - main.cpp
 - Somefiles.h

My problem: Not all variables are found or visualized correctly.

The project compiles without errors and the “missing” variables can be followed with “Ctlr+LeftMouse”. Also the suggestions are not showing when writing an function and using “Ctlr+Space”.

From other suggestions I tried [thread1] rebuilding the IntelliSense (Intellisense VSCODE not giving suggestions) . Another post tried to reconfigure the “Cpp Extension” to

It does not solve my problems.

My questions:

  • Are external libraries excluded from the IntelliSense functions?
  • Is the folder depth too deep for the external functions?
  • Is there a special build process to include external files?
  • Is there an extension missing?

I may have a temporary solution. The ‘main.cpp’ was not opened in the window, only many other .h and .cpp files. Since I worked on a specific library the main.cpp was probably closed to sort the winodw.

After reopening it and compiling once again, the “undefined error” disappeared and the suggestions are back.

It works (for now) but is satisfactory. I do not understand why the main.cpp needs to be active in the IDE-Window at the time of compilation.