Using eclipse, when I enter the following:
public enum Foo {
A(Integer.);
private final Integer integer;
private Foo(Integer integer) {
this.integer = integer;
}
}
And position my cursor after Integer.
and ask for content assist (^space) I get nothing. In fact content assist does not seem to work at all inside enum constant argument lists.
Is this a known problem or expected behaviour? If the latter, why?
EDIT: I'm wondering if this is a bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=395604
If so I'm amazed that such an obvious thing hasn't been fixed in the past 5 years with the number of Java developers using Eclipse.
Using Content Assist Within an editor, content assist helps reduce the characters typed by providing a context sensitive list of possible completions to the characters already typed. The context assist can be invoked by clicking Ctrl + Space.
Step 1: Open your Eclipse or Spring Tool Suite, then go to the Window > Preferences as shown in the below image. Step 2: In the next screen go to the Java > Editor > Content Assist > Auto activation triggers for Java as shown in the below image.
Yes, you're right, it is a known bug or at least a missing feature of the Eclipse Java IDE:
Eclipse Bug 395604 - Code assist does not work after anonymous class inside in an array initializer
In the last 5 years, there have been only a few votes for this bug and also only very few comments, so it doesn't seem to be particularly important for most users. I voted for the bug and added a comment with a link to your question. Eclipse is open source and the bug is tagged with helpwanted
. So any Java developer is welcome to make Eclipse a little bit better by implementing this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With