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

Cannot open declaration (IEP-1313)

Open MrDuby opened this issue 1 year ago • 26 comments

Describe the bug I installed the Eclipse base ide, Espressif IDE v3.0.0 on windows 10 professional. When I start a project or import any project I have no way to open function or variable declaration. On right click I cannot even find the option "Open Declaration" in the menu. Tried CTRL+click but I'm not even getting the Hyperlink to click to find declaration. When I select lets say the function and press F3 I get a pop-up message saying "The operation is not applicable to the current selection. Select a hyperlink target". The code compiles correctly though.

MrDuby avatar Aug 25 '24 10:08 MrDuby

Hi @MrDuby Could you please check this https://github.com/espressif/idf-eclipse-plugin/issues/995#issuecomment-2276935107

kolipakakondal avatar Aug 26 '24 07:08 kolipakakondal

I have the same problem and I do many ways to solve the problem include the way you said in other topic, but the problem still remain. I can't open declaration in any way and the open declaration in Navigate tab also is not usable and is off please help

amin352 avatar Aug 26 '24 20:08 amin352

This is how I finally solved it. I downloaded the offline installer(Espressif-IDE 3.0.0 with ESP-IDF v5.2.2) and no more the online installer(Universal Online Installer 2.28). After the installation I had to also go to IDE toolbar->Espessif->ESP-IDF Manager then Add ESP-IDF image

MrDuby avatar Aug 27 '24 18:08 MrDuby

This is how I finally solved it. I downloaded the offline installer(Espressif-IDE 3.0.0 with ESP-IDF v5.2.2) and no more the online installer(Universal Online Installer 2.28). After the installation I had to also go to IDE toolbar->Espessif->ESP-IDF Manager then Add ESP-IDF image

Thanks for your solution I apply it and it works finally, BUUUUUT after closing ide again the problem still exist and not solving either

amin352 avatar Aug 28 '24 05:08 amin352

None of these solutions work for me.

Ignisuti avatar Nov 19 '24 05:11 Ignisuti

Hi @Ignisuti Could you please share an error log and LSP log?

Error log https://preview-docs.espressif.com/projects/espressif-ide/en/latest/troubleshooting.html?#error-log

LSP logs can be enabled from the preferences.

Screenshot 2024-11-19 at 11 30 49 AM

kolipakakondal avatar Nov 19 '24 06:11 kolipakakondal

I'm not sure how to send the log. This is what I have in my settings. However, there are no files at this location. I've restarted Eclipsed and re-compiled.

Screenshot 2024-11-19 001238

Ignisuti avatar Nov 19 '24 06:11 Ignisuti

I'm not sure how to send the log. This is what I have in my settings. However, there are no files at this location. I've restarted Eclipsed and re-compiled.

Screenshot 2024-11-19 001238

Please navigate to the location mentioned in the dialog.

ex: /Users/myuser/workspace-devcon/languageServers-log/org.eclipse.cdt.lsp.server.log

kolipakakondal avatar Nov 19 '24 06:11 kolipakakondal

Sorry, I wasn't more clear in my response. Yes, I have navigated there and only see an empty folder.

Ignisuti avatar Nov 19 '24 15:11 Ignisuti

Same problem here. with 3.0. Previous versions have no issues.

ua100k avatar Nov 22 '24 20:11 ua100k

Espressif, if you're listening, you have free developers, like myself, at your disposal to help you better understand this issue. Please just tell us what data you need to troubleshoot this and how to get it, and we'll try to get it to you.

I tried to provide the log, but Eclipse isn't outputting the log. So, maybe that's where we need to troubleshoot first...

Ignisuti avatar Nov 22 '24 20:11 Ignisuti

Hi @Ignisuti,

The logs could also be viewed in the console. Can you see them there? Make sure to switch to the language server console first like here:

https://github.com/user-attachments/assets/5b1db7f4-366c-45a3-928d-161af7cf9200

Also, please take a look if clangd settings are set: Example: image

Here are short explanations of these variables:

  • Path: 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.

Also, after building the project "C/C++ Language Server" process runs inside the IDE, and you can track it in the bottom right corner of the IDE. After this process finishes you should able to open declarations.

sigmaaa avatar Nov 25 '24 10:11 sigmaaa

I do not have the Language Servers option in my console. 20241125_113018

I'm not familiar with clangd, but based on what you have said, I believe mine is setup correctly. Untitled

Ignisuti avatar Nov 25 '24 17:11 Ignisuti

