"Go To Definition" not working

Hi,

"Go To Definition" is not working. How can I help fixing it ? Is there some log I can send to Dev team ?

This seems quite common
Have you got Editor Quick Suggestions turned on in the IDE Preferences ?

Which Arduino board do you have ?
Go To Definition does not/did not work on all processor types

Compiling the sketch should build the list of definitions and according to previous advice it does not need to succeed in order for the list to be built

Yes I do.

When I open IDE it does not work for few seconds. Then it works for few seconds, if at all. And then not again till rest of the session.

I guess auto-completion depends on 'Go To' so that does not work as well.

No change if I rebuild application or not. Even though there is not such feature as 'Rebuild' which meaning is to force all .o to rebuild without exception. 'Verify' does not do that. The only way to 'Rebuild' is to delete all .o from sketch temporary folder in
c:\Users\frank\AppData\Local\Temp\arduino\sketches\

Your experience matches mine. When it works it is great, then it suddenly doesn't, which is very frustrating

I have asked before but there appears to be no way to force a rebuild although compiling the sketch, even if unsuccessful, is reputed to force a rebuild, but it seems not to

It is interesting that IDE knows about my structure:
image

but cant see its members after a dot:
image

Only when I start typing:
image

I forgot to answer this - I am on Arduino Mega Rev3. I wonder why Board model would cause GoTo not working.

It should work on your board. It was one of the much later boards where it did not work due to a bug but that may have been fixed

Since there are so many different microcontroller architectures in the Arduino ecosystem once you include all the 3rd party boards platforms, there might be unsupported boards I'm not aware of, but the one we usually see reported is the megaAVR 0-series, which includes the ATmega4809 microcontroller on the Nano Every and UNO WiFi Rev2 boards.

But as you say, the classic AVR series including the ATmega2560 of the Arduino Mega 2560 should be supported just fine.

Is not auto-completion (AC) HW agnostic ? Am I right that clangd (compiler front end) is used in backround to parse the project to provide AC services ?

image

I know Keil uVision IDE moved to Clangd in their latest version and it has similar symptoms as Arduino IDE. No good.

Support for each target architecture must be implemented in LLVM/clang:

That is correct. Arduino created a tool named "Arduino Language Server", but this only handles the translation for the Arduino sketch framework between Arduino IDE 2.x and the clangd C++ language server.

1 Like

Get definition works on Serial.print in the main ino and randomly in some of the other inos but not all of them. Some of the included library header files work and some don't but other objects within these headers work to "get definition". I see this behavior with ESP32, Teensy 4.1 and Nano (old bootloader). IDE 2.3.1

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.