You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[provide a description of the issue]
When instantiating an anonymous class, I would like to use source action to override some methods in the base class. But the methods in base class don't show up in the quick pick list.
Environment
Operating System: Ubuntu (24.04)
JDK version: 21
Visual Studio Code version: 1.89.1
Java extension version: 1.30.0
But this issue seems not related to the OS.
Steps To Reproduce
[step 1]
Creating a Java project with the following code:
public class App {
public static void main(String[] args) throws Exception {
System.out.println("Hello, World!");
Base s = new Base(){
};
}
}
class Base{
public void hello(){
}
public void hey(){
}
}
[step 2]
At the position of new Base(), right click and select Source Action and select Override/Implement Methods. There is no hello and hey in the options.
Current Result
No hey and hello
Expected Result
The two methods exist.
Additional Informations
I have already tried Eclipse and it work well for such operation.
The text was updated successfully, but these errors were encountered:
As a workaround, if you start typing he in the body of new Base(){ };, you should get completion to override those methods
Thanks and I've taken this workaround. Not a big deal, but I think it's worth repairing. BTW, i find that it seems to be an upstream issue as the extension only wrap the result returned by the language server.
As a workaround, if you start typing he in the body of new Base(){ };, you should get completion to override those methods
Sorry for the misleading, I found that it seems not to be a bug. If I right-click at the base class name, the language server searches the overridable methods of the outer class. When right-clicking between the braces of the base class, it works well.
[provide a description of the issue]
When instantiating an anonymous class, I would like to use
source action
to override some methods in the base class. But the methods in base class don't show up in the quick pick list.Environment
But this issue seems not related to the OS.
Steps To Reproduce
Creating a Java project with the following code:
At the position of
new Base()
, right click and selectSource Action
and selectOverride/Implement Methods
. There is nohello
andhey
in the options.Current Result
No
hey
andhello
Expected Result
The two methods exist.
Additional Informations
I have already tried Eclipse and it work well for such operation.
The text was updated successfully, but these errors were encountered: