Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[pdt-dev] Newbie question: asking for help to get a PDT development environment setup

Hi list,

First of all, a big thanks to all the developers working on PDT. I've been using it for years, and it's definitely a great tool.
I'm writing this mail because I would like to try improving the autocomplete feature, but since I'm a bit of a noob regarding Eclipse plug-in development, I'd need just some hints to get started.

In short, here is what I'm trying to do:

I would like to improve PDT so that it can autocomplete arrays.

For instance, imagine a sample code like this:

class MyClass {
    public $a;
}

/**
 * @return array<MyClass>
 */
function myFunc() {
    return array(new MyClass());
}

$arr = myFunc();
foreach ($arr as $elem) {
    $elem->   /** Here, we would get some autocompletion on the MyClass fields */
}
I would like to code the support for the "array<Object>" notation (similar to C++ templates or Java annotations).
In most of PHP code I'm writing, methods and functions are returning arrays. And we don't have a correct autocompletion for these. I would like to address this issue.

I've had a quick look at PDT code, and I found in PHPSimpleTypes.java that all arrays are modeled using the DLTK MultiTypeType class. I'm not a DLTK expert, but it seems that MultiTypeType class accepts inner types using the addType method.

So basically, I don't know if it can be easily done, but I would like to give a try and implement this support for "generics" in PDT. My problem: I'm an experienced Java and PHP developer, but I'm a complete newbie regarding Eclipse plug-in development.
Of course, I read the PDT wiki, especially this page: http://wiki.eclipse.org/PDT_Development_Environment
Then, I tried to install the environment.
Here is the step I followed:

Since I wanted the latest trunk version of PDT, I tried to set-up an up-to-date environement.

The PDT wiki is a bit lacking information about it, certainly because this is a common task for Eclipse plug-in developers.

Step 1: I downloaded the "Eclipse RPC" release
Step 2: I started Eclipse, opened a new workspace, and Added those 2 update sites:
    - http://download.eclipse.org/releases/galileo (the default Eclipse repository)
    - http://download.eclipse.org/tools/mylyn/update/e3.4/ (the Mylin update site)

Then, I added those plugins:
    - Web Page Editor
    - Eclipse XML Editors and Tools
    - Eclipse Web Developer Tools
   
Now, I think I understood PDT 2.2 is using DLTK 2.0. Right now, I couldn't get an update site for DLTK 2.0 (or I did not find it) so I downloaded it from the DLTK website:
    - http://download.eclipse.org/technology/dltk/downloads/
I grabed the latest version (2.0M5) of the plugin and I unpacked it into the Eclipse directory.
I downloaded 2 files: "Core Frameworks" and "DLTK Mylyn Intergation"

Step 3: I followed instruction on the PDT wiki here:
    - http://wiki.eclipse.org/PDT_Development_Environment

Now, I have an environment that seems to be setup. There is no compilation error, so I thought everything was ok.
But I'm unable to start or export the project. When I open the PHPIde.product file and go to the "Dependencies" tab, I'm realize I'm missing many dependencies (org.eclipse.dltk.core.index, org.eclipse.emf, org.eclipse.xsd, etc...)

So I'm a bit lost. Is there a place where I could find the list of plugins that need to be installed to get a working PDT 2.2 environment?
Should I use a branch instead of the trunk?
Did I miss something? Should I start with another base Eclipse distribution? Would any of you developers have suggestions regarding nice articles explaining how to get started with Eclipse plugins or DLTK?

Any help getting started would be greatly appreciated.

Regards,
--

David Négrier


Back to the top