Skip to content

Base class methods are missing when generating override methods with source action. #3657

Closed
@Kidsunbo

Description

@Kidsunbo

[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
  1. [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(){
        
    }
}

  1. [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.
image

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.
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions