Open Vincent-Dalstra opened 5 months ago
Upon further digging, looks like the issue matches this: https://github.com/espressif/idf-eclipse-plugin/issues/107
Getting similar results in the parser log files.
That issue was closed without a fix, more of a "don't do this" instead.
This came up while trying to implement unit-testing (https://github.com/espressif/esp-idf/tree/master/examples/system/unit_test). The eclipse indexer will show "unresolved include" errors for esp-idf headers and system headers (e.g. "unity.h",). It will also show errors for symbols which are defined in those files ( e.g. TEST_CASE)
However, the test program will still build, flash, and run the tests.
To Reproduce A fresh install + example project (system/unit_test) was sufficient to produce this error; see below:
Steps to reproduce the behavior:
Download and unpack the latest Espressif IDE (in my case: https://dl.espressif.com/dl/idf-eclipse-plugin/ide/Espressif-IDE-2.12.0-linux.gtk.x86_64.tar.gz)
Run "espressif-ide", and create a new workspace
Run the "Tools Installation wizard" to install the tools and latest esp-idf (in my case: esp-idf-v5.1.2)
File->new->Espressif IDF project
Select template "system/unit_test" and leave the name as default ("unit_test")
Open the project, select "esp32s3" as the target, pick the correct port.
Press "Launch in run mode". (The normal application will build, flash, and run on the esp32s3).
Running the ESP-IDF serial monitor shows the output - matches what I would expect from the program.
File->import
Select "Espressif/existing IDF project"
For name: "unit_test_test"
For "existing project location", select the "test" folder in the current workspace, and make sure "copy project into workspace" is not ticked.
Open the test folder
Change the launch configuration to "unit_test_test", select esp32s3 as the target, and pick the correct port
Press "Launch in run mode". (This will launch and flash the test program to the esp32s3 dev board).
Running the ESP-IDF serial monitor shows the expected output as seen in README.md, indicating that the test program is running.
Open the file "components/testable/test/test_mean.c"
The linter highlights 5 errors: 2x "unresolved inclusion", 3x "Syntax error"
Ctrl+left clicking either or "unity.h" gives "Could not find include file unity.h on include paths"
Same result for, but not for "testable.h", which opens normally.
Expected behavior There should be no errors in that file.
The compiler is able to find the files, so it is not apparent why the indexer cannot. The spurious errors make it difficult to write tests.
Successful workarounds
Setting up the LSP editor and CLang (and turning off the regular indexer in the process) would correctly index the file.Unsuccessful
Espressif-IDE Product Information: Espressif > Product Information (Copy content from the console and attach as a file)
ESPIDF_product_info.txt
Eclipse Error log: Window > Show View > Other > Search for "Error Log" (Attach as a file)
Espressif_IDE_errlog_2024-01-27.log