Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » toggle between .cc and .h file
toggle between .cc and .h file [message #154700] Tue, 20 September 2005 03:29 Go to next message
Eclipse UserFriend
Originally posted by: simecek.gmx.de

Hi,

is it possible to toggle between a .cc file and a .h file with the same
name in the editor? What I mean is, I want to open e.g. a file with the
name "code.h" in the editor if file "code.cc" is the currently opened
one. And of course the other way round.

Thanks,
Michal
Re: toggle between .cc and .h file [message #154732 is a reply to message #154700] Tue, 20 September 2005 12:09 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alexfarberov.[nospam]hotmail.com

Well you can double click on a class name and hit F3 to see the
declaration of the Class..

Michal Simecek wrote:
> Hi,
>
> is it possible to toggle between a .cc file and a .h file with the same
> name in the editor? What I mean is, I want to open e.g. a file with the
> name "code.h" in the editor if file "code.cc" is the currently opened
> one. And of course the other way round.
>
> Thanks,
> Michal
>
Re: toggle between .cc and .h file [message #154740 is a reply to message #154732] Wed, 21 September 2005 02:22 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: simecek.gmx.de

Thanks,

but this command "Open Declaration" is not what I am looking for because
of two reasons:

1.) I assume it wil work just in one direction. I think I will come form
..cc file to a .h file but not the other way round.

2.) And the second reason is, it does not work at all. If I select a
class name and hit F3 the "Progress Information" window opens saying
"Operation in progress..." and after about two minutes it disappears
again and nothing happens.

What I am looking for is much easier. A command which will just take the
name of the current file in the editor, will replace the extension (cc
-> h or h -> cc) and will try to open the file with that new extension.
Thats all.

Thanks,
Michal

Alex Farberov wrote:
> Well you can double click on a class name and hit F3 to see the
> declaration of the Class..
>
> Michal Simecek wrote:
>
>> Hi,
>>
>> is it possible to toggle between a .cc file and a .h file with the
>> same name in the editor? What I mean is, I want to open e.g. a file
>> with the name "code.h" in the editor if file "code.cc" is the
>> currently opened one. And of course the other way round.
>>
>> Thanks,
>> Michal
>>
Re: toggle between .cc and .h file [message #154747 is a reply to message #154740] Wed, 21 September 2005 09:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alexfarberov.[nospam]hotmail.com

Never encountered a c/h toggle feature..not sure about the utility of it
since not all h files have a c file associated w/ them and vice versa..

The closest thing is the "show declaration" (somewhat equivalent to your
c file -> h file toggle) and "show definition" (somewhat equivalent to
your h file -> c file toggle) tools. Select an element (like a class or
a function), right click on it and you'll have these options.

To do this, you'll need an indexer to be configured for your project:
Right click on the project in the navigator, hit properties, go to
indexer, select FULL indexer (slow) or CTAGS (fast) indexer.. whichever
works better for you. Then close and reopen the project to make sure the
indexer kicks in.

Michal Simecek wrote:
> Thanks,
>
> but this command "Open Declaration" is not what I am looking for because
> of two reasons:
>
> 1.) I assume it wil work just in one direction. I think I will come form
> .cc file to a .h file but not the other way round.
>
> 2.) And the second reason is, it does not work at all. If I select a
> class name and hit F3 the "Progress Information" window opens saying
> "Operation in progress..." and after about two minutes it disappears
> again and nothing happens.
>
> What I am looking for is much easier. A command which will just take the
> name of the current file in the editor, will replace the extension (cc
> -> h or h -> cc) and will try to open the file with that new extension.
> Thats all.
>
> Thanks,
> Michal
>
> Alex Farberov wrote:
>
>> Well you can double click on a class name and hit F3 to see the
>> declaration of the Class..
>>
>> Michal Simecek wrote:
>>
>>> Hi,
>>>
>>> is it possible to toggle between a .cc file and a .h file with the
>>> same name in the editor? What I mean is, I want to open e.g. a file
>>> with the name "code.h" in the editor if file "code.cc" is the
>>> currently opened one. And of course the other way round.
>>>
>>> Thanks,
>>> Michal
>>>
>
Re: toggle between .cc and .h file [message #154793 is a reply to message #154747] Wed, 21 September 2005 12:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dschaefer.qnx.com

Alex Farberov wrote:
> Never encountered a c/h toggle feature..not sure about the utility of it
> since not all h files have a c file associated w/ them and vice versa..
>
> The closest thing is the "show declaration" (somewhat equivalent to your
> c file -> h file toggle) and "show definition" (somewhat equivalent to
> your h file -> c file toggle) tools. Select an element (like a class or
> a function), right click on it and you'll have these options.
>
> To do this, you'll need an indexer to be configured for your project:
> Right click on the project in the navigator, hit properties, go to
> indexer, select FULL indexer (slow) or CTAGS (fast) indexer.. whichever
> works better for you. Then close and reopen the project to make sure the
> indexer kicks in.
>
> Michal Simecek wrote:
>
>> Thanks,
>>
>> but this command "Open Declaration" is not what I am looking for because
>> of two reasons:
>>
>> 1.) I assume it wil work just in one direction. I think I will come form
>> .cc file to a .h file but not the other way round.
>>
>> 2.) And the second reason is, it does not work at all. If I select a
>> class name and hit F3 the "Progress Information" window opens saying
>> "Operation in progress..." and after about two minutes it disappears
>> again and nothing happens.
>>
>> What I am looking for is much easier. A command which will just take
>> the name of the current file in the editor, will replace the extension
>> (cc -> h or h -> cc) and will try to open the file with that new
>> extension.
>> Thats all.
>>
>> Thanks,
>> Michal
>>
>> Alex Farberov wrote:
>>
>>> Well you can double click on a class name and hit F3 to see the
>>> declaration of the Class..
>>>
>>> Michal Simecek wrote:
>>>
>>>> Hi,
>>>>
>>>> is it possible to toggle between a .cc file and a .h file with the
>>>> same name in the editor? What I mean is, I want to open e.g. a file
>>>> with the name "code.h" in the editor if file "code.cc" is the
>>>> currently opened one. And of course the other way round.
>>>>
>>>> Thanks,
>>>> Michal
>>>>
>>

