Hi!
I've read and implemented a plugin for extending PDT to achieve the type
reference hinting (works just out of the box), as described on the wiki
page: http://wiki.eclipse.org/Extending_PDT_2.2
$myObject = ClassRegistry::init('MyClass');

Now, I have another use case when I want to to do the same creation but
using a constant or variable. E.g.:

*class SomeClass {*
*    const MY_CONSTANT = 'MyClass';*
*...*
*$myObject = ClassRegistry::init(SomeClass::MY_CONSTANT);*

or:

*const MY_CONSTANT = 'MyClass';*
*...*
*$myObject = ClassRegistry::init(self::MY_CONSTANT);*
*
*
*or:*

*$className = ''MyClass;*
*$myObject = ClassRegistry::init($className);*


I figured I need to evaluate that input somehow in my implementing
GoalEvaluator, something like:

...
*public Object produceResult() {*
*    var String className = "DummyClassForNow";*
*    /* todo: evaluate and fetch value of constant or variable. */
    *
*    return new PHPClassType(className);*
*}*

But I am not sure how to actually do that. Can someone point me in the right
direction?

Thanks!

---

Nicklas Gummesson
_______________________________________________
pdt-dev mailing list
pdt-dev@eclipse.org
https://dev.eclipse.org/mailman/listinfo/pdt-dev

Reply via email to