在Intellij中查找lombok生成的构造函数的用法 [英] Find usages of lombok generated constructor in Intellij

查看:617
本文介绍了在Intellij中查找lombok生成的构造函数的用法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有lombok批注的类(@Value@Data),我正在寻找一种简单的方法来查找自动生成的构造函数的用法.

I have a class with lombok annotation (either @Value or @Data) and I am looking for an easy way to find usages of the auto generated constructor.

我现在能做的是找到构造函数的一种用法,将光标放在此处,然后运行查找用法"命令,我会得到想要的结果.

What I can do now is to find a one use of the constructor, put the cursor there and run 'Find usages' command and I get the results I want.

但是,我想直接从类声明中执行此操作.有办法吗?

However I would like to do this directly from the class declaration. Is there a way to do that?

推荐答案

我终于找到了可接受的解决方案:

I have finally found an acceptable solution to this:

  1. 文件中的任何位置调用文件结构"操作(在Linux上为Ctrl + F12)
  2. 选择所需的元素(构造函数,并且当存在@Builder时,它也适用于Lombok生成的builder()方法).
  3. 调用查找用法"操作(在Linux上为Alt + F7)
  1. Anywhere in the file invoke "File structure" action (Ctrl + F12 on linux)
  2. Select the desired element (constructor, but also works for Lombok generated builder() method when @Builder is present).
  3. Invoke "Find usages" action (Alt + F7 on linux)

这篇关于在Intellij中查找lombok生成的构造函数的用法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