Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » Does code completion work ?
Does code completion work ? [message #160395] Wed, 14 December 2005 05:28 Go to next message
Eclipse UserFriend
I am a user of CDT for almost one year and I never saw the code completion
working. I thought it had something to do with the fact that I play with a
big library full of templates, something that is surely a bit confusing
for a code completion algorithm. Anyway, I just started to play with
single files and code completion seems always stuck...

Just to be sure, my file only contains these few lines :

struct A{
A(){;}
void pipo(){;}
}

A a;
a.

Then I press Ctrl+Space after the dot and eclipse says "no completion
available". Is this a normal behavior ?

CDT 3.0.1 / SDK 3.1.0, and my preferences
C/C++ --> editor --> Code Assist :
search curent file and includes
insert single
insert common
delay 3000
enable all
delay 1000

C/C++ --> indexer
Full C/C++ indexer (is this the problem ?)
Re: Does code completion work ? [message #160402 is a reply to message #160395] Wed, 14 December 2005 07:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ddaoust.ca.ibm.com

It works for me (when I modify your code to be syntactically correct):

struct A{
A(){;}
void pipo(){;}
};

int main(int argc, char **argv) {
A a;
a.
}
- Dave

ben wrote:
> I am a user of CDT for almost one year and I never saw the code
> completion working. I thought it had something to do with the fact that
> I play with a big library full of templates, something that is surely a
> bit confusing for a code completion algorithm. Anyway, I just started to
> play with single files and code completion seems always stuck...
>
> Just to be sure, my file only contains these few lines :
>
> struct A{
> A(){;}
> void pipo(){;}
> }
>
> A a;
> a.
>
> Then I press Ctrl+Space after the dot and eclipse says "no completion
> available". Is this a normal behavior ?
>
> CDT 3.0.1 / SDK 3.1.0, and my preferences
> C/C++ --> editor --> Code Assist :
> search curent file and includes
> insert single
> insert common
> delay 3000
> enable all
> delay 1000
>
> C/C++ --> indexer
> Full C/C++ indexer (is this the problem ?)
>
Re: Does code completion work ? [message #160410 is a reply to message #160402] Wed, 14 December 2005 08:17 Go to previous messageGo to next message
Eclipse UserFriend
I should have mentionned it : I also tried with a int main (void){ A a; a.
} structure.
Anyway, just to be sure I copy-pasted your sample code and the behavior is
the same :
a."Ctrl+space" is stuck
a.p"Ctrl+space" proposes me a long list starting with pipo() but
comprising strange things like pthread_attr_t or ptr_diff which are
templated types...
note also that changing the delcaration of a in the main :
{ B a;
a.p"ctrl+space"
}
still proposes me pipo() even if class B doe not provide that function...
Re: Does code completion work ? [message #160418 is a reply to message #160402] Wed, 14 December 2005 08:22 Go to previous messageGo to next message
Eclipse UserFriend
By the way, what is not syntactically correct in the sample code I
previously posted ? It seems to me that it is correct (though discouraged)
to declare a global object of type A.
Re: Does code completion work ? [message #160426 is a reply to message #160418] Wed, 14 December 2005 08:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ddaoust.ca.ibm.com

There were two errors: 1) missing semi-colon at the end of the struct
def'n and 2) the a. (or a.pipo()) in the sample makes no sense in a
global context (I always try to compile the code examples before
commenting on anything using the CDT parser -- it is fragile with
respect to invalid code)

a.<ctrl-space> gives me pipo and A

a.p<ctrl-space> gives me only pipo.

Try creating a new project with only this file in it. If you get
pthread_* methods, there is more to your project than this little example.



- Dave

ben wrote:
> By the way, what is not syntactically correct in the sample code I
> previously posted ? It seems to me that it is correct (though
> discouraged) to declare a global object of type A.
>
>
Re: Does code completion work ? [message #160449 is a reply to message #160426] Wed, 14 December 2005 11:36 Go to previous messageGo to next message
Eclipse UserFriend
David Daoust wrote:

> There were two errors: 1) missing semi-colon at the end of the struct
> def'n and 2) the a. (or a.pipo()) in the sample makes no sense in a
> global context (I always try to compile the code examples before
right... (shame)

> commenting on anything using the CDT parser -- it is fragile with
> respect to invalid code)
good advice

> a.<ctrl-space> gives me pipo and A
> a.p<ctrl-space> gives me only pipo.
> Try creating a new project with only this file in it. If you get
> pthread_* methods, there is more to your project than this little example.
well... I created a new C++ project with only that file in it.
I still have no completion enabled.
as for the "pthread" things it seems to come from the only
include:#include<iostream> that I add on the first line of the file
(commenting it results in no completion at all, uncommenting it results on
5 completion proposals for a.p : 4 pthread_cleanupxxx() and one putc()
Re: Does code completion work ? [message #160456 is a reply to message #160449] Wed, 14 December 2005 11:44 Go to previous message
Eclipse UserFriend
I precise :

a.p"ctrl+space" does nothing if #include<iostream> is commented and gives
5 results if it is not commented. Anyway, pipo() is never proposed.

p"ctrl+space" gives always a lot of things (the same lot of things wether
#include is commented or not), and pipo() is in it...
Previous Topic:Add Comment
Next Topic:capturing output in the console window.
Goto Forum:
  


Current Time: Fri Jun 20 14:38:57 EDT 2025

Powered by FUDForum. Page generated in 0.03278 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top