Code Generation

CodeLite installation/troubleshooting forum
verojo
CodeLite Curious
Posts: 5
Joined: Fri Nov 20, 2009 3:51 pm
Genuine User: Yes
IDE Question: C++
Contact:

Code Generation

Post by verojo »

Hi!

When I add function member to class definition in header file
and then choose from menu Code Generation/Refactoring to
add function implementation ( or implement all un-implemented
functions ) nothing happens. CL version is 2.0.3365 on Ubuntu 9.10.
By the way, it works on Windows XP.

Guys, keep up the good work!

Bine
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Code Generation

Post by eranif »

Make sure that your file is saved - codelite parses methods / members after the file is being saved

Eran
Make sure you have read the HOW TO POST thread
verojo
CodeLite Curious
Posts: 5
Joined: Fri Nov 20, 2009 3:51 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Code Generation

Post by verojo »

Hi!

Sorry, I wanted to say, that this happens even if I save file.
And again, it works on Windows XP as expected, but not
on Ubuntu.

Bine
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Code Generation

Post by eranif »

This seems to work fine for me.
Can you confirm that it is happen for you for every class or just this one?

Eran
Make sure you have read the HOW TO POST thread
verojo
CodeLite Curious
Posts: 5
Joined: Fri Nov 20, 2009 3:51 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Code Generation

Post by verojo »

Well, it works. But I'm using gtkmm and as soon I base my class on Gtk::Window
for example, code generation stops working. If I choose to implement all unimplemented
functions, a message pops up, saying "Add function implementation can only work
inside valid scope, got <global>".

Bine
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Code Generation

Post by eranif »

Can you provide me link for gtkmm library + sample code where it fails? I would like to be able to reproduce it here (50% of the solution is reproducing the problem ;) )

Eran
Make sure you have read the HOW TO POST thread
verojo
CodeLite Curious
Posts: 5
Joined: Fri Nov 20, 2009 3:51 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Code Generation

Post by verojo »

This is the link : http://www.gtkmm.org/

And this is the sample code :

----------main.cpp-------------------------

#include "mainwindow.h"

int main(int argc, char **argv)
{
Gtk::Main kit( argc, argv );
MainWindow window;
Gtk::Main::run( window );
return 0;
}
---------------------------------------------------

---------mainwindow.h-----------------------

#ifndef __mainwindow__
#define __mainwindow__

#include <gtkmm.h>

class MainWindow : public Gtk::Window
{
public:
MainWindow();
~MainWindow();
void some_member(); // CL doesn't add function implementation
};
#endif // __mainwindow__
---------------------------------------------------

--------mainwindow.cpp--------------------

#include "mainwindow.h"

MainWindow::MainWindow()
{
}

MainWindow::~MainWindow()
{
}
--------------------------------------------------
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Code Generation

Post by eranif »

Indeed there was a bug in the scope resolving when the participant class inherits from a scoped class (i.e. NAMESPACE::CLASS_NAME) - note that this bug only affected this particular feature (add function implementation / add all un-implemented methods)

I fixed the grammar file and it is now working as expected (committed to trunk)

Eran
Make sure you have read the HOW TO POST thread
verojo
CodeLite Curious
Posts: 5
Joined: Fri Nov 20, 2009 3:51 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Code Generation

Post by verojo »

Yes, it is working now.
Thank you!

Bine
Post Reply