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

Bug 139742

Summary: Content assist is broken in RC2
Product: [Eclipse Project] JDT Reporter: Dave Orme <djo>
Component: TextAssignee: JDT-Text-Inbox <jdt-text-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: blocker    
Priority: P3 CC: daniel_megert, david_audel
Version: 3.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Dave Orme CLA 2006-05-02 12:11:22 EDT
When developing using a target platform in RC2, content assist shows no completions even though the compiler is correctly showing parse errors.

For example, if I type:

Text text = new Text(parent, SWT.NU|)

where the pipe represents the cursor, and hit Ctrl-space, I get no completions offered.

If I pause and let the compiler run, I correctly get the squiggly underline for a parse error.  If I then finish typing SWT.NULL, the squggly underline goes away.  There are no build errors anywhere in my project.
Comment 1 Dave Orme CLA 2006-05-02 12:38:19 EDT
You know, this really probably should be marked a blocker since we really shouldn't ship with a major feature like this so totally broken.

More info: I've checked my preferences to make sure that content assist is turned on, and it is.  Also, I don't get any content assist when I hit period and pause or when I hit ( and pause either.

But Organize Imports works and the compiler is working.

I observed this behavior immediately upon launching RC2 the first time (this morning).
Comment 2 Dani Megert CLA 2006-05-02 14:13:41 EDT
Can neither reproduce with my dev workspace nor a fresh workspace using 3.2 RC2. I assume that 'Text' and 'SWT' are already imported, right?

Make sure you installed 3.2 RC2 into an empty directory and not over an existing install. In addition, check your access restriction settings on the build path and content assist.

If you still see this please provide more detailed steps to reproduce.
Comment 3 Dave Orme CLA 2006-05-02 15:54:50 EDT
(In reply to comment #2)
> Can neither reproduce with my dev workspace nor a fresh workspace using 3.2
> RC2.

Ugh; was afraid of this.

> I assume that 'Text' and 'SWT' are already imported, right?

Yes.

> Make sure you installed 3.2 RC2 into an empty directory and not over an
> existing install.

Check.

> In addition, check your access restriction settings on the
> build path and content assist.

Not sure what you mean here?  Please elaborate and I'll be glad to check.

> If you still see this please provide more detailed steps to reproduce.

Okay.  Please let me know what you mean by access restriction settings.

Hmmmm.... 

If you're talking about plugin access restrictions, we've seen a intermittant bug in 3.1 that persists in the 3.2 builds where when you start Eclipse, 2/3 of the projects (in a fairly large workspace; ~30 medium to large projects) show up with access restriction errors where there really are none.  The only way to clear this error is to choose "Window | Preferences | PDE | Target Platform", then toggle the "Target Platform" from our custom target platform to the IDE's platform, hit Apply, then toggle it back to our custom target platform and hit Apply or OK.  We haven't reported the bug because we can't figure out how to reproduce it reliably, but a full build of our workspace requires several minutes so this is highly annoying.

Maybe this is related though?  Maybe my description will trigger another idea for something we could try to make either or both bugs reproducable so you can fix them?

Thanks.
Comment 4 Dave Orme CLA 2006-05-02 16:03:31 EDT
Reopening because if this is happening to me, it will probably happen to other people.  And I really don't think we should ship if there's any possibility that significant numbers of folks could wind up with an Eclipse that doesn't do content-assist.  :-)

IMO, the current strategy should be to open a dialog between us to figure out how to make this reproducable for you so it can be fixed.  Because this is so serious, I'm willing to help as much as possible.
Comment 5 Dani Megert CLA 2006-05-02 16:30:29 EDT
Check the following:
1) code assist preferences: is "Hide forbidden references" checked? If so,
   does the bug go away if you uncheck this?

2) open the file's project's Java Build Path settings and switch to the 
   'Libraries' tab: are there any access restrictions? If so which ones?