I believe there is an enhancement request on this. If not, please open one.

I used this feature a lot when I worked in Visual Studio. It's handy
when implementing methods of a class and you want to keep refering back
to the class definition.

Doug
Re: toggle between .cc and .h file [message #154923 is a reply to message #154747] Thu, 22 September 2005 04:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: simecek.gmx.de

The indexer is activated for my Project. I used FULL indexer and
I also tried now the CTAGS indexer (with default settings). And in both
cases the same behaviour (like described below). Nothing happens.

I am not sure, but is it possible that it runs into a timeout while
trying to find the definition/declaration?


Alex Farberov wrote:
> Never encountered a c/h toggle feature..not sure about the utility of it
> since not all h files have a c file associated w/ them and vice versa..
>
> The closest thing is the "show declaration" (somewhat equivalent to your
> c file -> h file toggle) and "show definition" (somewhat equivalent to
> your h file -> c file toggle) tools. Select an element (like a class or
> a function), right click on it and you'll have these options.
>
> To do this, you'll need an indexer to be configured for your project:
> Right click on the project in the navigator, hit properties, go to
> indexer, select FULL indexer (slow) or CTAGS (fast) indexer.. whichever
> works better for you. Then close and reopen the project to make sure the
> indexer kicks in.
>
> Michal Simecek wrote:
>
>> Thanks,
>>
>> but this command "Open Declaration" is not what I am looking for because
>> of two reasons:
>>
>> 1.) I assume it wil work just in one direction. I think I will come form
>> .cc file to a .h file but not the other way round.
>>
>> 2.) And the second reason is, it does not work at all. If I select a
>> class name and hit F3 the "Progress Information" window opens saying
>> "Operation in progress..." and after about two minutes it disappears
>> again and nothing happens.
>>
>> What I am looking for is much easier. A command which will just take
>> the name of the current file in the editor, will replace the extension
>> (cc -> h or h -> cc) and will try to open the file with that new
>> extension.
>> Thats all.
>>
>> Thanks,
>> Michal
>>
>> Alex Farberov wrote:
>>
>>> Well you can double click on a class name and hit F3 to see the
>>> declaration of the Class..
>>>
>>> Michal Simecek wrote:
>>>
>>>> Hi,
>>>>
>>>> is it possible to toggle between a .cc file and a .h file with the
>>>> same name in the editor? What I mean is, I want to open e.g. a file
>>>> with the name "code.h" in the editor if file "code.cc" is the
>>>> currently opened one. And of course the other way round.
>>>>
>>>> Thanks,
>>>> Michal
>>>>
>>
Re: toggle between .cc and .h file [message #154926 is a reply to message #154793] Thu, 22 September 2005 09:05 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: boffman.boffman.se

I also used this feature alot in MS studio. I just installed Eclipse for
the first time, after having tried SEVERAL other editors, without having
found one with all the features of Visual Studio plus the Visual Assist
addon. Until now: Eclipse with CDT!! I've smiled all day now. It's just
this small thing left!

"Open Definition" doesn't work from the h-file for me (it seems like it
just "gets back" to the same place again?). It works fine from a cpp file
though. I haven't found an easy way to switch from a header file to the
cpp file. Pleeaaasse add this, and fulfill my coding life, hehe..


> I believe there is an enhancement request on this. If not, please open one.

> I used this feature a lot when I worked in Visual Studio. It's handy
> when implementing methods of a class and you want to keep refering back
> to the class definition.

> Doug
Re: toggle between .cc and .h file [message #154988 is a reply to message #154793] Sat, 24 September 2005 06:15 Go to previous message
Eclipse UserFriend
Doug Schaefer wrote:
> I believe there is an enhancement request on this. If not, please open one.
>
> I used this feature a lot when I worked in Visual Studio. It's handy
> when implementing methods of a class and you want to keep refering back
> to the class definition.

It's also in kdevelop, a wonderful feature!
Previous Topic:Use Environment Variables in Make
Next Topic:Can't get add breakpoint to work
Goto Forum:
  


Current Time: Fri May 09 14:44:44 EDT 2025

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

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

Back to the top