This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 60168 - [50cat] Import not inserted when opening code completion right behind name
Summary: [50cat] Import not inserted when opening code completion right behind name
Status: VERIFIED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Completion & Templates (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: Dusan Balek
URL:
Keywords: REGRESSION
: 65082 66498 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-06-16 18:40 UTC by athompson
Modified: 2007-11-05 13:38 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description athompson 2005-06-16 18:40:01 UTC
jdk 1.5
linux
4.2 daily 1 june 2005

1. open a java file
2. type 'File' (cursor right after the 'e')
3! invoke code completion. the import for 'java.io.File' is no longer
automatically added.
Comment 1 Roman Strobl 2005-06-16 18:49:16 UTC
It works for me on build 200506142000. Please note that you need to type in a
part of file, e.g. "Fil", invoke code completion and then the import is added.
If you invoke code completion after typing in the whole File it won't add the
import and you need to use fix imports.

Feel free to reopen if it still won't work for you. In that case provide
additional details, such as sample code where it fails.
Comment 2 athompson 2005-06-16 23:33:18 UTC
yup, it it works as you described. but what's the logic behind only adding the
import if you don't type the whole name? what if you have to type the whole name
to avoid searching through a whole lot of potential matches? what if (unlikely
but feasable) your class is only one character long?
Comment 3 Roman Strobl 2005-06-17 07:19:49 UTC
Well, in my opinion it would be a bit magical to insert import after the whole
name is typed in. Some people might not like it. You can still use fix imports
in these corner cases. But I agree it's not very usable to have to decide which
method to use. Dusane, what's your opinion? 

I've changed summary, reopened it and setting to P3 for now. 
Comment 4 athompson 2005-06-21 17:05:58 UTC
i was just going to reopen myself, since that's how it worked before and IMHO
the long import is most of what you want to avoid typing when using CC.
Comment 5 athompson 2005-07-01 19:35:59 UTC
this is a VERY annoying regression.

<soapbox>
changes in the 'de facto editor contract' severely hampers productivity, since
developers (a.k.a. me) are focused on watching the editor to make sure the
editor did what they wanted it to instead of being focused on their code. i
don't want to have to think about what new thing the editor is/isn't doing this
week because i don't have any extra brain cells to spare.
</soapbox>
Comment 6 Roman Strobl 2005-09-25 09:04:09 UTC
*** Issue 65082 has been marked as a duplicate of this issue. ***
Comment 7 Miloslav Metelka 2005-09-26 13:20:37 UTC
We will fix this into 5.0. Please use a Alt+Shift+I (Fast Import) as a
workaround until the bug becomes fixed. Thanks.
Comment 8 Martin Roskanin 2005-10-12 12:32:14 UTC
*** Issue 66498 has been marked as a duplicate of this issue. ***
Comment 9 Dusan Balek 2005-10-21 13:26:02 UTC
Fixed in [maintrunk].

Checking in NbJMIResultItem.java;
/cvs/java/editor/src/org/netbeans/modules/editor/java/NbJMIResultItem.java,v 
<--  NbJMIResultItem.java
new revision: 1.26; previous revision: 1.25
done
Comment 10 athompson 2007-10-09 15:59:45 UTC
yup