Re: semantic-ia-fast-jump: Could not find suitable jump point

Eric Ludlam <[email protected]> Fri, 20 Nov 2015 20:56:05 -0500
Newsgroups gmane.emacs.cedet
Message-ID <[email protected]>
On 11/02/2015 03:41 PM, Phan, Linh H (3443) wrote:
> Hi,
>
>    I am having problem using "semantic-ia-fast-jump" using the example:
>
> https://www.gnu.org/software/emacs/manual/html_node/ede/Quick-Start.html.
>
> To that example, I added a telem_t:
>
> include/myproj.hh:
>
> typedef struct
>
> {
>
>    double x;
>
> } telem_t;
>
> src/main.cpp:
>
> int main() {
>
>    telem_t telem;
>
> }
>
> When I put my mouse on "telem_t" in main, I see the definition of
> telem_t in the ECB symboldef buffer (and I see myproj.hh has been loaded
> into emacs),  but when I run M-x semantic-ia-fast-jump, emacs says:
>
> Could not find suitable jump point for telem_t

I created your example, and agree, it couldn't find telem_t.  I added:

#include "myproj.hh"

into main.cpp, and then it found the definition.

If instead you mean that the include directory wasn't being picked up 
via the project described in the quick start, that I am less certain about.

A good thing to try out is the "Decorate Tags" option in the Development 
menu.  With that enabled, move the mouse over an include, right click, 
and select "summarize includes current buffer".  It will probably say 
something about myproj.hh not being found.

If you tried the example right after creating the project, perhaps there 
is a stale cache.  Since you emailed a while ago, you may have since 
restarted and it might work.

>
> If I put the below in my .emacs:
>
> (defun my:add-semantic-system-include()
>
>    (semantic-add-system-include "/home/phan/pkgs/ede/example/include"
> 'c++-mode)
>
> )
>
> (add-hook 'c-mode-common-hook 'my:add-semantic-system-include)
>
> Then when I run M-x semantic-ia-fast-jump, emacs would successfully jump
> to telem_t definition in myproj.hh.
>
> myproj.hh is not a system include file and so I was hoping for a better
> solution than this.

Indeed, it isn't correct to be forced into setting it as a system 
include.  EDE is supposed to resolve finding includes for you.  A simple 
thing to try is:

M-x ede-find-file RET myproj.hh RET

If that finds it, then it really should be found by the include 
mechanism too.

Eric

------------------------------------------------------------------------------