Add/go to implementation not working

General questions regarding the usage of CodeLite
netrick
CodeLite Enthusiast
Posts: 19
Joined: Fri Dec 07, 2012 8:20 pm
Genuine User: Yes
IDE Question: C++
Contact:

Add/go to implementation not working

Post by netrick »

I use codelite 5.1 on Lubuntu 13.04. Both add function implementation and go to implementation don't work for me.

1) Go to implementation bug:

test.hpp

Code: Select all

class test
{
   void foo(); //I select it, click go to implementation and nothing happens
//desired behaviour is to switch to .cpp file on the function implementation
};
test.cpp

Code: Select all

#include "test.hpp"
void test::foo()
{
  //stuff
}
2) Add implementation bug:

test.hpp

Code: Select all

class test
{
   void foo(); //I select it, click add implementation and nothing happens
//desired behaviour is to add empty definition in .cpp file (or at least in clipboard). That would make my development just rapid.
};
test.cpp

Code: Select all

#include "test.hpp"
//empty file, just created and added to project (using create class wizard)
I hope you can fix it quickly. Thanks!
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Add/go to implementation not working

Post by eranif »

What happens when you click 'Ctrl-Shift-O' ? do you see the outline properly?
How many files do you have in your workspace? is it possible that class test is defined elsewhere?

Please provide a workspace example where it fails - as I can't reproduce it (works fine here)

Eran
Make sure you have read the HOW TO POST thread
netrick
CodeLite Enthusiast
Posts: 19
Joined: Fri Dec 07, 2012 8:20 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Add/go to implementation not working

Post by netrick »

ctrl-shift-o shows everything properly.
Class is for sure unique. I have about 20 files, but I have 3 projects in it.

Well, but here is ultra simple workspace for which it fails. (in this case, I try to add function "void foo()" implementation and nothing happens).
You do not have the required permissions to view the files attached to this post.
netrick
CodeLite Enthusiast
Posts: 19
Joined: Fri Dec 07, 2012 8:20 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Add/go to implementation not working

Post by netrick »

I got it!

Code: Select all

void foo();
It works only when I select "foo()". Don't you think that allowing to select whole line ("void foo();") is much easier and more intuitive? I think that's a good improvment and should be very easy to implement.
Currently it's counter-productive as I must be very focused on selecting only function name.
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Add/go to implementation not working

Post by eranif »

netrick wrote:Currently it's counter-productive as I must be very focused on selecting only function name.
You can simply place the caret on the function name without selecting it - this will also work for you

In general, codelite takes the "word" under caret - unless there is a selection.
so.. :

- go to definition: place the caret on the functions (no need to select) and 'go to implementation'
- add function implementation: same as above: just place the caret on top of the function _name_

In addition, I usually use the "Implement all un-implemented functions" (this one requires no selection, just place the caret inside a class body)

Eran
Make sure you have read the HOW TO POST thread
netrick
CodeLite Enthusiast
Posts: 19
Joined: Fri Dec 07, 2012 8:20 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Add/go to implementation not working

Post by netrick »

It's amazing, thank you! However, is it possible to add shortcuts for such actions?
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Add/go to implementation not working

Post by eranif »

Settings -> Keyboard Shortcuts

It should be under:
Menu column, C++::Code Generation / Refactoring

Eran
Make sure you have read the HOW TO POST thread
Post Reply