2

I am refactoring a big PHP project (more than 500 PHP files) into namespace tree structure.

Is there a way to get Eclipse PDT automatically add use ... at the top of the file when an undefined class is encountered?

Otherwise: is there a way to get Eclipse PDT highlight undefined classes, so that i can do sort of right click -> add namespace, like in Microsoft Visual Studio?

Thank you

2 Answers 2

1

Eclipse will not add use statement on save, only while ctrl+space.

You can install Pex-Core plugin. It have class usage validator and quick assist (ctrl + 1) "inject use statement". Available at http://p2.pdt-extensions.org

1
  • This is exaclty what i'm looking for. Thanks a lot!
    – Marco
    Commented Sep 23, 2015 at 13:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.