Eclipse PDT: No Code Completion on Other Projects

Today, I was troubleshooting a problem with my newly installed Eclipse PDT 2.0. My previous version (1 year older) works fine for me, especially the code completion.

It really helps me when everytime I type a php function or a certain class, the function parameters and its brief description appears as tooltip. This is one of the wonderful features of Eclipse PDT that is why I’m switching from Dreamweaver.

However, when I replaced my PDT to 2.0, code completion doesn’t work. I checked the old version, it works (since I didn’t deleted my old version). I also tried opening another workspace using the new version. Fortunately, it works.

eclipse-code-completion

Now, the problem is, what’s wrong with my current workspace? If code completion works in other workspace, it should work with mine.

Checking on the net, I landed on stackoverflow.com website. They suggested to check the .project file and compare.

So, I checked my current .project file for the current huge project. Here it is.

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
	<name>daito</name>
	<comment></comment>
	<projects>
	</projects>
	<buildSpec>
		<buildCommand>
			<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
			<arguments>
			</arguments>
		</buildCommand>
		<buildCommand>
			<name>org.eclipse.wst.validation.validationbuilder</name>
			<arguments>
			</arguments>
		</buildCommand>
		<buildCommand>
			<name>org.eclipse.dltk.core.scriptbuilder</name>
			<arguments>
			</arguments>
		</buildCommand>
		<buildCommand>
			<name>org.eclipse.php.core.PhpIncrementalProjectBuilder</name>
			<arguments>
			</arguments>
		</buildCommand>
		<buildCommand>
			<name>org.eclipse.php.core.ValidationManagerWrapper</name>
			<arguments>
			</arguments>
		</buildCommand>
	</buildSpec>
	<natures>
		<nature>org.eclipse.php.core.PHPNature</nature>
		<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
	</natures>
</projectDescription>

And here is the settings for the test project I’ve created, and which the code completion was working:

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
	<name>daito</name>
	<comment></comment>
	<projects>
	</projects>
	<buildSpec>
		<buildCommand>
			<name>org.eclipse.wst.validation.validationbuilder</name>
			<arguments>
			</arguments>
		</buildCommand>
		<buildCommand>
			<name>org.eclipse.dltk.core.scriptbuilder</name>
			<arguments>
			</arguments>
		</buildCommand>
		<buildCommand>
			<name>org.eclipse.php.core.PhpIncrementalProjectBuilder</name>
			<arguments>
			</arguments>
		</buildCommand>
		<buildCommand>
			<name>org.eclipse.php.core.ValidationManagerWrapper</name>
			<arguments>
			</arguments>
		</buildCommand>
	</buildSpec>
	<natures>
		<nature>org.eclipse.php.core.PHPNature</nature>
	</natures>
</projectDescription>

So, you’ve noticed that the current project settings has more content than the test project. Without hesitation, I replaced the lower portion with the code above (copying from the test project, of course backup first).

Now it was working. I really don’t understand a thing on the xml file. Sigh…..

This entry was posted in Personal Blog. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *