Code completion for GTK+ does not work with ctags

CodeLite installation/troubleshooting forum
MaSydJun
CodeLite Curious
Posts: 3
Joined: Sun Dec 16, 2012 5:20 pm
Genuine User: Yes
IDE Question: C++
Contact:

Code completion for GTK+ does not work with ctags

Post by MaSydJun »

Hi,

I use Archlinux x86_64 with CodeLite v. 4.1.5770 (self compiled, since I use the CodeLite package from the AUR).
My ctags include search paths are the default paths + the gtk include paths (full content will follow later).

Even after retagging the workspace (full) code completion does not work for any gtk symbols.
Everything works fine for gtkmm.
Might that be due to the fact that gtk is written in C and gtkmm in C++?

Regards

EDIT:
This is the content of my CTags search paths:

Code: Select all

/usr/include/QtCore
/usr/include
/usr/include/QtXml
/usr/include/wx-2.8
/usr/include/gtk-3.0/gtk
/usr/include/gtkmm-3.0
/usr/include/gtkmm-3.0/gtkmm
I also tried it with gtk-2.0: same result.
Code, no code completion for me:

Code: Select all

window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(window), "Title");
gtk_window_set_default_size(GTK_WINDOW(window), 600, 300);
gtk_container_set_border_width(GTK_CONTAINER(window), 5);
Last edited by MaSydJun on Tue Dec 18, 2012 1:57 am, edited 1 time in total.
User avatar
eranif
CodeLite Plugin
Posts: 6373
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Code completion for GTK+ does not work with ctags

Post by eranif »

Pasting your code completion search paths will help + a sample code (note that it is working fine for me, so I am guessing its just a settings issue)

In the meanwhile - you should enable clang code completion from:
Settings -> tags settings -> clang -> enable clang code completion

Next, perform a full rebuild of your workspace - and your code completion should work

Thanks,
Eran
Make sure you have read the HOW TO POST thread
MaSydJun
CodeLite Curious
Posts: 3
Joined: Sun Dec 16, 2012 5:20 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Code completion for GTK+ does not work with ctags

Post by MaSydJun »

I edited my first post and added all the necessary information, hope it helps.

I also tried the Code::Blocks IDE. Code completion for GTK+ works there, but I dont want to switch to C::B since CodeLite is too awesome!!

EDIT:
LOL. Obviously I was just too dumb…
Sorry for wasting your time.

Well, I tried you suggestion to use the clang parser. I did it.
After setting the search paths of clang to something like '/usr/include/gtk-3.0/gtk' it gave my an "compilation error, file not found <gtk/gtk.h>" or something like tha, when trying to get calltips or code completion.
I added all the gtk related stuff and everything that might be needed by gtk, et voilà:

Code: Select all

/usr/include/gtk-3.0
/usr/include/gtk-3.0/gtk
/usr/include/gtk-3.0/gdk
/usr/include/glib-2.0
/usr/include/glib-2.0/gio
/usr/include/glib-2.0/glib
/usr/include/glib-2.0/gobject
It works!

Then i decided to be smart and take that piece of search paths and paste it into the ctags search paths (after disabling clang) and finally it works even without clang! Thanks this is awesome!!
Post Reply