Bug 133491 - Missing code assist in annotation
Summary: Missing code assist in 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 normal (vote)
Target Milestone: 3.2 RC2   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 132207
  Show dependency tree
 
Reported: 2006-03-28 05:33 EST by Martin Aeschlimann CLA
Modified: 2006-04-28 13:15 EDT (History)
1 user (show)

See Also:


Attachments
Proposed fix (4.97 KB, patch)
2006-04-19 07:23 EDT, David Audel CLA
no flags Details | Diff
Better fix (6.97 KB, patch)
2006-04-24 11:14 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 Martin Aeschlimann CLA 2006-03-28 05:33:04 EST
20060328
from bug 132207:

-----
package pack;
public @interface MyAnnotation {
        NeedsImportEnum value();
        boolean value2() default false;
}
------
package pack;
public enum NeedsImportEnum {
        HELLO;
}

-----
package other;
public class A {
        @MyAnnotation(N |code assist
        public void hello() {
        }
}

Code assist should suggest NeedsImportEnum.

Quick fix uses the code assist infrastructure to evaluate the types required.
It works if MyAnnotation only has one attribute (value).
Comment 1 David Audel CLA 2006-04-19 07:23:36 EDT
Created attachment 38919 [details]
Proposed fix
Comment 2 David Audel CLA 2006-04-19 07:27:41 EDT
Philippe - Do you want this fix for 3.2RC2 ?

With this fix, the behavior with the test case of the bug is the same as if MyAnnotation would have only one member value pair named 'value'.
Comment 3 Philipe Mulet CLA 2006-04-19 09:19:55 EDT
+1 for 3.2RC2
Comment 4 David Audel CLA 2006-04-19 09:49:37 EDT
Fix released and test added
  CompletionTests_1_5#test0285()
Comment 5 David Audel CLA 2006-04-24 11:14:08 EDT
Created attachment 39285 [details]
Better fix

Performances with the previous fix are very bad.

This new fix correct the original problem and the performance problem.
Comment 6 David Audel CLA 2006-04-24 11:17:25 EDT
Better fix released.
Comment 7 Olivier Thomann CLA 2006-04-28 13:15:25 EDT
Verified with I20060427-1600 for 3.2RC2.
Get the right proposal, only if the import for MyAnnotation is there in the A class.