Skip to content

Constructor code completion is broken in certain situations #2336

Description

@fbricon

Given the following code:

import java.util.*;

public class Hello {

    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        list = new ArrayList<>();
    }
}

When you autocomplete on the first ArrayList, (triggering autoimport of java.util.ArrayList is a usual use case), the result breaks the existing code, regardless of the java.completion.overwrite preference.

If you repeat the completion step on the LinkedList constructor, the completion doesn't provide you with a list of constructors for some reason, only the type, and applying the completion item doesn't break the code:

Mar-02-2022 15-19-27

Activity

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