Code completion for PHP-GTK in Eclipse PDT

Enabling PHP-GTK2 code completion in Eclipse PDT for a project is very simple. The following example is given on Windows, but the steps should be the same on any supported platform:

  1. First run the Gtk_Dumper.php extractor as described on the previous page, and save the generated skeleton file to some stable directory, say e:\src\php\php-gtk\stubs-2.0.1.php for code completion on the PHP-GTK 2.0.1 version.
  2. Now, start Eclipse with the PHP perspective
  3. Create a new project to hold the skeletons
  4. Add the path to the directory containing the just-generated skeleton file
  5. Save that project
  6. Now create a new PHP project
  7. On the properties page for the new project, reference the existing project you just created for the skeleton file
  8. It's ready

Note that code completion in Eclipse PDT shows:

  • the types of parameters passed to methods
  • class constants (like Gtk::BUILDER_ERROR_*)
  • the additional comments describing the various symbols, (like "/* or NULL */) on optional method parameters

Helios update (2010-06-29)

With the first releases of the Helios platform, on both Win32 and MacOS X, you may find lots of stack exceptions, especially when opening large files/projects. These can ben mostly removed in at least two ways:
  • Simplest: disable "Semantic Highlighting". Of course this means losing on functionality
  • More advanced, suggested by Pierre Rineau: It also depends on the tuning you could have done in your eclipse.ini file. In all cases, raising the -Xms and -Xmx settings to a reasonable amount should cut off most the OutOfMemoryException. You might also want to raise the -XX:PermSize and -XX:MaxPermSize settings to a higher amount than default one. You can also activate the -Dide.gc=true options if you are funky. I currently use this settings, and it works really fine:
    --launcher.XXMaxPermSize 256m