Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 331881

Summary: [content assist] Option to add ".class" qualifier when auto-completing Class<?> annotated attribute
Product: [Eclipse Project] JDT Reporter: Paul Benedict <pbenedict>
Component: CoreAssignee: JDT Core Triaged <jdt-core-triaged>
Status: NEW --- QA Contact: Ayushman Jain <amj87.iitr>
Severity: enhancement    
Priority: P5 CC: amj87.iitr, daniel_megert, remy.suen
Version: 3.7   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Paul Benedict CLA 2010-12-05 21:35:22 EST
Build Identifier: 

If an annotation's attribute is a Class<?> type, and I use auto-complete to select a class, the ".class" qualifier does not appear. So, it's extra clicks to add the dot and then the qualifier. This shouldn't be necessary. Granted, Eclipse can't divine how I am going to get the class object, but my pattern is pretty typical (especially with JPA!). How about a new option that adds ".class" if auto-completing a Class<?> annotation attribute? 

(PS: Can this enhancement apply to method parameters too?)

Reproducible: Always

Steps to Reproduce:
Select the class from auto-complete.
Comment 1 Dani Megert CLA 2010-12-06 04:36:01 EST
>If an annotation's attribute is a Class<?> type, and I use auto-complete to
>select a class, the ".class" 
You can type a '.' to make the proposal pop-up open again which suggests '.class', right?
Comment 2 Paul Benedict CLA 2010-12-06 09:45:33 EST
> You can type a '.' to make the proposal pop-up open again which suggests
> '.class', right?

Of course. Just to be clear, this ticket is to save the extra two clicks. It's really not necessary when I am choosing a class for a Class<?> type.
Comment 3 Dani Megert CLA 2010-12-06 09:58:15 EST
(In reply to comment #2)
> > You can type a '.' to make the proposal pop-up open again which suggests
> > '.class', right?
> 
> Of course. Just to be clear, this ticket is to save the extra two clicks. It's
> really not necessary when I am choosing a class for a Class<?> type.
OK, just wanted to make sure.

Automatically adding ".class" when the user selects the type is not something I want to add an option for. What I could imagine is that JDT Core detects this scenario and then proposes both, the type and the class object.