Comment 6 Dani Megert CLA 2006-05-03 04:10:41 EDT
Also, the next time you see it, check in the Problems view whether there are problems on the project or the MANIFEST.MF.
Comment 7 Dave Orme CLA 2006-05-03 13:37:04 EDT
(In reply to comment #6)
> Also, the next time you see it, check in the Problems view whether there are
> problems on the project or the MANIFEST.MF.

None.

(In reply to comment #5)
> Check the following:
> 1) code assist preferences: is "Hide forbidden references" checked? If so,
>    does the bug go away if you uncheck this?

It doesn't go away.

> 2) open the file's project's Java Build Path settings and switch to the 
>    'Libraries' tab: are there any access restrictions? If so which ones?

I have Plugin Dependencies, JRE System Library, and JUnit.  The first two say "Access rules: no rules defined"  JUnit says, "Access rules: (no restrictions)"
Comment 8 Dani Megert CLA 2006-05-03 13:43:16 EDT
David, any idea?
Comment 9 Dani Megert CLA 2006-05-03 13:49:10 EDT
Would it be possible to attach the project that let's us reproduce the problem or provide steps that start with a fresh download and workspace?
Comment 10 David Audel CLA 2006-05-04 06:32:18 EDT
I cannot reproduce the problem using 3.2RC2.

- Do you reproduce the problem in a simple java project with a simple test case ?
public class Test {
   Obje| // do ctrl+space at cursor location
}
- Content assist doesn't work at all or there is some locations where it works ?

- A question which is the same as Daniel in comment 9 ;-) : Would it be possible to attach the project that let's us reproduce the problem
or provide steps that start with a fresh download and workspace?
Comment 11 Dave Orme CLA 2006-05-04 15:03:09 EDT
Okay; I created a minimal workspace that exhibits the bug (one project, one package, one compilation unit) and tried to attach a gzipped tarball of it but Bugzilla said that the attachment was too big.

I can't access my web server from here so can I email it to one of you?  (It's between 5 and 6 megs).
Comment 12 Dani Megert CLA 2006-05-04 15:33:11 EDT
Please send it to David and myself with a note that you send this under EPL.
Comment 13 Dani Megert CLA 2006-05-05 04:11:37 EDT
Dave, could you please send us the code?
Comment 14 Dave Orme CLA 2006-05-05 08:22:47 EDT
As soon as I get in this morning. :-)
Comment 15 Dave Orme CLA 2006-05-05 10:58:44 EDT
OK; I got it up on my web server.  That's better than email. :-)

http://www.coconut-palm-software.com/~djo/test.workspace.tgz

Thanks.
Comment 16 David Audel CLA 2006-05-05 11:25:04 EDT
I can reproduce with this workspace but some kind of completion are disabled in preferences.

In the preference page 'Preferences>Java>Editor>Content Assist>Advanced' the following options are enabled by default: 'Other Java Proposals', 'Template Proposals' and 'Type Proposals'. In you workspace only 'Template Proposals' is enabled.
If i enable the missing options then completion works.
Comment 17 David Audel CLA 2006-05-05 12:04:42 EDT
With a fresh workspace all the options are correctly enabled. All seems to works correctly.

Dave, could you confirm my diagnosis or there is something else ?
Comment 18 Dave Orme CLA 2006-05-05 16:24:09 EDT
(In reply to comment #17)
> With a fresh workspace all the options are correctly enabled. All seems to
> works correctly.
> 
> Dave, could you confirm my diagnosis or there is something else ?

Confirmed.

I'm wondering how those preferences got switched (I haven't messed with those prefs any time recently).  If it happens again, I'll reopen.
Comment 19 Tom Hofmann CLA 2006-05-05 17:09:06 EDT
Did you install and uninstall Mylar by chance? See bug 140416 then.
Comment 20 Dave Orme CLA 2006-05-05 19:54:54 EDT
(In reply to comment #19)
> Did you install and uninstall Mylar by chance? See bug 140416 then.

Yup; that's it.  I normally run using Mylar (including in this workspace) but haven't installed it yet in 3.2RC2.

So it's also an upgrade story problem, not just an uninstall story problem.
Comment 21 Dave Orme CLA 2006-05-10 10:12:07 EDT
Suggest this bug be resolved as a duplicate of bug 140416...?
Comment 22 Dani Megert CLA 2006-05-10 12:56:56 EDT
.
Comment 23 Dani Megert CLA 2006-05-10 12:57:08 EDT

*** This bug has been marked as a duplicate of 140416 ***