A couple of observations about viewing definitions in IDE 2.x (currently 2.3.2 in my case) using Windows 10
Quite frequently this simply does not work. I am aware from previous topics that it will not work with some processors, unless that has been fixed, but for me it often does not work even with the humble Nano classic
When it fails, hovering over the function name or variable does not pop up the definition nor do right click then Go to definition or Ctrl+F12 open at the definition or jump to it and Peek does nothing
The Nano and its COM port are selected in the IDE and "True if the Arduino Language Server should generate log files into the sketch folder" is set to false. I hope that it goes without saying that "Editor Quick Suggestions" is turned on in the IDE Preferences
I can find no rhyme nor reason to this behaviour, nor can I reproduce it on demand, but it is very frustrating. I have asked before whether it is possible to force the rebuild of the index to definitions but have never found the answer
Having said that, when it works I find it of limited use beyond discovering which file the definition is in. For instance, given a pop up such as this
is going to the definition and seeing this
really any more helpful ? The same goes for Peek
What would be much more helpful would be a link to the function body. I note that this is what happens when the function is in a .c file. For instance, Go to Definition for the delay() function opens wiring.c at this point
void delay(unsigned long ms)
{
uint32_t start = micros();
while (ms > 0) {
yield();
while ( ms > 0 && (micros() - start) >= 1000) {
ms--;
start += 1000;
}
}
}
IDE 2.x is very nearly helpful but seems inconsistent and I find it frustrating to use.
You can enable the "Arduino › Language: Log" advanced setting, wait for the next occurrence of the fault, and then analyze the contents of the log files for the time period during which, and immediately prior to, the occurrence.
Unfortunately it is often quite difficult for someone who is not very knowledgeable in the subject of language servers (which includes myself) to effectively analyze these logs, but sometimes we get lucky and the cause is evident.
I'd be happy to take a look at your logs, though I can't promise that I will see anything there.
This is tracked by the Arduino Language Server developers here:
Please only comment on the GitHub issue thread if you have new technical information that will assist with the resolution. General discussion and support requests are always welcome here on the Arduino Forum.