Eclipse JUNO PHP Formatter - php

I've downloaded the Eclipse PDT package as well as however, I can't find any options for formatting my PHP such as specifying line breaks, etc.
In this answer to another question, https://stackoverflow.com/a/3517764, there is a screenshot of what I understand is what I should be seeing. However, all I see is an extremely basic setting panel where I can set whether or not I want spaces or tabs to be used and how many to be used.
Any help on getting a good formatter would be great.
Ideally, it'd be a formatter for within Eclipse as opposed to another tool.
I'm currently using Eclipse Juno 4.2.2
Cheers

From what I see, PDT 3.1.x branch doesn't have a fully customizable code formatting rules. If you go and install/update to PDT 3.2 branch you'll get java-like code formatting options.
In Eclipse Juno go to:
Help > Install New Software
Click the "Add" button that appears near the top right
For Name you can put "PDT 3.2 Release" (or whatever you want really)
For Location you HAVE to put http://download.eclipse.org/tools/pdt/updates/3.2/release
Once you update/install PDT and restart eclipse if you go to
Window > Preferences > PHP > Code Style > Formatter
You'll see a highly customizable formatter to use.
Note, I got the link for the 3.2 release from: http://projects.eclipse.org/projects/tools.pdt

Related

Is there an Eclipse module to place semicolons in PDT?

The java editor options for eclipse include an option for automatically placing a semicolon at the end of a statement if you type it anywhere in the line.
Eclipse PDT does not seem to have a similar option for PHP. Is anyone aware of a module that adds this capability (or any other way to avoid having to manually move the cursor out of a nested set of parens to add the statement terminator?
Currently the PDT doesn't support such functionality.
For Java you can find it under Window -> Preferences -> Java -> Editor -> Typing and here Automatically insert at correct position: Semicolons.
However there's no such option under PHP -> Editor -> Typing.
As far as I'm aware at one point someone had an idea of implementing this feature, however PDT team in recent years is really struggling (you most likely work on Eclipse Helios PDT which is based on a Helios release of Eclipse from 2010, while current version of Eclipse is Juno from mid 2012, and Eclipse team is working on moving into the Kepler release) so I wouldn't count on this feature being implemented in any foreseeable future.
As far as I'm aware - there's also no additional plugin to support such functionality in PHP.

How to Remove Zend Studio Components from Existing Eclipse PDT?

I have Eclipse PDT Indigo installed. I downloaded it form zend's site. From the first day it was prompting me to try the original product Zend Studio. But eclipse PDT was actually serving purpose as it did for many years. But one day I installed it. Just clicked a tempting button.
Now I dont want to use it. Still 15 days remaining. But How do I remove it? From the software center I try to uninstall it. But how do I do it?
What have I tried?
I opened the Help menu. There was "install new software". Nothing like "uninstall". I though in the "install new software" dialog there might be a way to deselect them. But no. There is no way.
Under Indigo/3.7 the "Help > About Eclipse > Installation Details > Installed Software tab > Uninstall..." option works. For some.
Source: FAQ How do I remove a plug-in?
Please let me know if that solved your issue.
I went to zend-eclipse-php/plugins directory and removed all com.zend stuff from there (files and directories). Don't know what was gone but Eclipse stopped bugging about the license. And don't know what's that org.zend stuff - at least the name implies it's not commercial.
That's pretty much the standard way of getting rid of unnecessary Eclipse plugins.

Current method for using eclipse for java and php?

super easy question that i can't find the answer to on eclipse's website....
i have a new laptop and am installing eclipse on it. things seem to have a changed a bit since the 3.5 version i have on my current comp. i recall dloading eclipse just once, and then installing some plugins for stuff like php editing. but the new downloads page seems to have entirely different versions for the different languages:
http://www.eclipse.org/downloads/
so will i need to do one install for java, one for php, one for anything else? or is the method the same as before?
thanks,
jonah
You can install different development platforms onto your base Eclipse installation. Go to Help > Install new software and then try typing in PDT into the Work with text field. You should see it autocomplete with http://download.eclipse.org/tools/pdt/updates/. If selecting it doesn't automatically populate the area below, try the Add button.
You should eventually see options for the PDT SDK that you can select to install.
See also:
the official installation wiki
the package comparison page.

eclipse helios for PHP - code formatter not available

I'm looking at my Eclipse helios (3.6) preferences page, and I can see I can set code formatting settings for the Java code, but not for PHP.
How can I set the spacing for function arguments in Eclipse for PHP. It seems the changes I make for Java don't apply to the PHP code.
I know that when I got Eclipse, I downloaded the version that was specifically for PHP: http://www.eclipse.org/downloads/packages/eclipse-php-developers/heliossr1
It's likely that the version you downloaded is the base version and does not have the additional PHP features included.
EDIT:
Check out http://en.sourceforge.jp/projects/pdt-tools/releases/?package_id=8764 for an Eclipse dropin you can use(the site is in Japanese, but I was able to find the download link easily). This may be what you're looking for. To install, just place it in the dropins folder of your Eclipse install and restart Eclipse.
It took me a while to figure out that was my problem a couple years ago.
Eclipse maintains a section just for PHP Eclipse that includes everything you need for coding PHP in Eclipse.

Can I setup Eclipse to show code changes

I have used Netbeans before with Subversion (SVN), and I liked how it showed me what I had changed since last commit, using the coloring in the left margin.
Can Eclipse do the same? I have installed Subclipse.
Visit Window -> Preferences -> General -> Editors -> Text Editors -> Quick Diff, and enable
Enable quick diff
Show differences in overview ruler
SubVersive and Subclipse can both show changed files in the project explorer and differences between versions in the history. I currently use Subversive and am happy with it (although installing it was painful the first time.)
Had a similar problem. It turn out that the SVN Label decorations in eclipse weren't enable.
Preferences: General/Appearance/Label Decorators
This post helped me out:
SVN-connected project not showing version info in eclipse

Categories