Community
Participate
Working Groups
When I try to get completion (ctrl+space) on "@link" on any type that has mutiple references in my classpath (bad wording but an example is "List" -- "java.util.List" and "org.eclipse.swt.widgets.List") I get no proposals. I *do* get proposals when not within a javadoc. In fact, I don't get proposals if I type "{@link java.util.Lis}" and hit complete after the "s" in "Lis". Perhaps related to this is the fact that I cannot immediately open a type ("Open Declaration") in the same cases. For example hitting F3 withiin "{@link java.util.List}" gives me the dialog of types rather than just brining me to the fully specified type. (NOTE that no "List" is included as an "import".) This "Open Declaration" case may be expected behavior. I'm not sure. I'm just mentioning it in relation to the bug.
Works for me using 3.2 RC2.
After stopping and starting Eclipse I don't have this problem any more either (nor can I reproduce it). I can understand the "worksforsome" but given that there was some conditions that caused proposals to stop working I don't know if I would sleep well at night ... =D I guess I will continue to hunt for the elusive "reproducable case".
I can reliably reproduce this in the following case: o Create a new class. o Within the body of the class create a javadoc comment. - Type "/**" then hit return. The full javadoc appears and the cursor is placed after the "*". o Type "{@link Map" and hit ctrl+space for completeion. *There are no proposals.* o Add "public int foo;" after the javadoc. o Go back up to the "{@link Map" and hit ctrl+space. There *are* proposals. This will occur in *all* cases where there is no "code" below the Javadoc. Yes, I'm one of the crazy bastards that writes comments *before* the code. I call it CFD (comment-first development). It goes hand in hand with TDD =D I'm not reopening the bug since I don't know if this is "expected behavior". If it is, I will open a feature request (or a regression since this used to work in 3.1).
Good catch
This is a regression from 3.1.x and should be considered for 3.2 since otherwise it's not possible to write Javadoc before writting the signature.
Good to know that I'm not crazy =D Let me know if I can be of any help testing and the whatnot.
Code assist in Javadoc was done by JDT/Text in 3.1 and moved to JDT/Core since 3.2. Until the field declaration is written, the javadoc is not attached to it and compiler does not parse javadoc comments in this case. So, it fails to propose anything while completing in this standalone comment. I agree this is a little bit annoying but does not sound critical for 3.2. Moreover, there's a simple workaround: just write field declaration before trying to complete in the javadoc... We clearly have to fix this but unfortunately as we'd surely need to change compiler javadoc read mechanism, I definitely prefer to defer this work on next version...
Well, given that I'm already annoyed with how type completion works in javadocs in relation to imports (specifically when you have "Unused import" configured to be a compiler error), I suppose it wont kill me to be a little more annoyed. Thanks!
Created attachment 54137 [details] Proposed patch
Released for 3.3 M4 in HEAD stream.
Created attachment 54249 [details] Additional patch Additional changes to address some issues discovered in previous patch...
Created attachment 54257 [details] Modified additional patch Use CompletionParser.FAKE_TYPE_NAME for fake type declaration name in case of completion in an orphan comment in a compilation unit without type.
Verified for 3.3M4 with I20061212-0010.