Summary: | [content assist] should have option to prevent direct import of inner classes | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | jules <jules> |
Component: | Core | Assignee: | JDT-Core-Inbox <jdt-core-inbox> |
Status: | ASSIGNED --- | QA Contact: | |
Severity: | enhancement | ||
Priority: | P5 | CC: | daniel_megert, joerg.heinicke, tom |
Version: | 4.4 | Keywords: | needinfo |
Target Milestone: | --- | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: |
Description
jules
2013-10-14 20:49:57 EDT
Jules, can you give a complete example? When I try "it" in 4.4 M2, no such import is added. I don't see an import either, but the inserted code doesn't compile either. Content assist for javax.swing.text.html.HTML.UnknownTag u = new produces javax.swing.text.html.HTML.UnknownTag u = new UnknownTag(id); The quick-fix for that only offers to add import javax.swing.text.html.HTML.UnknownTag. This issue is much easier to see with Ctrl-1 or Ctrl-2 quick assists when making new local variables. For example: color=HTML.Attribute.COLOR; CSS.getAttribute("color"); Creating two local variables from those with CSS and HTML already imported results in: Attribute color = HTML.Attribute.COLOR; javax.swing.text.html.CSS.Attribute attribute = CSS.getAttribute("color"); rather than the more desirable: HTML.Attribute color = HTML.Attribute.COLOR; CSS.Attribute attribute = CSS.getAttribute("color"); (In reply to Timo Kinnunen from comment #2) > I don't see an import either, but the inserted code doesn't compile either. Yes, that's bug 294002. > Content assist for javax.swing.text.html.HTML.UnknownTag u = new produces Yes, if you choose the constructor proposal. If you choose the type it adds the import. I see what you mean now: 1. paste this: import java.util.Map; class Snippet { Entry } 2. content assist after Entry ==> additional import is added, but one might want to replace Entry with Map.Entry instead. See also bug 99511. *** Bug 131705 has been marked as a duplicate of this bug. *** |