Bug 225310 - ContentAssist should not show annotations that are not valid for the current location
Summary: ContentAssist should not show annotations that are not valid for the current ...
Status: VERIFIED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.4 M7   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-02 07:46 EDT by Philipp Kursawe CLA
Modified: 2008-04-28 07:17 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Kursawe CLA 2008-04-02 07:46:04 EDT
Build ID: I20080330-1350

Steps To Reproduce:
1. Type '@' and press CTRL+Space to activate the content assist above a Method
2. It will show all annotations, even those whose target is set to "ElementType.TYPE"

More information:
The content assist should check if the annotation is actually possible at the current location and not provide it otherwise.
Comment 1 David Audel CLA 2008-04-03 07:40:54 EDT
All annotations are proposed but annotations whose target is set to ElementType.METHOD are proposed first.

----------------------------
@Target(ElementType.TYPE)
public @interface MyAnnot1 {
}
----------------------------
Target(ElementType.METHOD)
public @interface MyAnnot2 {
}
----------------------------
public class Test {
  @MyAnnot| // do ctrl+space at | location
  public void foo() {}
}
----------------------------

With this test case MyAnnot1 and MyAnnot2 are proposed but MyAnnot2 is at the top of the list of proposals.
MyAnnot1 must not be filtered because perhaps the user want to type:

public class Test {
  @MyAnnot1 class X {}
  public void foo() {}
}

I close this bug as INVALID because it works as designed.
Comment 2 Philipp Kursawe CLA 2008-04-03 07:53:16 EDT
You are right David, I did not thought of this use-case. Well done!
Comment 3 Jerome Lanneluc CLA 2008-04-28 07:17:38 EDT
Was verified for 3.4M7 by reporter (comment 2)