Problems found in libraries included as symlinks or by lib_extra_dirs are NOT found

@ivankravets Its been awhile but im now back to a bit of programming and loving the progress of PIO. Good work. I am very taken by VSCode and it is potentially a game changer for me, but I find this problem frustrating. I have been trying for days now to fix it. It is a common problem but the VSCode people always point to the extension being the culprit. I had found an issue somewhere ( and have just searched for it for 30mins and cannot find it ) where you said that this is due to .ino file being used and not a .cpp file. I am using a .cpp file here and I still get it.

I am using
VSCode - Version: 1.51.1
PIO - PlatformIO 5.0.3
PIO IDE - v2.2.1

If I build a project with a lib symlinked in the ./lib folder I get the following error when I click on a compile “problem”

If I make a copy of the whole library, in this case ESPManager, and place it in a folder which I then add to platform.ini as a lib_extra_dirs I get exactly the same error.

If I then copy the actual directory to the ./lib folder in project root then it works as expected.

Looking at the error message it is resolving the path incorrectly by adding
/Users/amelvin/git/MySONOFF
with
/Users/amelvin/git/PangolinMQTT/src/PANGO.cpp

when the first part is the project root and the second part is the full path of the symbolic or extra_dirs lib.

This is essentially a fresh install, VSCode + PIO IDE… and nothing else.

Any ideas would be appreciated.

Does VSCode only show you this error when clicking on the include file or does compilation of the project when using the build button fail too? (To see whether it’s a problem on the VSCode side or platformio-core side)

The build functions just fine. If I click on the link in the “problems list” it fails. If I cmd+click on the file name highlighted in the build terminal it opens just fine.


Screen shot above shows the “problem”… i’ve enabled a warning… and I get can’t open file…


This one shows the link in the build task terminal… if i cmd click it opens just fine.

Both of these examples are the same error taken from the same build run. I just changed from “problems” to “terminal” tab.

Then the problem is in the PlatformIO VSCode extension or VSCOde itself. File an issue in Issues · platformio/platformio-vscode-ide · GitHub for further processing.

cool will do. thank you