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 » Fri Nov 20, 2009 4:28 pm

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: 6091
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Code Generation

Post by eranif » Fri Nov 20, 2009 4:36 pm

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 » Fri Nov 20, 2009 4:55 pm

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: 6091
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Code Generation

Post by eranif » Fri Nov 20, 2009 5:11 pm

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 » Fri Nov 20, 2009 9:21 pm

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: 6091
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Code Generation

Post by eranif » Fri Nov 20, 2009 10:36 pm

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 » Fri Nov 20, 2009 11:15 pm

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: 6091
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Code Generation

Post by eranif » Fri Nov 20, 2009 11:49 pm

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 » Sat Nov 21, 2009 12:45 am

Yes, it is working now.
Thank you!

Bine

Post Reply