I’m on Linux, using vim and I use clangd as my language server. The code compiles fine but it always gives me something missing, e.g. Use of undeclared identifyer ‘Serial’ and In included file ‘avr/pgmspace.h’ file not found, among others.
Because of these errors a lot of language server functions dont work.
Please open an issue in Issues · platformio/platformio-core · GitHub for that with the exact software / components tha you’re using there. Vim support was previously corrected per this issue but if you say both is broken, it might be in need of another update. All I see is that
is correctly in the include paths where Arduino.h is, which includes all other headers for Serial and digitalWrite() etc. So if your code has a #include <Arduino.h> at the top and it still can’t find the functions, that’s a bug.
it does have the Arduino include. with ccls I get no error on the line #include but I get it everywhere else. with clangd I get the error even on the #include line usually refering to a missing stdlib.h (huh!!!) or some other Atmel header
Well in that folder there should be the file avr/pgmspace.h that it can’t find, although the folder is declared to it in the .ccls file.
This doesn’t look like a error on the user side. This example is so simple and clear that it shouldn’t fail. It failing indiciates that either PlatformIO generates the .ccls file wrongly or something else has a bug. Please open an issue per link above with your project information (platformio.ini + code), error screenshot, and used vim / plugins versions.