Skip to content

Constructor code completion is broken in certain situationsΒ #2336

@fbricon

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions