Code completion: "Error while computing completion" (IEP-1351)
Describe the bug Code completion does not work, I see " Error while computing completion" To Reproduce Steps to reproduce the behavior:
- open an Esp 32 IDF project,
- open a .c file
- go to a function and pres any key (l) and Ctrl+Space
- See error: "Error while computing completion"
Expected behavior I want to see the completion list including function names, variables and code templates.
Screenshots
Espressif-IDE Product Information: Espressif > Product Information (Copy content from the console and attach as a file) product_info.txt
Eclipse Error log: Window > Show View > Other > Search for "Error Log" (Attach as a file) code_completion_error.log Please attach the error log as described here https://github.com/espressif/idf-eclipse-plugin#error-log
Hi @zamek42,
Could you please check if the LSP editor settings are configured correctly? To do this go to Preferences -> C/C++ -> Editor(LSP) ->clangd. My settings for esp32 look like this:
If you are using the latest ESP-IDF IDE or plugin, these settings should be configured automatically after installing the tools, setting the target, and building the project. Here are some specifics:
- Path Options: This should be set up automatically after tool installation. If it's not, try clicking Restore Defaults on the clangd preference page.
- Drivers: This setting depends on the target selected in the launch bar. If it’s empty, try reselecting the target; for example, select ESP32-S2, then switch back to ESP32.
- Additional Settings: These options are used for source navigation and are configured automatically after building the project.
Let me know if that helped. Thanks
Hi Sigmaaa,
Thx for your replay. When I click to clangd settings I've got an error: "The currently displayed page contains invalid values". And then when I click somewhere else and click back it displayed but every fields are empty. And when I fill everything as you suggested, and save it, it seems it does not save it.
thx, Zamek
Hi @zamek42,
I haven't been able to reproduce this issue. It could be due to missing dependencies. Are you currently using Espressif-IDE or the IDF plugin? If you're using the IDF plugin, I recommend trying the Espressif-IDE instead. You can download it here: Espressif-IDE v3.1.0. Please check if the issue persists there.
Hello, I encountered the same problem while using Espressif-ID v3.0.0. Upon reinstalling, I noticed that I do not have the "esp-clang" folder at the following path: Espressif\tools\esp-clang. However, in the Esp-IDE (Preferences -> C/C++ -> Editor (LSP) -> clangd), the settings are automatically configured to the same paths as yours, even though one of the folders is missing. I added the missing folder with the contents, reset the settings in ESP-IDE to the default, and manually re-entered them. After that, the problem was resolved. I restarted the system and the program, and everything was fine, but after the first compilation of any project, the problem returned.
New install this week (Win11). I had the same problem and your fix worked. In my case the path just said clangd and nothing else. Everything else was correct. I browsed to the clangd.exe and that worked. Thanks.
@GrantMTG hi ! Could you please provide more details about your setup, because I have tried latest IDF plugin v3.1.0 with both Eclipse 24-06 / Eclipse 24-09 and couldn't reproduce this issue. Also tried latest IDE v3.1.0, also works fine. We do know about this issue in Espressif-IDE v3.0.0, but from your message it isn't clear if you used 3.0.0 or 3.1.0. You can download latest one here: Espressif-IDE v3.1.0.
Hi. I have two installations. I'm at work now and everything is OK here. v3.1.0 (Win10). I will check at home (Win11) and see if it's fixed or not. It's been a few crazy days so I can't remember for sure. I know at work I have none of the VS Code/PlatformIO/Arduino stuff. Very clean install and working good.
Hi, I've downloaded the latest 3.1.0 as you suggested, bu the no changes :(.
I have a Debian Linux Bookworm and java:
openjdk version "17.0.13" 2024-10-15
OpenJDK Runtime Environment (build 17.0.13+11-Debian-2deb12u1)
OpenJDK 64-Bit Server VM (build 17.0.13+11-Debian-2deb12u1, mixed mode, sharing)

I tried eclipse (Version: 2024-09 (4.33.0) Build id: 20240905-0614) and I installed plugin. Code completion works on it, but it does not contains the editor templates (Preferences/C/C++/Editor/Content Assist/Templates. Clangd in this eclipse is ok.
thx, Zamek
@AndriiFilippov Mine is working OK now. Honestly I can't remember what I did, but it was nothing too sophisticated. It may even have been closing eclipse and reopening it and/or rebooting.
GB
EDIT: Ah, I see I already answered above about my fix for the original problem:
New install this week (Win11). I had the same problem and your fix worked. In my case the path just said clangd and nothing else. Everything else was correct. I browsed to the clangd.exe and that worked. Thanks.
Hi Sigmaaa,
Thx for your replay. When I click to clangd settings I've got an error: "The currently displayed page contains invalid values". And then when I click somewhere else and click back it displayed but every fields are empty. And when I fill everything as you suggested, and save it, it seems it does not save it.
thx, Zamek
Hello,
I get exactly the same behaviour on Version: 2024-12 (4.34.0) Build id: 20241128-0757
I can find the files on paths, but settings are always erased....
+1
+1
Hi @ua100k, @Radot1, @LAPSyLAB
Could you please try Espressif-IDE from this link and check if you encounter the same issue on this PR? Thank you
Hi All, Seems it works well! :) Thank you. There is only one problem remains, my code templates does not works. I made a template in Windows/Preferences/Editor/Templates: new:
but it does not exists in loge Ctrl+space list. thx, Zamek
Hi @zamek42,
Unfortunately, code templates are not yet supported in the LSP CDT editor: https://github.com/eclipse-cdt/cdt-lsp/issues/333.
Hi @sigmaaa
thx a lot, I can leave without code templates.