Community
Participate
Working Groups
Minimal scenario public class Test { public void m1(Set<String> a) { Set<String> b = // trigger content assist here } public void m2(Collection<String> a) { Collection<String> b = // trigger content assist here } } Trigger content assist at the specified locations. In the first location, the first proposal is for the argument "a", which is what I expect. In the second location the first proposal is for Collection<java.lang.String> which is not useful. "a" is the second proposal here. A couple of notes: 1. Commenting out one of the methods doesn't change the content assist proposal for the other, so it's not a confusion due to a second compile error. 2. Code Recommenders is disabled and thus not involved. 3. This came from Stackoverflow initially: https://stackoverflow.com/questions/44093019/eclipse-content-assist-with-custom-types#comment76670521_44093019 4. I can reproduce this in Oxygen and Neon.3
Created attachment 269147 [details] Screenshot I cannot reproduce it with the plain Eclipse 4.7 release build with default preferences in a new workspace. See attached screenshot. Please provide steps to reproduce it with the 4.7 build downloaded from: http://download.eclipse.org/eclipse/downloads/drops4/R-4.7-201706120950/
(In reply to Noopur Gupta from comment #1) > Created attachment 269147 [details] > Screenshot > > I cannot reproduce it with the plain Eclipse 4.7 release build with default > preferences in a new workspace. See attached screenshot. Please provide > steps to reproduce it with the 4.7 build downloaded from: > http://download.eclipse.org/eclipse/downloads/drops4/R-4.7-201706120950/ I can't reproduce this in a fresh workspace. Could the presence of other classes/projects affect this behaviour?
I did a clean install of Oxygen and I cannot reproduce it there for variables of custom types: class T {} void test(T a) { T b = // a is suggested. } As for Johannes' example, I get the same buggy behavior is both cases, in a clean project after a clean install. I did some tinkering, trying the different proposal kinds, and it turned out Java Proposals (Code Recommenders) (with Templates disabled) can be made to work: Under Code Recommenders > Completions, I disabled all the options. With none active I get the variable at the top, with the class much further down. If I enable Base-Relevance Processor, the class immediately takes priority, except if the class is defined in the same project, then I get still get the variable at the top. While testing, and before disabling all the completions, a few times I did get the variable suggested at the top. Writing a little more code made it revert to the class. Deleting the new code did not bring back the variable.
It would appear I was too hasty. Restarting Eclipse reset the Session Processors to all be active, and even when deactivated, the ordering of suggestions was messed up, with the variable not on top. The workaround did not work.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.