Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Declaration / Definition navigation failures

Here are some issues with source navigation (i.e. Open Declaration /
Definition) I found when trying the latest from CDT HEAD. The phenomena
are nicely reproducable with a not-too-big source base on Windows and
Linux, so this is a good basis for a discussion.

The navigation from definition to declaration and back is, in my
opinion, among the most important productivity features for any IDE so
this should really really be fixed if it reproduces for others too.

OK, first the setup. The sources are from the qhull project
(www.qhull.org). You should download and unpack
http://www.qhull.org/download/qhull-2003.1-src.tgz. 

My project sample is attached to
https://bugs.eclipse.org/bugs/show_bug.cgi?id=130740 which I created to
capture the discussion. 
Note that the project contains a linked folder "src" which relies on the
path variable qhull_2003_1 to be set to the qhull-2003.1 folder which
was created when unpacking the qhull sources. (Go to Windows -->
Preferences --> General --> Workspace --> Linked Resources to set the
path variable)

The qhull sources build out-of-the box on cygwin/Windows and Linux for
me. Now here come the findings and how to reproduce them:

- Open mem.c and go to function qh_memalloc() (for example)
-- Open Declaration re-opens mem.c in a different (not C/C++) editor and
returns upon the _definition_ of qh_memalloc() itself.
-- Open Definition re-opens mem.c in a different (not C/C++) editor and
returns upon the definition of qh_memalloc() itself. (It is okay for the
definition to return upon itself, but why the second editor?)
-- All Declarations --> Project finds only the _definition_ in mem.c.
Double-clicking on the match again opens a new (non-C/C++) editor and
highlights the definition.
-- All Declarations --> Workspace finds the definition and (at last)
also the declaration in mem.h. Double-clicking on the declaration match
again opens a non-C/C++ editor which points (correctly) to the
declaration.

- Now let's go to the declaration of qh_memalloc() in mem.h
-- Open Declaration re-opens mem.h in a different (not C/C++) editor and
returns upon the declaration of qh_memalloc() itself. (It is okay for
the declaration to return upon itself, but why the second editor?)
-- Open Definition only shows the error message "No definition was
found" in the status bar.
-- All Declarations --> Project Project finds the declaration in mem.h
(good). Double-clicking on the match again opens a new (non-C/C++)
editor and highlights the declaration.
-- All Declarations --> Workspace finds the declaration and also the
definition in mem.c. Double-clicking on the definition match again opens
a non-C/C++ editor which points (correctly) to the definition.

I think this behaviour is intolerable for such a small source base. I
would fix this but I do not know where to begin so I hope somebody can
comment on this.

Looking forward to your comments ...
 

Norbert Ploett



Back to the top