Closed
Description
Describe the bug
goto / peek definition fails, even if the symbol is shown in the outline view and is implemented in the current file
To Reproduce
Steps to reproduce the behavior:
some methods do not have hover info, when they are used,
right click on these methods and selecting "goto definition" or "peek definition" gives the wrong information
"no definition found for xxx"
Expected behavior
what is on the button : the ide should go to the definition
Desktop (please complete the following information):
win7/64
IDE beta 5
Additional context
from the clang log :
inols-clangd-err.log
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
DaveTur commentedon Sep 5, 2021
In IDE 2.0.0-beta.11 both "Go to Definition" and "peek" do work, but "Go to Definition" highlights the line below the line with the definition.
Running under Windows 10 Pro.
per1234 commentedon Dec 13, 2021
Thanks for your reports @mink99 and @DaveTur. There have been some recent improvements to the Arduino Language Server that provides this capability in the IDE. These improvements are available from the latest release of the Arduino IDE.
Please try again with the latest build of the Arduino IDE and let us know whether or not the bug is fixed for you.
per1234 commentedon Mar 11, 2022
Closing due to lack of response.
@mink99 or @DaveTur if you will provide the requested information by commenting here, I'll be happy to re-open this issue.
mink99 commentedon Mar 11, 2022
See "IntelliSense doesn't work without #include <Arduino.h> #55 " same bug, not fixed, not even tried....
These are two effects on the same underlying bug.
I would recommend to merge these two bugs, and remove the "imperfection" tag, as this feature is one of the USP of the 2.0.
per1234 commentedon Mar 11, 2022
@mink99 please provide complete and detailed instructions I can follow for a minimal reproduction of the issue.
All I have to work with right now is a vague description and a screenshot of what appears to be a very complex sketch.
Are you able to reproduce the bug with this sketch?
You can see that I am not:
We do not provide support for Windows 7. Please try it with a computer that is running Windows 10 or newer.
Issues are divided into three primary categories:
Which of the other two would you suggest replacing the type: imperfection label with?
mink99 commentedon Mar 11, 2022
Hi,
we may have an issue with the wording, as we both are not native english speakers. An Imperfection may be understood as "not perfect" which is far from "faulty". But ok, lets take it as an euphemism :)
The bug is completely OS independent, it is just based on the CLANG integration in the language server, and therefore can be reproduced on all of the supported operating systems.
As I see it, the two issues, #55 and this one are based on the same conceptually different understanding on what the scope of these features "goto definition / source" should be.
My understanding is that the scope of these navigation features should be the whole compilation unit, that is
so basically everything that is provided to the compiler.
this is working perfectly in regards to the gcc, but the same information should be provided to the CLANG compiler to provide source navigation, tooltips, intellisense etc.
Reusing this information (the gcc ) may be a much more easy approach than running CLANG and GCC on a different set of information and generating both independently of each other.
At the time i filed this bug report (and the #55) you were only able to provide the data for the processed .ino file to CLANG, which lead to the embarassing picture on top if the thread (1) . Now, in the meantime, you were able to include the content of the project directory(2). While you are working hard on adding (4) & (5), on a different path, creating issues on many platforms and leaving out (3) .
So my recommendation is still , provide the full compilation path, as it is available for gcc, also to CLANG, and solve all those many issues within the build scripts or the according templates, once and for all.
But, to recreate this bug in its most simple form, you would need two files :
the main .ino
a header file , in a subdirectory called sub, in this example the header is calles inc.h:
behaviour on intellisense and hover :
Amnesia on goto definition:
Same data from the same source ? obviously a failed redundancy....
src
folder #722per1234 commentedon Mar 11, 2022
The label is intentionally chosen to be applicable to any severity of defect on the spectrum from "missing comma in the readme" to "Skynet is waging war on humanity".
We have a separate set of "criticality" labels which are used to indicate severity. "criticality" labels are assigned by a manager during the planning process, while "type" labels are assigned by a maintainer during triage.
OK, now it is clear. Thanks!
I also encountered this bug and submitted a report about it here: #722
Even though this one came first, I think #722 presents the issue in a way that is more clear to those investigating it, so I will leave this one closed.
I added a comment there referencing this issue to make sure that the valuable discussion you provided here is not missed. You are welcome to comment on that issue to add additional information. I have only described the bug itself, and nothing about the cause of it as you have done.
mink99 commentedon Mar 11, 2022
mink99 commentedon Mar 17, 2022
I added another simple example :
src :
included : inc.h
result :

Serial is known in the main , but is a clang error in "inc.h"