Page 1 of 1
Code Generation
Posted: Fri Nov 20, 2009 4:28 pm
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
Re: Code Generation
Posted: Fri Nov 20, 2009 4:36 pm
by eranif
Make sure that your file is saved - codelite parses methods / members after the file is being saved
Eran
Re: Code Generation
Posted: Fri Nov 20, 2009 4:55 pm
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
Re: Code Generation
Posted: Fri Nov 20, 2009 5:11 pm
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
Re: Code Generation
Posted: Fri Nov 20, 2009 9:21 pm
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
Re: Code Generation
Posted: Fri Nov 20, 2009 10:36 pm
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
Re: Code Generation
Posted: Fri Nov 20, 2009 11:15 pm
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()
{
}
--------------------------------------------------
Re: Code Generation
Posted: Fri Nov 20, 2009 11:49 pm
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
Re: Code Generation
Posted: Sat Nov 21, 2009 12:45 am
by verojo
Yes, it is working now.
Thank you!
Bine