code generation

General questions regarding the usage of CodeLite
temnozor
CodeLite Enthusiast
Posts: 12
Joined: Wed Jan 05, 2011 2:16 pm
Genuine User: Yes
IDE Question: c++
Contact:

code generation

Post by temnozor »

Hi,

is it possible to generate e.g. function declarations automatically?

e.g. i got my file foobar.cpp
and implement a funtion

Code: Select all

int foo(int bar){
   do something;
}
now i want to generate the declarations automatically in foobar.h or when there is none create one
that should be done by something like rightclick a function and choose "code generation->generate declarations" and would insert something like

Code: Select all

int foo(int);
into foobar.h

i just wondering because there is a codegenerator in contextmenu for "add function implementation" but not for add function declaration but it looks like its doing nothing for me

(maybe i have not figured out how to use it?)
User avatar
eranif
CodeLite Plugin
Posts: 6373
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: code generation

Post by eranif »

temnozor wrote:i just wondering because there is a codegenerator in contextmenu for "add function implementation" but not for add function declaration but it looks like its doing nothing for me
Put your mouse on the function declaration and select this option, if there is no implementation codelite will suggest one.

If it still does not work for you, please provide a sample project + step by step for how to reproduce it

Eran
Make sure you have read the HOW TO POST thread
frank_frl
CodeLite Expert
Posts: 176
Joined: Sun Aug 17, 2008 2:45 pm
Contact:

Re: code generation

Post by frank_frl »

temnozor wrote:(maybe i have not figured out how to use it?)
1. add the declaration to your header.
2. save that file!
3. place your mouse on the function declaration and select "Add Function Implementation..."

Frank
temnozor
CodeLite Enthusiast
Posts: 12
Joined: Wed Jan 05, 2011 2:16 pm
Genuine User: Yes
IDE Question: c++
Contact:

Re: code generation

Post by temnozor »

Ok i had to save the file first (otherwise its not working) and the foobar.cpp have to exist otherwise the implementation of declaration in foobar.h is put into the header file.
But is there a possibility to do it the way around? Writing the implementation and generate the declaration automatically?
User avatar
eranif
CodeLite Plugin
Posts: 6373
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: code generation

Post by eranif »

temnozor wrote:But is there a possibility to do it the way around? Writing the implementation and generate the declaration automatically?
No. But please submit a feature request for this

Eran
Make sure you have read the HOW TO POST thread
Post Reply