Page 1 of 1

Add function implementation not working

Posted: Tue Aug 19, 2008 3:44 pm
by frank_frl
Hi Eran,

when I add a function declaration to a class in the header file, select the function name and the choose 'Add function implementation...' nothing happens at all.

CodeLite rev. 1927, WinXP, SP2

Regards,

Frank

Re: Add function implementation not working

Posted: Tue Aug 19, 2008 4:25 pm
by eranif
Several things:

1. Make sure the file you are using is part of a project
2. Save the fie before attempting to do any 'Code Generation/ Refactoring', if this does not work try to re-tag the workspace (workspace context menu -> retag workspace)

Another question: does 'add all un-implemented functions' - works?

Can u post some code here?

Eran

Re: Add function implementation not working

Posted: Tue Aug 19, 2008 7:44 pm
by frank_frl
Hi Eran,
1. Make sure the file you are using is part of a project
2. Save the fie before attempting to do any 'Code Generation/ Refactoring', if this does not work try to re-tag the workspace (workspace context menu -> retag workspace)
I did that.

For test purpose I created a wxWidgets project with your wizard. The I added 2 functions declarations to the header e.g.

Code: Select all

#ifndef __TestbuildFrame__
#define __TestbuildFrame__

#include "wx/frame.h"

class TestbuildFrame : public wxFrame {

private:
	void Initialize();
	void CreateMenuBar();

	void TestFunction();   
	void TestFoo();

public:
	TestbuildFrame(wxWindow* parent,
            wxWindowID id,
            const wxString& title,
            const wxPoint& pos = wxDefaultPosition,
            const wxSize& size = wxDefaultSize,
            long style = wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER);

	~TestbuildFrame();
	DECLARE_EVENT_TABLE()
	
	void OnClose(wxCloseEvent &e);
	void OnQuit(wxCommandEvent &e);
	
};
#endif // __TestbuildFrame__
For 'TestFunction()' function implementation works, but for 'TestFoo()' not. When choose 'Implement all Un-implemented' they appear both.

Regards,

Frank

Re: Add function implementation not working

Posted: Tue Aug 19, 2008 8:55 pm
by eranif
mm, I did this:
- create new wxwidgets project using the wizard
- copy pasted the 2 declarations of TestFoo() and TestFunction (and saved the file)
- right click on the function name TestFunction() and select 'add function implementation' - worked
- right click on the function name TestFoo() and select 'add function implementation' - worked

Are these the exact steps you did?
Maybe one last guess: When u go 'Settings -> Tags Settings..' In the 'Basics' tab, do you have 'Cache workspace tags' enabled? (if it is enabled, please turn it off)

this is my header file:

Code: Select all

#ifndef __IuuyFrame__
#define __IuuyFrame__

#include "wx/frame.h"

class IuuyFrame : public wxFrame {

private:
	void Initialize();
	void CreateMenuBar();
	
	void TestFunction();   
	void TestFoo();
	
public:
	IuuyFrame(wxWindow* parent,
            wxWindowID id,
            const wxString& title,
            const wxPoint& pos = wxDefaultPosition,
            const wxSize& size = wxDefaultSize,
            long style = wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER);

	~IuuyFrame();
	DECLARE_EVENT_TABLE()
	
	void OnClose(wxCloseEvent &e);
	void OnQuit(wxCommandEvent &e);
	
};
#endif // __IuuyFrame__
Eran

Re: Add function implementation not working

Posted: Tue Aug 19, 2008 10:20 pm
by frank_frl
Hi Eran,

the problem in my project was, that I didn't had all headers in the project tree. If you open a header just by 'swap source - header' and save it than, it is not re-tagged, you have to force it than to get function implementation working.

The reason why it didn't worked in the sample frame might have been the 'cache workspace tags' setting, I could not reproduce it again.

Thanks for your fast reply,

Frank

Re: Add function implementation not working

Posted: Tue Aug 19, 2008 10:43 pm
by eranif
frank_frl wrote:The reason why it didn't worked in the sample frame might have been the 'cache workspace tags' setting
This one will not be a problem anymore, I improved the performance of the tags so it is no longer needed and in the current trunk (rev2003) it is disabled and can not be turned on again.

Only files which are part of the workspace are retagged (tagging is done automatically once the file is saved) the re-tag is a more of a backup system nothing more, and normally you should not force retagging on file(s)

Glad to hear that it is working OK for you now - let me know if you encounter any other oddities.
Eran