Page 1 of 1

Add/go to implementation not working

Posted: Thu Jun 27, 2013 5:59 pm
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!

Re: Add/go to implementation not working

Posted: Thu Jun 27, 2013 6:14 pm
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

Re: Add/go to implementation not working

Posted: Thu Jun 27, 2013 6:33 pm
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).

Re: Add/go to implementation not working

Posted: Thu Jun 27, 2013 6:52 pm
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.

Re: Add/go to implementation not working

Posted: Fri Jun 28, 2013 8:08 am
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

Re: Add/go to implementation not working

Posted: Fri Jun 28, 2013 10:17 am
by netrick
It's amazing, thank you! However, is it possible to add shortcuts for such actions?

Re: Add/go to implementation not working

Posted: Fri Jun 28, 2013 10:22 am
by eranif
Settings -> Keyboard Shortcuts

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

Eran