- Code Completion
- File/Project Class Inspection in File Explorer
- Code Folding
Using PDT with Symfony
Get Symfony Code Completion in PDT
There are two ways to do it.
Method 1: Add the Symfony project as a Library
- Open the PHP Navigator
- Right-click on your project
- Select "Configure Include Path"
- Select the "Libraries" tab
- Click "Add External Folder"
- Navigate to "\route\to\PEAR\symfony"
- Click "OK"
Note If the Libraries are not visible in step 4, a minor configuration issue may be caused by an SVN plugin. Follow the instructions at this link: HOWTO Use Eclipse with Subversion
Method 2: Create virtual folder that points to Symfony libraries
If you want to navigate and explore Symfony code during development (for example, navigate from sfWebRequest to sfRequest class via Ctrl-clicking class name), you may add "/route/to/PEAR/symfony" directory as a virtual folder instead of adding it as a library.
- Right-click lib folder of your project
- Select New->Folder
- Enter "symfony" as folder name
- Click "Advanced"
- Tick "Link to folder in the filesystem"
- Locate directory with symfony libs with "Browse..." button
- Click "Finish"
Highlight code syntax for YAML
Add SVN project using PDT
Following SVN guidelines for creating a new project location
Find files/folders on svn:ignore and copy them to another folder
- Files/folders that are usually on svn:ignore
- Open Eclipse SVN repo view
- Right click on desired project/trunk folder
- Select Checkout
- Change name from 'trunk' to project name
- Designate project location(e.g. \project\directory )
- Project will checkout to location\projectName, so do not specify the project name in workspace location or you'll end up with location\projectName\projectName
- Replace all files on svn:ignore
- Add eclipse project files/folders to svn:ignore
- .project .projectOptions /.cache /.settings
- Set permissions on cache and log folders to full for Users
oh, but you're not done yet.
now the subclipse project works in eclipse, but most PDT functions (code folding, snippets), don't! to fix:
- delete the project from eclipse. BE SURE that "delete project only" is checked (don't delete the project files).
- manually delete the .project file from the directory.
- add a new PHP Project in eclipse, pointing it at the same spot as before.
now you have both subversion icons/functionality, and PDT functionality.
Change PDT Font
Changing the PDT font is kind of counter-intuitive, as it is inherited from the default font. To change:
Window->Preferences->General->Appearance->Colors and Fonts->Basic->Text Font
Tip : Code completion & Propel
When you type $object = MyClassPeer::doSelectOne($criteria); $object-> you would like to view the list of MyClass methods, but nothing happens ?
This is normal, with default configuration, classes generated by Propel do not have doc-comments, so Eclipse cannot guess the return-type, and cannot offer code completion.
To enable doc-comments in Propel-generated classes, just edit config/propel.ini and find the following line (or add it to the end if you cannot find it) :
propel.builder.addComments = false
And change its value to "true".