Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 346896 - [content assist] code completion fails when after open parenthesis but works when before it
Summary: [content assist] code completion fails when after open parenthesis but works ...
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-23 13:18 EDT by John CLA
Modified: 2011-05-25 04:02 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John CLA 2011-05-23 13:18:05 EDT
Build Identifier: I20110522-2200

This somehow feels like a feature but really?
when you have a call like:
method(

if your cursor is before the "(" then completion works
if it's after, it doesn't
I mean, it shows proposals but pressing Enter on any of them will not "paste" them in the code.

Reproducible: Always

Steps to Reproduce:
you can get this code:
package org.weird;


public class Silly
{
	@SuppressWarnings( "unused" )
	public Silly(int a, long b, Object c, String d){
	}
	
	@SuppressWarnings( "unused" )
	public Silly(long x, Object y) {
	}
	
	
	public void another() {
//		Silly s=new Silly
		foo
	}
	
	@SuppressWarnings( "unused" )
	public void foo(int a, long b, Object c, String d){
	}
	@SuppressWarnings( "unused" )
	public void foo(long z, Object x){
	}
}

====
1. and move cursor after the "foo" in the method another()
2. append an open parenthesis aka "(" then press Ctrl+Space and choose any of the two proposals, none does completion. If you found that a closed parenthesis was added aka ")" you can delete it, and retry => same thing, nothing gets completed.

to see when this works then replace step 2 with:
2. press Ctrl+Space to engage code completion, there should be 2 proposals, choose any, it works.

I kinda remember this working in previous eclipses ie. helios, because I found it odd when it didn't work...
Comment 1 John CLA 2011-05-23 13:32:19 EDT
well hmm, even galileo does it this way, build id: 20100218-1602
then it must be it always was this way...

oh well, do with it as you will
me out;)
Comment 2 Dani Megert CLA 2011-05-25 04:02:06 EDT
This works as designed. Once the '(' is there the member is considered to be entered and you can then get parameter hints.