8

When I type in the first part of a local variable name and press Ctrl+Space in order to show up the content assistant, then it displays the full name of the variable and preselects it.

In Eclipse Luna release the full name becomes inserted if you press . on keyboard and the content assistant shows up all accessible members of this variable instance.

With Eclipse Mars it inserts the dot directly after the incomplete variable name.

How can I switch this behavior back to Eclipse Luna?

public class A {
    public int member;

    public void possiblyAll(){

    }
}

public class Test {
    private A aMemberNameWhichIsLong_1;

    private A aMemberNameWhichIsLong_2;

    private A aMemberNameWhichIsLong_3;

    public static void main(String[] args) {
        Test t = new Test();
        t.amem
    }
}

In this example, the caret is located after t.amem. Ctrl+Space displays the full name. Pressing . closes content assistant and produces this code: t.amem.

In Luna it was: t.aMemberNameWhichIsLong_1.

Supun Wijerathne
  • 11,964
  • 10
  • 61
  • 87
PAX
  • 1,056
  • 15
  • 33
  • My current best guess would be that it might be a bug in Mars (I know they touched content assist). Have you already looked at their bugzilla? – Marvin Jun 29 '15 at 12:53
  • Are you using the *same* project in both and seeing this difference? – nitind Jun 29 '15 at 13:10
  • I haven't been checking bugzilla, yet. It's difficult to search for this behavior detail. I tested this behavior with the example code with Luna and Mars. – PAX Jun 29 '15 at 13:42
  • Seems like a 'feature' which was not really intentional. If you try it on a method Eclipse Luna produces invalid code, ex 't.someMethod();.' – Gimby Jun 29 '15 at 14:48
  • @Gimby This only occurs if the concerning method has a void return value. Otherwise, it works fine. – PAX Jun 30 '15 at 05:54

2 Answers2

9

This was a bug introduced by the Code Recommenders plug-in (see answer by @Johannes Dorn for the fix).

You can (temporarily) disable Code Recommenders via Window > Preferences > Code Recommenders > Completions > [x] Enable Code Recommenders code completion

Stephan Herrmann
  • 7,963
  • 2
  • 27
  • 38
6

We have fixed this bug as part of Code Recommenders 2.2.1

You can update it using our stable update site: http://download.eclipse.org/recommenders/updates/stable/

Johannes Dorn
  • 1,307
  • 1
  • 16
  • 34