Hi @Ignisuti,

would it be possible to connect on MS Teams to work through this issue together? The problem is quite unusual, and we have not been able to reproduce it on our end. If this works for you, please write to [email protected] with your time zone and a suitable time. We will then send you an invite.

Best regards, Denys

sigmaaa avatar Nov 29 '24 12:11 sigmaaa

Error log https://preview-docs.espressif.com/projects/espressif-ide/en/latest/troubleshooting.html?#error-log

Can you please share an error log?

Most likely, the clangd server might be failing during processing.

kolipakakondal avatar Nov 29 '24 12:11 kolipakakondal

Update... I have worked with Denys and he discovered the following solution:

1.) I had turned on my Indexer during troubleshoot. It needed to be re-disabled. 2.) These 3 options for the LSP Editor were NOT enabled by default. Enabling these fixed my issue. Screenshot 2024-12-02 130843

Ignisuti avatar Dec 02 '24 19:12 Ignisuti

This has no effect on my system. The language were enabled already. In previous editions, the index was enabled and no option for language servers are available in preferences. Not sure if that is helpful.

ua100k avatar Dec 02 '24 19:12 ua100k

This has no effect on my system. The language were enabled already. In previous editions, the index was enabled and no option for language servers are available in preferences. Not sure if that is helpful.

Hi @ua100k,

The LSP editor was included to the IDE in the version 3.0.0 and higher and was intended to replace default C/C++ editor. Could you share what your preference is for clangd? Like here image

Also, make sure that you are opening c/c++ files with LSP editor (right-click on the file -> open with C/C++ Editor (LSP)). Or just set this in the preferences like this: image

Please note that after building the project, the C/C++ Language Server should appear as running in the bottom-right corner for a short period. Once this process completes, you can use Ctrl + Left Click (default) to open declarations.

image

sigmaaa avatar Dec 02 '24 21:12 sigmaaa

Hi @sigmaaa

Thank you for your quick reply and help.

Here is my clangd config, Editor Config and Language server showing. I don't have this issue with the same file in IDE 2.9. image image

image

ua100k avatar Dec 02 '24 23:12 ua100k

Hi @ua100k,

The settings look good to me. Are you able to open declarations in the hello_world project? We can also troubleshoot this problem in Teams. You can write to [email protected] with your time zone and a suitable time, and we will send you an invite.

sigmaaa avatar Dec 03 '24 09:12 sigmaaa

@sigmaaa I wrote to ide.support but did not get any reply or call on the date and time suggested. Can you please advise.

Thank you

ua100k avatar Dec 10 '24 19:12 ua100k

Hi @ua100k,

I apologize for missing your earlier email. I've replied and suggested the same time for tomorrow. Please let me know if that works for you. Thank you!

sigmaaa avatar Dec 10 '24 21:12 sigmaaa

This issue is present a long time now. When a file is opened with the old (none-LSP) C editor F3 works. But you have to do this every time, even if you checked the open-always-with checkbox. Could this be fixed to use the old editor by default? Thanks.

DigKleppe avatar Dec 29 '24 13:12 DigKleppe

Same issue still present with the version 3.5.0 .

Actually, everthing is fine the very first time(s?) the editor is used. After some days the message "The operation is not applicable to the current selection. Select a hyperlink target." pops-up trying to open the declation of a struct instance.

RELOC-DEV avatar Jul 01 '25 08:07 RELOC-DEV

Same issue still present with the version 3.5.0 .

Actually, everthing is fine the very first time(s?) the editor is used. After some days the message "The operation is not applicable to the current selection. Select a hyperlink target." pops-up trying to open the declation of a struct instance.

Hi @RELOC-DEV,

Is the language server running at that moment? You can check this by opening the "Language Servers" view (via Window > Show View > Other... > Language Servers) and verifying whether the server is active. Also, look at the status bar or the "Error Log" view for any issues related to the language server.

sigmaaa avatar Jul 01 '25 10:07 sigmaaa

Hi @sigmaaa, sorry for my late reply but, obviously, the editor did not show the issue for a while. Now the problem is present again but in a more underhanded way. I mean, trying to open a function declaration the message appears:

Image (note that the Language Server is running)

But when I try again few seconds later the editor correctly shows the declaration.

Another sign is that the "Outline" window is empty (for this specific file only) when this happens, closing and reopening the file makes the "Outline" windows to show the content correctly.

RELOC-DEV avatar Jul 09 '25 12:07 RELOC-DEV