【问题标题】:Intellij does not see usage of Lombok getter in implementation classIntellij 在实现类中没有看到 Lombok getter 的使用
【发布时间】:2021-10-25 16:50:07
【问题描述】:

无法使 Intellij IDEA(v 2021.2.3) 从具有 Lombok 的 @Getter 的实现类内部的字段导航到接口方法使用。 有如下代码结构:

public interface Service<ObjectType> {
    SomeQueueClient<ObjectType> getQueueClient();
    int getWorkerCount();
}

@Getter //Same result for @Getter(onMethod = @__(@Override))
public class ServiceImpl implements Service<ExactObjectType> {

    private final SomeQueueClient<ExactObjectType> queueClient;
    private final int workerCount;
}

ServiceImpl 类在没有@Override 注解的情况下编译如下:

public class ServiceImpl implements Service<ExactObjectType> {
    
        public SomeQueueClient<ExactObjectType> getQueueClient() {return this.queueClient;}
        public int getWorkerCount() {return this.workerCount;}
    }

代码很难维护,因为您无法从实现类导航到 getter 使用接口(当您单击该字段时)。龙目岛插件捆绑。启用注释处理。提前感谢您的任何想法!

【问题讨论】:

标签: java intellij-idea overriding lombok


【解决方案1】:

请关注此案例的问题: https://youtrack.jetbrains.com/issue/IDEA-281219

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-08-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多