Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Xcode Code Completion/Sense is Awful!




On Sep 30, 2004, at 11:00 AM, Michael Fey wrote:

I have been attempting to use Xcode 1.5's new Java code sense to move my development environment from NetBeans into Xcode. Well let me tell you, it has not been a basket of roses.

After enabling Code Sense in Xcode I open up a new Java Swing project (for example) and go to the main class of that project. I want to import javax.swing.JFrame;

After typing in javax.swing. (both of which get correct completion suggestions) I get a set of numbers, some comments from the header of my file, and bunch of fairly useless stuff. Now if I type 'JF' I do get a suggestion for 'JFrame', but shouldn't the Code Sense only show what is in the javax.swing package? NetBeans does. Does anyone know how I can repair this issue?

I'm afraid it isn't quite that easy with java. You need to work at it a little bit. I've gotten it to work for me. I've yet to run into the bugs mentioned in other responses, but I have neglected my coding a bit of late... Anyway, quoting myself in a response from an earlier date...


But there are two issues that people may run into that keep Java code completion from working properly for the JDK classes:

1) If you were using index templates, they need to be rebuilt. See /Developer/Extras/Xcode\ Index\ Templates/Index\ Templates\ ReadMe.rtf for instructions.

You might want to look inside that JavaIndex template too. Mine didn't work because the classes.jar and ui.jar files were pointing to the 1.4.1 installation that no longer existed. The following link is very helpful when doing the indexing manually...


http://homepage.mac.com/kelleherk/iblog/C1216817469/E517633567/

2) If you're using WebObjects, the JDK classes aren't indexed by the index templates by default. The easiest way to do that is to add /Library/Java/Home/src.jar to the projects, and the rebuild the templates.

Isn't src.jar just source code? I could be mistaken though... Anyway, I just copied the setup in JavaIndex and added the classes.jar and ui.jar to my two WO templates. Just open them, add files, then let Xcode finish indexing and move the .pbindex to the right place.


And while we are on the topic of WebObjects, I believe it is also notable that the default system index template rules are backwards for the WO indexes. The JavaDTWJavaClient index should be first in the list since its framework specification is more specific than the general WO index. As it is, the JavaDTW index never gets used because the rules for the general index get called first. You can fix this by duplicating the second entry in the default rules to your own IndexTemplateRules.plist and putting that file in your Index Templates folder. If you aren't working with Java Client apps though, well... no worries ;-) Info on the rules system can be found in

/Developer/Extras/Xcode Index Templates/Index Templates ReadMe.rtf

Finally, the hint doesn't mention that for the Javadoc help indexing to work, you need to make sure you have the latest Java Developer package installed (available from connect.apple.com).

Definitely good advice here. The Xcode 1.5 ReadMe says it all. Install 1.5 first, then the 1.4.2 update developer tools found at the adc website. WebObjects users should also read the very bottom of the 1.5 release notes for instructions on fixing your WO help index if necessary.

-- Learn how to cryptographically sign your mail in Panther http://www.joar.com/certificates/

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden

References: 
 >Xcode Code Completion/Sense is Awful! (From: Michael Fey <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.