Due to cross development, I use the Visual Studio Code to do C++ development for work. I love being able to use the PlatformIO IDE for my Arduino hobby. Unfortunately I came across an issue that I can work around, just not sure why I have to.
When I have the Clangd Language Server installed and enabled the Text editor will no longer find the Arduino.h file giving that nice red Squiggly under the name. Weird thing it it compiles and uploads just fine with no issues. I can modify the code, upload it and make changes. Only thing is you get all these “Problems” that are not problems… it just cant seem to find <Arduino.h> so Intellisense fails to work… It fails to locate any of the libraries used, yet compiles just fine.
If I go to the vscode-clangd and “Disable (Workspace)” then reload… everything works again as advertised. Obviously the workaround works… but why? I don’t do this with other extensions, only PatformIO. What is it about its clang integration that fails with the new clangd server?
My environment is:
C:\Users\tom\Documents\PlatformIO\Projects\180203-011250-feather32u4>pio platform list
atmelavr ~ Atmel AVR
Atmel AVR 8- and 32-bit MCUs deliver a unique combination of performance, power efficiency and design flexibility. Optimized to speed time to market-and easily adapt to new ones-they are based on the industrys most code-efficient architecture for C and assembly programming.
Home: PlatformIO Registry
Frameworks: arduino, simba
Packages: toolchain-atmelavr, framework-arduinoavr, framework-simba, tool-avrdude, tool-micronucleus
Version: 1.8.1
atmelavr ~ Atmel AVR
Atmel AVR 8- and 32-bit MCUs deliver a unique combination of performance, power efficiency and design flexibility. Optimized to speed time to market-and easily adapt to new ones-they are based on the industrys most code-efficient architecture for C and assembly programming.
Home: PlatformIO Registry
Frameworks: arduino, simba
Packages: toolchain-atmelavr, framework-arduinoavr, framework-simba, tool-avrdude, tool-micronucleus
Version: 8a06be6
C:>echo %PATH%
C:\Python27;C:\Python27\Scripts;C:\WinAVR-20100110\bin;C:\WinAVR-20100110\utils\bin;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\PuTTY;C:\Development\Microchip\MPLAB C32 Suite\bin;C:\Development\HI-TECH Software\PICC\PRO\9.65\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Program Files\Git\cmd;C:\Users\tom\AppData\Local\Microsoft\WindowsApps;C:\Program Files (x86)\Nmap;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;;C:\LLVM\bin;C:\Development\Microsoft VS Code Insiders\bin
C:>git --version
git version 2.16.1.windows.1
C:>clang --version
clang version 5.0.1 (tags/RELEASE_501/final)
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\LLVM\bin
C:>python --version
Python 2.7.14
C:>