toggle between .cc and .h file [message #154700] |
Tue, 20 September 2005 03:29  |
Eclipse User |
|
|
|
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 #154747 is a reply to message #154740] |
Wed, 21 September 2005 09:06   |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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 #154988 is a reply to message #154793] |
Sat, 24 September 2005 06:15  |
Eclipse User |
|
|
|
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!
|
|
|
Powered by
FUDForum. Page generated in 0.04213 seconds