Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » How to open function body (similiar to open declaration)?
How to open function body (similiar to open declaration)? [message #482492] Wed, 26 August 2009 15:20 Go to next message
Eclipse UserFriend
Hi all!

Is it possible to open the function body (in .c/.cpp file) with some
command? I have found only the "Open declaration" function.

Thanks.
Re: How to open function body (similiar to open declaration)? [message #482503 is a reply to message #482492] Wed, 26 August 2009 16:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ahmedhazem.gmail.com

If you are in the source file containings the function body, you can use
the quick-outline mode (Ctrl-O) to navigate to the function body.
Re: How to open function body (similiar to open declaration)? [message #482520 is a reply to message #482503] Wed, 26 August 2009 17:03 Go to previous messageGo to next message
Eclipse UserFriend
Thanks, I think that I will use this also.

But I wanted to do a little bit different thing. Imagine I have a file 1.c
which calls a function test(). Function test is declared in file 2.h and
its body is in file 2.c. If I use 'Open Declaration' upon test() in 1.c I
will get 2.h file. I would like to go to file 2.c directly from the 1.c.
Re: How to open function body (similiar to open declaration)? [message #482577 is a reply to message #482520] Thu, 27 August 2009 02:58 Go to previous messageGo to next message
Eclipse UserFriend
Vadim wrote:

> Thanks, I think that I will use this also.

> But I wanted to do a little bit different thing. Imagine I have a file 1.c
> which calls a function test(). Function test is declared in file 2.h and
> its body is in file 2.c. If I use 'Open Declaration' upon test() in 1.c I
> will get 2.h file. I would like to go to file 2.c directly from the 1.c.
Hmm, in my case when I press F3 (Open Declaration) on a function Eclipse
will send me directly to the implementation of the function in 2.c. If I
press F3 once more it will send me to the declaration in the header file
2.h
Which CDT version are you using? When I remember correctly the behaviour
you describe was fixed in CDT 5.0.

Axel
Re: How to open function body (similiar to open declaration)? [message #482757 is a reply to message #482577] Thu, 27 August 2009 15:26 Go to previous message
Eclipse UserFriend
I figured it out. The problem was that my .c files were not in the project
surce code ;) because it was third party library. I added links to the
source code (Project properties->C/C++ General->Paths and Symbols->Source
Location), excluded them from build and now everything is fine.
Previous Topic:How to get an ICElement from an IBinding
Next Topic:Weird responses of Eclipse CDT
Goto Forum:
  


Current Time: Sat Jul 19 17:55:56 EDT 2025

Powered by FUDForum. Page generated in 0.04721 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top