Skip to content

[ BUG ] NestedClasses are not AutoImported #2154

@deekshithanand

Description

@deekshithanand

Nested Clasess are not Imported

When nested classes are referenced within the classfile, a quick fix suggestionto import the nested class is show( to resolve the Nested class symbol). However, the quick fix simply doesnt import the shown fix.

Environment
  • Operating System: Manjaro Linux
  • JDK version: OpenJDK 11
  • Visual Studio Code version:1.61.0
  • Java extension version: 0.82.0
Steps To Reproduce
  1. Create class file like below.
package com.dstyle.demo.resource;

import java.util.Iterator;

public class Example implements Iterable<Nested>{
    public class Nested{}

    @Override
    public Iterator<com.dstyle.demo.resource.Nested> iterator() {
        // TODO Auto-generated method stub
        return null;
    }
}
  1. Now try to resolved the Nested class.

[Please attach a sample project reproducing the error]
Please attach logs
Log File:
ls.log

Current Result

A suggestion to Import nested class is shown, however quick fix doesnt import the nested class

Expected Result

The Nested class should be able to imported

Additional Informations

Gif demonstrating the issue:

simplescreenrecorder-2021-10-10_19 34 19

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