Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » Problem with Content Assist and C/C++-Indexer
Problem with Content Assist and C/C++-Indexer [message #106015] Sun, 13 June 2004 07:26 Go to next message
Eclipse UserFriend
Originally posted by: fkmk.kupzog.de

Hello CDT users,

I recently changed to Eclipse 3 and CDT 2.0 (on Windows XP). I did this
because I was hoping that some features I got used to during Java
development would be available in CDT 2.0 (compared to 1.2).

I encountered the following problems:

- The Content Assist does never show anything, it always times out (even
if I set the timout to very high values)

- Everytime I start Eclipse the C++-Indexer runs for a while. Does it
not safe it´s former results somewhere? I fear it will be indexing for
ages if my project grows....
Is this problem related to the Content Assist function?

- The Indexer shows an error in each file of the following format:
#ifndef __IRCONTAINER
#define __IRCONTAINER
// class definition goes here
#endif
The final #endif is "unbalanced". Why?


Well, as long there is no Content Assist working I could also use a text
editor and the command line instead of Eclipse...

Perhaps you have some hints for me where the problem could come from. I
guess CDT is not so bad as it seems to be for me at the moment :)

Regards,
Friederich
Re: Problem with Content Assist and C/C++-Indexer [message #106059 is a reply to message #106015] Sun, 13 June 2004 17:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ddaoust.ca.ibm.com

I created a file with:
#ifndef __IRCONTAINER
#define __IRCONTAINER
// class definition goes here
#endif
#ifdef __IR

Content assist has no problem expanding __IR to __IRCONTAINER and there
doesn't seem to be a problem with the #endif. If you have a example that
fails, please raise a defect in bugzilla.

I am using Eclipse 3.0 RC2 and the latest CDT.

The indexer does save its results to the disk periodically. If you kill it,
or exit eclipse while it is running, it may not save its current state.

Note that the index is not used for content assist. Currently the index is
only used for search and refactor operations.

- Dave

"Friederich Kupzog" <fkmk@kupzog.de> wrote in message
news:cahd7p$esv$1@eclipse.org...
> Hello CDT users,
>
> I recently changed to Eclipse 3 and CDT 2.0 (on Windows XP). I did this
> because I was hoping that some features I got used to during Java
> development would be available in CDT 2.0 (compared to 1.2).
>
> I encountered the following problems:
>
> - The Content Assist does never show anything, it always times out (even
> if I set the timout to very high values)
>
> - Everytime I start Eclipse the C++-Indexer runs for a while. Does it
> not safe it
Re: Problem with Content Assist and C/C++-Indexer [message #106125 is a reply to message #106059] Mon, 14 June 2004 05:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: fkmk.kupzog.de

Hello David,

so the Indexer is not the problem. Is there any common error I am likely
to do that causes my Content Assist not work?

Thanks,
Friederich


David Daoust wrote:

> I created a file with:
> #ifndef __IRCONTAINER
> #define __IRCONTAINER
> // class definition goes here
> #endif
> #ifdef __IR
>
> Content assist has no problem expanding __IR to __IRCONTAINER and there
> doesn't seem to be a problem with the #endif. If you have a example that
> fails, please raise a defect in bugzilla.
>
> I am using Eclipse 3.0 RC2 and the latest CDT.
>
> The indexer does save its results to the disk periodically. If you kill it,
> or exit eclipse while it is running, it may not save its current state.
>
> Note that the index is not used for content assist. Currently the index is
> only used for search and refactor operations.
>
> - Dave
>
> "Friederich Kupzog" <fkmk@kupzog.de> wrote in message
> news:cahd7p$esv$1@eclipse.org...
>
>>Hello CDT users,
>>
>>I recently changed to Eclipse 3 and CDT 2.0 (on Windows XP). I did this
>>because I was hoping that some features I got used to during Java
>>development would be available in CDT 2.0 (compared to 1.2).
>>
>>I encountered the following problems:
>>
>>- The Content Assist does never show anything, it always times out (even
>>if I set the timout to very high values)
>>
>>- Everytime I start Eclipse the C++-Indexer runs for a while. Does it
>>not safe it´s former results somewhere? I fear it will be indexing for
>>ages if my project grows....
>>Is this problem related to the Content Assist function?
>>
>>- The Indexer shows an error in each file of the following format:
>> #ifndef __IRCONTAINER
>> #define __IRCONTAINER
>> // class definition goes here
>> #endif
>>The final #endif is "unbalanced". Why?
>>
>>
>>Well, as long there is no Content Assist working I could also use a text
>>editor and the command line instead of Eclipse...
>>
>>Perhaps you have some hints for me where the problem could come from. I
>>guess CDT is not so bad as it seems to be for me at the moment :)
>>
>>Regards,
>>Friederich
>
>
>
Re: Problem with Content Assist and C/C++-Indexer [message #106175 is a reply to message #106125] Mon, 14 June 2004 07:37 Go to previous messageGo to next message
Eclipse UserFriend
There is a time-out preference of the C Editor page for Content Assist. Its
default value is 3000 msecs (3 seconds).
We are working hard to improve the performance of the parse so that this
timeout value yields results for most complex files.
For the sake of exploring whether or not content assist is working for your
workspace, please increase the timeout to something substantially larger and
see if you get any proposals.

"Friederich Kupzog" <fkmk@kupzog.de> wrote in message
news:cajpn4$j7c$1@eclipse.org...
> Hello David,
>
> so the Indexer is not the problem. Is there any common error I am likely
> to do that causes my Content Assist not work?
>
> Thanks,
> Friederich
>
>
> David Daoust wrote:
>
> > I created a file with:
> > #ifndef __IRCONTAINER
> > #define __IRCONTAINER
> > // class definition goes here
> > #endif
> > #ifdef __IR
> >
> > Content assist has no problem expanding __IR to __IRCONTAINER and there
> > doesn't seem to be a problem with the #endif. If you have a example
that
> > fails, please raise a defect in bugzilla.
> >
> > I am using Eclipse 3.0 RC2 and the latest CDT.
> >
> > The indexer does save its results to the disk periodically. If you kill
it,
> > or exit eclipse while it is running, it may not save its current state.
> >
> > Note that the index is not used for content assist. Currently the index
is
> > only used for search and refactor operations.
> >
> > - Dave
> >
> > "Friederich Kupzog" <fkmk@kupzog.de> wrote in message
> > news:cahd7p$esv$1@eclipse.org...
> >
> >>Hello CDT users,
> >>
> >>I recently changed to Eclipse 3 and CDT 2.0 (on Windows XP). I did this
> >>because I was hoping that some features I got used to during Java
> >>development would be available in CDT 2.0 (compared to 1.2).
> >>
> >>I encountered the following problems:
> >>
> >>- The Content Assist does never show anything, it always times out (even
> >>if I set the timout to very high values)
> >>
> >>- Everytime I start Eclipse the C++-Indexer runs for a while. Does it
> >>not safe it
Re: Problem with Content Assist and C/C++-Indexer [message #106246 is a reply to message #106175] Mon, 14 June 2004 12:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: fkmk.kupzog.de

johnc wrote:
> For the sake of exploring whether or not content assist is working for your
> workspace, please increase the timeout to something substantially larger and
> see if you get any proposals.

As I said before, I have already tried this with no result.
Regards,
Friederich

>
> "Friederich Kupzog" <fkmk@kupzog.de> wrote in message
> news:cajpn4$j7c$1@eclipse.org...
>
>>Hello David,
>>
>>so the Indexer is not the problem. Is there any common error I am likely
>>to do that causes my Content Assist not work?
>>
>>Thanks,
>>Friederich
>>
>>
>>David Daoust wrote:
>>
>>
>>>I created a file with:
>>>#ifndef __IRCONTAINER
>>>#define __IRCONTAINER
>>>// class definition goes here
>>>#endif
>>>#ifdef __IR
>>>
>>>Content assist has no problem expanding __IR to __IRCONTAINER and there
>>>doesn't seem to be a problem with the #endif. If you have a example
>
> that
>
>>>fails, please raise a defect in bugzilla.
>>>
>>>I am using Eclipse 3.0 RC2 and the latest CDT.
>>>
>>>The indexer does save its results to the disk periodically. If you kill
>
> it,
>
>>>or exit eclipse while it is running, it may not save its current state.
>>>
>>>Note that the index is not used for content assist. Currently the index
>
> is
>
>>>only used for search and refactor operations.
>>>
>>> - Dave
>>>
>>>"Friederich Kupzog" <fkmk@kupzog.de> wrote in message
>>>news:cahd7p$esv$1@eclipse.org...
>>>
>>>
>>>>Hello CDT users,
>>>>
>>>>I recently changed to Eclipse 3 and CDT 2.0 (on Windows XP). I did this
>>>>because I was hoping that some features I got used to during Java
>>>>development would be available in CDT 2.0 (compared to 1.2).
>>>>
>>>>I encountered the following problems:
>>>>
>>>>- The Content Assist does never show anything, it always times out (even
>>>>if I set the timout to very high values)
>>>>
>>>>- Everytime I start Eclipse the C++-Indexer runs for a while. Does it
>>>>not safe it´s former results somewhere? I fear it will be indexing for
>>>>ages if my project grows....
>>>>Is this problem related to the Content Assist function?
>>>>
>>>>- The Indexer shows an error in each file of the following format:
>>>> #ifndef __IRCONTAINER
>>>> #define __IRCONTAINER
>>>> // class definition goes here
>>>> #endif
>>>>The final #endif is "unbalanced". Why?
>>>>
>>>>
>>>>Well, as long there is no Content Assist working I could also use a text
>>>>editor and the command line instead of Eclipse...
>>>>
>>>>Perhaps you have some hints for me where the problem could come from. I
>>>>guess CDT is not so bad as it seems to be for me at the moment :)
>>>>
>>>>Regards,
>>>>Friederich
>>>
>>>
>>>
>
>
Re: Problem with Content Assist and C/C++-Indexer [message #106260 is a reply to message #106015] Mon, 14 June 2004 13:48 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: schmidt.2002.gmx.de

On Sun, 13 Jun 2004 13:26:48 +0200, Friederich Kupzog <fkmk@kupzog.de>
wrote:

> I recently changed to Eclipse 3 and CDT 2.0 (on Windows XP). I did this
> because I was hoping that some features I got used to during Java
> development would be available in CDT 2.0 (compared to 1.2).
>
> I encountered the following problems:
>
> - The Content Assist does never show anything, it always times out (even
> if I set the timout to very high values)
>
> - Everytime I start Eclipse the C++-Indexer runs for a while. Does it
> not safe it´s former results somewhere? I fear it will be indexing for
> ages if my project grows....
> Is this problem related to the Content Assist function?
>
> - The Indexer shows an error in each file of the following format:
> #ifndef __IRCONTAINER
> #define __IRCONTAINER
> // class definition goes here
> #endif
> The final #endif is "unbalanced". Why?
>
>
> Well, as long there is no Content Assist working I could also use a text
> editor and the command line instead of Eclipse...
>
> Perhaps you have some hints for me where the problem could come from. I
> guess CDT is not so bad as it seems to be for me at the moment :)

Yes, CDT M9 is really quite good. I use it with Eclipse 3.0 RC2. It took
me a while today to get it running with the Content Assist working. There
are two things you should do:

1. In the Project Properties of your C++ project, see "C/C++ Indexer" and
check the option "Enable Index Problem Reporting". This should really be
turned on by default, because w/o it, you never know why the Content
Assist does not work.

2. When you have turned it on, you will probably find a question mark at
some of the include directives: Could not find header file or sth similar.
Add the appropriate include paths in the Project Properties: In
"C/C++ Include Paths & Symbols", click on "Discovered Paths" and choose
"Add Include Path from Workspace..." to add local directories where CDT
can find your header files. Also, click "Add External Include Path" and
choose sth like /usr/include/c++/3.2.2. On your system, it might be sth
like c:\cygwin\include\c++\3.x.x or so. The path has to contain the files
vector, iostream, etc.

After that, Refresh, Clean, and Rebuild. It should work.

It might to help create a completely new project and start it again.
Create a new project, create a new class with the wizard.

Generally, when creating a new project, I had better experiences with the
"standard make c++ project" where I wrote my own makefile.

Here is a simple example Makefile. It takes your main.cpp file and
compiles it into main.exe:

OFILES=main.o
TARGET=main.exe

all: $(TARGET)
$(TARGET):$(OFILES)
g++ $(OFILES) -o $@
%.o: %.cpp
g++ -I. -c -o $@ $<
clean:
rm -rf *.o test
Re: Problem with Content Assist and C/C++-Indexer [message #106316 is a reply to message #106260] Tue, 15 June 2004 05:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: fkmk.kupzog.de

Hello Andreas,

thank you very much for this detailed reply. I will try what you proposed.

I already switched on the error reporting and got some errors that I do
not understand. I will try to get rid of them.

So far an interesting contradiction is that Dave said "Note that the
index is not used for content assist. Currently the index is
only used for search and refactor operations."

Maybe indexer errors show also the reasons of content assist confusions.

Thanks a lot
Friederich


Andreas Schmidt wrote:
> On Sun, 13 Jun 2004 13:26:48 +0200, Friederich Kupzog <fkmk@kupzog.de>
> wrote:
>
>> I recently changed to Eclipse 3 and CDT 2.0 (on Windows XP). I did
>> this because I was hoping that some features I got used to during
>> Java development would be available in CDT 2.0 (compared to 1.2).
>>
>> I encountered the following problems:
>>
>> - The Content Assist does never show anything, it always times out
>> (even if I set the timout to very high values)
>>
>> - Everytime I start Eclipse the C++-Indexer runs for a while. Does it
>> not safe it´s former results somewhere? I fear it will be indexing
>> for ages if my project grows....
>> Is this problem related to the Content Assist function?
>>
>> - The Indexer shows an error in each file of the following format:
>> #ifndef __IRCONTAINER
>> #define __IRCONTAINER
>> // class definition goes here
>> #endif
>> The final #endif is "unbalanced". Why?
>>
>>
>> Well, as long there is no Content Assist working I could also use a
>> text editor and the command line instead of Eclipse...
>>
>> Perhaps you have some hints for me where the problem could come from.
>> I guess CDT is not so bad as it seems to be for me at the moment :)
>
>
> Yes, CDT M9 is really quite good. I use it with Eclipse 3.0 RC2. It
> took me a while today to get it running with the Content Assist
> working. There are two things you should do:
>
> 1. In the Project Properties of your C++ project, see "C/C++ Indexer"
> and check the option "Enable Index Problem Reporting". This should
> really be turned on by default, because w/o it, you never know why the
> Content Assist does not work.
>
> 2. When you have turned it on, you will probably find a question mark
> at some of the include directives: Could not find header file or sth
> similar. Add the appropriate include paths in the Project Properties:
> In "C/C++ Include Paths & Symbols", click on "Discovered Paths" and
> choose "Add Include Path from Workspace..." to add local directories
> where CDT can find your header files. Also, click "Add External Include
> Path" and choose sth like /usr/include/c++/3.2.2. On your system, it
> might be sth like c:\cygwin\include\c++\3.x.x or so. The path has to
> contain the files vector, iostream, etc.
>
> After that, Refresh, Clean, and Rebuild. It should work.
>
> It might to help create a completely new project and start it again.
> Create a new project, create a new class with the wizard.
>
> Generally, when creating a new project, I had better experiences with
> the "standard make c++ project" where I wrote my own makefile.
>
> Here is a simple example Makefile. It takes your main.cpp file and
> compiles it into main.exe:
>
> OFILES=main.o
> TARGET=main.exe
>
> all: $(TARGET)
> $(TARGET):$(OFILES)
> g++ $(OFILES) -o $@
> %.o: %.cpp
> g++ -I. -c -o $@ $<
> clean:
> rm -rf *.o test
Re: Problem with Content Assist and C/C++-Indexer [message #106328 is a reply to message #106316] Tue, 15 June 2004 08:10 Go to previous message
Eclipse UserFriend
Originally posted by: ddaoust.ca.ibm.com

Both the indexer, and content assist use the C/C++ parser. The error
messages that the index is reporting originate in the parser. These error
messages can be used to debug both features. There is also a .log file in
the metadata directory that has these error messages (but there is a ton of
junk in there as well)

Virutally all errors in content assist that we have seen, have been related
to environmental issues -- such as include paths and predefined macros.
With the current CDT, there is still performance issues with the parser, so
content assist times of 10 sec may happen.

- Dave

"Friederich Kupzog" <fkmk@kupzog.de> wrote in message
news:camdch$jcq$1@eclipse.org...
> Hello Andreas,
>
> thank you very much for this detailed reply. I will try what you proposed.
>
> I already switched on the error reporting and got some errors that I do
> not understand. I will try to get rid of them.
>
> So far an interesting contradiction is that Dave said "Note that the
> index is not used for content assist. Currently the index is
> only used for search and refactor operations."
>
> Maybe indexer errors show also the reasons of content assist confusions.
>
> Thanks a lot
> Friederich
>
>
> Andreas Schmidt wrote:
> > On Sun, 13 Jun 2004 13:26:48 +0200, Friederich Kupzog <fkmk@kupzog.de>
> > wrote:
> >
> >> I recently changed to Eclipse 3 and CDT 2.0 (on Windows XP). I did
> >> this because I was hoping that some features I got used to during
> >> Java development would be available in CDT 2.0 (compared to 1.2).
> >>
> >> I encountered the following problems:
> >>
> >> - The Content Assist does never show anything, it always times out
> >> (even if I set the timout to very high values)
> >>
> >> - Everytime I start Eclipse the C++-Indexer runs for a while. Does it
> >> not safe it
Previous Topic:Please help: which Programs are used for the Elf Binary Parsers?
Next Topic:gdb refusing to launch (eclipse 3.0RC2 - CDTM9 - gdb cygwin 20030919-r1)
Goto Forum:
  


Current Time: Sat Jun 21 12:26:57 EDT 2025

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

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

Back to the top