Bug 148521 - [5.0][content assist] Content assist show all members of a full annotation
Summary: [5.0][content assist] Content assist show all members of a full annotation
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.3 M2   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 126364 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-06-24 04:17 EDT by Antonel Ernest Pazargic CLA
Modified: 2006-09-18 10:58 EDT (History)
5 users (show)

See Also:


Attachments
Proposed fix (12.88 KB, patch)
2006-09-05 04:32 EDT, David Audel CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antonel Ernest Pazargic CLA 2006-06-24 04:17:58 EDT
Now if I use a full annotation and need to supply values for its members I need to know at least first character of each of them or I need to use CTRL+LEFT BUTTON MOUSE to navigate to its source or the window that state the source is not found (but fortunately all members are shown there to see their name).

It will be nice a nice feature to show all members of a full annotation when content assistent is invoked.
Comment 1 David Audel CLA 2006-06-27 04:38:38 EDT
Currently if you want to complete an annotation member name you need to type at least the first character. If the first character isn't typed you have this kind of code:

@Annotation(|  // do ctrl+space at | location

In this case this is not an annotation member completion but JDT/Core complete the annotation itself. This behavior is like the completion of a method invocation 'foo(|)' but currently this don't work correctly (see bug 126364).

If the annotation declaration would be shown with a little hover as for method invocation, i think the problem would be solved.

Move to JDT/Text for comment.
Comment 2 Dani Megert CLA 2006-06-27 05:11:09 EDT
Tom, please comment.
Comment 3 Tom Hofmann CLA 2006-06-28 04:36:12 EDT
Re. comment 1:

It is true that the completion works similar to the methods, however, I think the annotation case should be handled differently for these reasons:

- An unfinished method call may be ambiguous for overloaded methods, however, there is no such thing as an overloaded annotation since annotations take named arguments. For methods, we typically let the user choose which overloaded method for which he wants to fill in the argument list. This is not needed for annotations.

- Named annotation arguments have a finite range: the annotation member names. The same does not exist for method calls. For that reason, it is possible to provide zero-prefix proposals in this case. This is not possible for methods (without argument guessing).

So, I think core should behave differently for annotations than for method calls, and provide proposals for the annotation's members even if there is no prefix. This can be compared to switch-over-enum, where core provides zero-prefix proposals for case labels.

I would like to move this enhancement request back to jdt-core - David, do you disagree?

- Note: providing parameter hints inside annotations as you suggested would still be a good idea. I filed bug 148948 to track this on our side.
Comment 4 Tom Hofmann CLA 2006-06-28 04:41:52 EDT
*** Bug 126364 has been marked as a duplicate of this bug. ***
Comment 5 David Audel CLA 2006-06-30 10:00:24 EDT
Your arguments convince me and i don't see any reason to not do what you suggest, so i take the bug and i will implement the behavior.

Note : The asked behavior is the behavior that we had before the fix for bug 94111.
Comment 6 Wolfgang Knauf CLA 2006-09-01 03:34:14 EDT
Oh yes, please add this feature !

In EJB3 development 50% of the difficult stuff is done by annotations, and for a beginner like me it would be very helpful to see all possible values of an annotation. 

I would love to see this in the next maintenance release because I will have to do some EJB3 work the next time.
Comment 7 David Audel CLA 2006-09-05 04:32:12 EDT
Created attachment 49385 [details]
Proposed fix
Comment 8 David Audel CLA 2006-09-05 04:37:54 EDT
Released for 3.3 M2

Tests added CompletionTests_1_5#test0196() -> test0201b()

Now arguments names are proposed even if there is no prefix.
Comment 9 Frederic Fusier CLA 2006-09-18 10:58:12 EDT
Verified for 3.3 M2 using build I20060918-0010