[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [pdt-dev] How to add code-completion for PHP Framework
- From: Michael Spector <spektom@xxxxxxxxx>
- Date: Wed, 28 Oct 2009 13:08:58 +0200
- Delivered-to: firstname.lastname@example.org
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=pcvNwp3aihPsx6GQPhZT7akUuQirciABwrG879NDEpZzT6sZaaa+jyOWG50j/GBxm/ SOahNh4YYZxReKoKanDCazIga2ToXB4mzEWC1rbsE8YOLI8438w+3W4+j36sA5OSW4P6 yE+/G+dLKvGufe6zgGKXIvhDRtooBuhDIEwSY=
I think goalEvaluatorFactories extension point would be sufficient for this specific purpose.
You just need to add a rule that evaluates structures like: ClassRegistry::init('MyObject'), and returns type (MyObject) for such cases. Take a look at org.eclipse.php.internal.core.typeinference.evaluators.InstanceCreationEvaluator as an example, which evaluates structures like: new MyObject().
On Wed, Oct 28, 2009 at 1:03 PM, <robert@xxxxxxxxxxx>
i'm trying to write an eclipse plugin for the Cakephp
framework, and i'd like to start off with some
additional framework-specific code assistance.
The framework uses a central "ClassRegistry" factory
for object instantiation. So, there's no "new" keyword for
some objects, for example:
$myObject = ClassRegistry::init('MyObject');
Basically i would like to give a hint to PDT that
the variable "$myObject" is an instance of the "MyObject"
class, which has already been loaded into the PDT Model,
so i guess i would simply point to the "MyObject" IType in
the Model somehow.
Could anyone give me a hint what would be the best method
to accomplish this? I've already had a look at the extension
and "goalEvaluatorFactories", but i'm not sure what's the best
way to hook into PDT for this kind of thing.
pdt-dev mailing list