17.0, C++: Goto Declaration and Goto Implementation

CodeLite installation/troubleshooting forum
N7DR
CodeLite Enthusiast
Posts: 20
Joined: Sun Sep 01, 2019 12:57 am
Genuine User: Yes
IDE Question: C++
Contact:

17.0, C++: Goto Declaration and Goto Implementation

Post 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?

DavidGH
CodeLite Plugin
Posts: 819
Joined: Wed Sep 03, 2008 7:26 pm
Contact:

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

Post 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

N7DR
CodeLite Enthusiast
Posts: 20
Joined: Sun Sep 01, 2019 12:57 am
Genuine User: Yes
IDE Question: C++
Contact:

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

Post 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.

User avatar
eranif
CodeLite Plugin
Posts: 6372
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

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

Post 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
Make sure you have read the HOW TO POST thread
N7DR
CodeLite Enthusiast
Posts: 20
Joined: Sun Sep 01, 2019 12:57 am
Genuine User: Yes
IDE Question: C++
Contact:

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

Post 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.

Post Reply