Skip to content

Extension methods from use of @ExtensionSource are not recognized in IJ #70

@rsmckinney

Description

@rsmckinney

Separated from #62:

Extension methods from use of @ExtensionSource are not recognized in IJ.

For example, this works as expected:

@Extension
public class PathExt {
    public static Stream<Path> list(@This Path path) throws IOException {
        return Files.list(path);
    }
}

Paths.get("").list().forEach(Path::isAbsolute);

However, when using @ExtensionSource, compilation still succeeds, but IntelliJ reports an error:

@ExtensionSource(source = Files.class)
@Extension
public class PathExt { }

// IntelliJ error: Cannot resolve method 'list' in 'Path'
// 'p' is also not resolved as a Path type, resulting in an additional error: Cannot resolve method 'isDirectory()'
Paths.get("").list().forEach(p -> System.out.println(p.isDirectory()));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions