Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Completion & Quick-fix not suggesting a visible inner class #1796

Open
rgrunber opened this issue Nov 12, 2024 · 0 comments
Open

Completion & Quick-fix not suggesting a visible inner class #1796

rgrunber opened this issue Nov 12, 2024 · 0 comments

Comments

@rgrunber
Copy link
Contributor

rgrunber commented Nov 12, 2024

From redhat-developer/vscode-java#3815 (reproduced in Eclipse)

Version: 2024-12 (4.34)
Build id: I20241111-1800

OuterClass.java

package test;
public interface OuterClass {
  public class InnerClass {
  }
}

Mapper.java

package test;

public class Mapper {

  public void te() {
	  new InnerClass
  }
  
  class WrapperOne {

    public void test() {
      new InnerClass();
    }
  }
}
  • For new InnerClass| , there is no quick-fix to import import test.OuterClass.InnerClass so that InnerClass could be referenced directly as new InnerClass();. Another option would have been to qualify new InnerClass() as new OuterClass.InnterClass() but I'm not sure if there's a quick-fix for this.
  • The completion engine doesn't suggest new InnerClass() even though unresolved types can get suggested and are automatically imported (eg. new ArrayList|) when unresolved.

I seem to recall that the unresolved import quick-fixes do use completion engine API (on constructors) to produce suggestions so maybe the bug is in completion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant