Skip to content

Suggestion issue for Variable Arity Parameters #4267

Description

@stanstan324234

Example code:

class Test {
    static Foo foo = new Foo();
    static Foo bar = new Foo();

    void test(Foo... foo) {
    }

    void test2() {
        test(|); // cursor at "|"
    }
}

When the cursor is in the "test()", and trigger suggestions using shortcut, "foo" and "bar" will appear in a dropdown list for selection, there is no problem. After choosing one,the code is:

test(foo,|) ; // cursor at "|"

Now when I try to trigger suggestion, "foo" and "bar" not appear.

Activity

  1. fbricon commented on Nov 24, 2025

    @fbricon
    Collaborator

    Indeed completion doesn't work immediately after the ,. Eclipse actually exhibits the same behavior, so this is an upstream issue.
    However, completion works if you add a space after the comma, like :

    test(foo, |) ; // cursor at "|"

  2. fbricon commented on Nov 24, 2025

    @fbricon
    Collaborator
  3. stanstan324234 commented on Nov 24, 2025

    @stanstan324234
    Author

    @fbricon

    However, completion works if you add a space after the comma

    Completion after a comma and space shows all suggestions(including incorrect suggestions). Only the first completion is correct. I'm using VScode.

  4. jarthana commented on Feb 2, 2026

    @jarthana

    Opened eclipse-jdt/eclipse.jdt.core#4649

    This is fixed and will be part of the next nightly build.

  5. added this to the End February 2026 milestone on Feb 2, 2026
  6. fbricon commented on Feb 3, 2026

    @fbricon
    Collaborator

    Fix now available in pre-releases. Thanks @jarthana!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions