Community
Participate
Working Groups
I'm typing code. I type List list = new ArrayList(); list. When I get there, because List is not imported, List has a red-squiggly under it, and I do not get a list of valid methods after the period. However, because the code is syntacticly incomplete, Organize Import won't run. But there's a red-squiggly. List is clearly known to be a class that needs to be imported. Organize Import should be able to (a) import everything up to the first syntax error and/or (b) specifically import those classes that are shown as "unknown".
Martin, this one is comparable to the one we discussed on Friday.
There is a good reason why organize import does not want to run in this case: It might be able to detect 'List' in your example, but it will also remove other imports for type references temporarly invisible due to your syntax error. This would be very bad as it could require you to choose these types from a list again (if ambiguous). So I don't think we should change that. Use 'Add import' on the type reference. This PR is simpliar to bug 44627. Code assist could be cleverer here and still offer you methods from a 'List' *** This bug has been marked as a duplicate of 44627 ***
*** Bug 37757 has been marked as a duplicate of this bug. ***
Reopen to set correct duplicate bug
*** This bug has been marked as a duplicate of 44984 ***
Verified for 3.3 M3 using build I20061030-0010.