idf-eclipse-plugin icon indicating copy to clipboard operation
idf-eclipse-plugin copied to clipboard

Code completion: "Error while computing completion" (IEP-1351)

Open zamek42 opened this issue 1 year ago • 17 comments

Describe the bug Code completion does not work, I see " Error while computing completion" To Reproduce Steps to reproduce the behavior:

  1. open an Esp 32 IDF project,
  2. open a .c file
  3. go to a function and pres any key (l) and Ctrl+Space
  4. 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

zamek42 avatar Oct 31 '24 10:10 zamek42

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: image

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

sigmaaa avatar Nov 01 '24 09:11 sigmaaa

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

zamek42 avatar Nov 01 '24 17:11 zamek42

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.

sigmaaa avatar Nov 04 '24 12:11 sigmaaa

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.

Pastovky avatar Nov 07 '24 19:11 Pastovky

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 avatar Nov 09 '24 04:11 GrantMTG

@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.

AndriiFilippov avatar Nov 15 '24 20:11 AndriiFilippov

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.

GrantMTG avatar Nov 15 '24 23:11 GrantMTG

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) ![PXL_20241116_081607679](https://github.co PXL_20241116_081949043 MP m/user-attachments/assets/7a55ba82-d10c-4240-9c2c-abfbd372647e) PXL_20241116_081814456 MP

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

zamek42 avatar Nov 16 '24 08:11 zamek42

@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.

image

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.

GrantMTG avatar Nov 17 '24 02:11 GrantMTG

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....

LAPSyLAB avatar Dec 22 '24 00:12 LAPSyLAB

+1

Radot1 avatar Mar 03 '25 07:03 Radot1

+1

ua100k avatar Mar 06 '25 23:03 ua100k

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

sigmaaa avatar Mar 07 '25 07:03 sigmaaa

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:

Image

but it does not exists in loge Ctrl+space list. thx, Zamek

zamek42 avatar Mar 07 '25 08:03 zamek42

Hi @zamek42,

Unfortunately, code templates are not yet supported in the LSP CDT editor: https://github.com/eclipse-cdt/cdt-lsp/issues/333.

sigmaaa avatar Mar 07 '25 08:03 sigmaaa

Hi @sigmaaa

thx a lot, I can leave without code templates.

zamek42 avatar Mar 07 '25 11:03 zamek42

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 @sigmaaa, it worked. Cheers

Radot1 avatar Mar 08 '25 17:03 Radot1