-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
platformio created projects don't quite work in CDT LSP #443
Comments
First step to resolve is create a
|
Second step is to allow clangd to run the compiler to obtain real includesFind the path to the compiler, in my case it was This will resolve many of the issues, and stdio.h will be picked up from the expected location now: |
Still some errors?At this point there are still errors, from what I can tell clangd is still trying to run clang somewhere to pick up some information. Here are the errors that remain: The warning on stdio.h is legitimate as I only included that line as part of my testing and the warning is hal.h not foundThis seems to be because clangd is indexing a different branch of the The CDT indexer see But the CDT LSP editor is erroring on the "wrong" branch My best guess is that clangd isn't getting built-in symbols from drv_unknown_argument errorsThe error marker at line 1 covers the other three errors which are of the form:
These errors are happening because somewhere clangd is processing the command line specified in compile_commands.json with clang instead of (or really in addition to) g++. This issue is part of clangd too clangd/clangd#662 |
Here is the clangd log for simply opening the editor log
|
What to do?I think CDT is in a unique position to handle some of this - we already have a good scanner that picks up compiler built-in defines and includes. Using that to generate a |
@joaopedrotaveira provided instructions in #441 on how to setup a platformio project. These projects work in the classic CDT Editor, but run into a few problems for CDT LSP, at least out of the box.
Here are the instructions from #441, slightly modified.
eclipse
as IDE$ cd /tmp/platformio-blink-test-1 $ platformio project init --board esp32-s3-devkitc-1 --ide eclipse
src
, exampleblink.cpp
:The text was updated successfully, but these errors were encountered: