Page 1 of 1

17.0, C++: Goto Declaration and Goto Implementation

Posted: Mon Jul 24, 2023 8:44 pm
by N7DR

On my bullseye machine with codelite 14.0, when I place the cursor inside a word and right-click, a menu pops up, and two of the items on the menu are "Goto Declaration" and "Goto Implementation". Admittedly, these don't always do anything, but often they do, and allow me to immediately go to the place that a type or a variable is declared or defined, even if it's in a different file.

These items are missing on my debian bookworm machine with codelite 17.0.

Where do I find the equivalent functionality in 17.0?

For example, if I have the line:
country_name = fields[CTY_NAME];
how do I, in 17.0, view the declaration of country_name?


Re: 17.0, C++: Goto Declaration and Goto Implementation

Posted: Tue Jul 25, 2023 1:57 am
by DavidGH

Hi,

I miss it too :(

The alternative that I most often use is the CScope plugin, but the Search menu has various other possibilities e.g. GoTo Anything.

Regards,

David


Re: 17.0, C++: Goto Declaration and Goto Implementation

Posted: Wed Jul 26, 2023 8:36 pm
by N7DR

The alternative that I most often use is the CScope plugin, but the Search menu has various other possibilities e.g. GoTo Anything.

You have a lot more patience (or experience) than I do.

I just spent about ten minutes trying to understand what Cscope does and how to get it so tell me where a variable is defined, and gave up in frustration (this was after having to change the place where codelite was looking for the cscope library, because apparently there's a bug in the bookworm default installation such that codelite has an incorrect name for the library file -- codelite was looking for "cscope", when it should be looking for "cscope.so").

The Search for Anything option just presents a semi-infinite list, none of which seems related to "go to declaration" (although I might be wrong... there were so many entries, and I didn't know what this function might be called, other than the obvious "go to declaration").

It seems quite odd to have removed such an easy and useful way to find declarations and definitions, even if (in my experience) it didn't always work.


Re: 17.0, C++: Goto Declaration and Goto Implementation

Posted: Fri Jul 28, 2023 5:25 pm
by eranif
  • Ctrl-Shift-R type the symbol you want
  • Righ click "Find Symbol", by default, it will take you to the implementation, if it can't find it -> declaration. If you are already on the declaration, it will take you to the implementation

Re: 17.0, C++: Goto Declaration and Goto Implementation

Posted: Fri Jul 28, 2023 8:03 pm
by N7DR

Ctrl-Shift-R type the symbol you want

I have a (more or less randomly chosen) line that reads:
exch_values += qthx;

If I hit ctrl-shift-R, a window entitled "Open Resource" appears. If I then type "exch_values" <ENTER>, then the window goes away again. But nothing else obvious happens.

Righ click "Find Symbol"

If I place the cursor inside the string "exch_values", right click, and choose "Find Symbol" from the pop-up menu, the menu disappears but nothing else obvious happens. The same is true if I put the cursor inside the string "qthx" instead of "exch_values".

Basically, I have been unable to find any way to go to either the declaration or the definition of variables.