Vscode-java: No Autocompletion results for method/constructor parameters

Created on 3 Jun 2018  路  2Comments  路  Source: redhat-developer/vscode-java

The autocomplete context menu doesn't offer any usefull entries in some situations.

Environment
  • Operating System: macOS 10.13.4 (17E202)
  • JDK version: 1.8.0_112
  • Visual Studio Code version: 1.23.1 (1.23.1)
  • Java extension version: 0.26.0
Steps To Reproduce
  1. instantiate new object, start autocomplete after class name:
    screen shot 2018-06-03 at 12 04 17

  2. fill in the first argument, then try to autocomplete again on the second argument:
    screen shot 2018-06-03 at 12 04 31

Current Result

Although autocomplete shows "MaterialIcon" als second argument type, suddenly it is all gone, and none-fitting entries (variables) are shown.

Expected Result

The first argument should be the MaterialIcon enum.

Additional Informations

This is a closed sourc project, so I can't share the code.

bug content-assist upstream

All 2 comments

Can reproduce in

public class Test {

    public static void main(String[] args) {
        ComponentHandler handler = getHandler();
        MaterialIcon icon = getIcon();
        new Test(getHandler(), |autocomplete| );
    }

    public Test(ComponentHandler c, MaterialIcon icon) {
    }

    public static ComponentHandler getHandler() {
        return new ComponentHandler();
    }

    public static MaterialIcon getIcon() {
        return new MaterialIcon();
    }

    public static class ComponentHandler {
    }

    public static class MaterialIcon {
    }
}

or even simpler:

 public static void main(String[] args) {
        String foo = "";
        bar(|autocomplete|);//doesn't propose foo here
 }
 public static void bar(String foo) {}
Was this page helpful?
0 / 5 - 0 ratings