C code autocomplete in Eclipse

I am a Java developer, and I downloaded Eclipse for C (course objectives), and to my surprise, control space + space (for autocomplete) did not work. I created a new project and a new class using wizzards and started typing "print" and then tried to find the autocomplete function. After a few searches, I came to C/C++ β†’ Editor β†’ Content Assist β†’ Advanced , and there I checked that the options Help proposals , Parsing-based proposals and Template proposals were checked. Then I went to the Keys settings page using the link on this page and entered the binding for all the necessary content support up to C\C++ Content Assist (type...) and selected the C\C++ Editor option in the When field. But, alas, auto-update was not offered. Can someone point me in the right direction?

UPDATE: I accept the answer not because I am sure it is correct, but because I realized that I made some errors with the eclipse configuration and saw this with a different installation / configuration (i.e. a friend of the mines) eclipse does an automatic completion , even if it still lacks many features of the java version.

+7
c eclipse autocomplete
source share
7 answers

Although the eclipse does not provide perfect auto-completion, but it works. Sometimes this happens when you turn off the pointer.

Try turning on the index and rebuilding the index.

See this question in the CDT FAQ . It contains information on how to find an indexer error that could interfere with autocomplete.

+5
source share

Use the "Advanced" panel in the "Settings" window to configure the behavior of the Content Assist command (Ctrl + Space).
Go to Settings-> C / C ++ β†’ Editor-> Content Assistant-> Advanced .
Check the default parsing suggestions .

+5
source share

I'm not an Eclipse expert (and I don’t even play it on TV), but it may be that it only autocompletes the function names declared in the current area - did you add #include <stdio.h> to the beginning of your source file to get declarations for standard input / output functions?

0
source share


You must make sure that you have gcc home (i.e. C: \ MinGW-4.4.1 \ bin) defined in the path environment variable (if you use windows, and if not, it is equivalent). Also make sure the file has a .c suffix and that indexer is included, as you said. I think I'm not sure if you need to run an eclipse with the -clean flag, and autocomplete will work.

Ephaeus

0
source share

I answered this here: Eclipse: how to add an inclusion path that will be used when autocompletion

You need to explicitly indicate where to find the title:

β‡’ Right click on your project
β‡’ go to 'C / C ++ Include Paths and Symbols

β‡’ select "Add external inclusion path ..."
β‡’ Browse to the location of your header files
β‡’ update

0
source share

Perhaps this is due to KeyAssist bindings.

If you tried using the content:

Go to Window> Preferences. Menu "General" β†’ "Keys"

Inside the search for "Template" and set:

Key Snap to β†’ "Ctrl + Space"

When: "Edit Test"

Image Assistant Key Assist Code Complete

-one
source share

Vim offers this function by scanning #include (shortcut Ctrl-N or Ctrl-P to search backward). If you cannot find a better solution, the latter tool can be considered in eclim , which integrates vim functions into Eclipse (or vice versa), and this will certainly offer this function.

-2
source share

All Articles