Page 1 of 1

code generation

Posted: Sat Jan 15, 2011 2:00 pm
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?)

Re: code generation

Posted: Sat Jan 15, 2011 6:52 pm
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

Re: code generation

Posted: Sat Jan 15, 2011 8:28 pm
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

Re: code generation

Posted: Sun Jan 16, 2011 12:45 am
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?

Re: code generation

Posted: Sun Jan 16, 2011 9:20 am
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