我使用 IntelliJ IDEA,它有一个非常棒的特性,叫做结构搜索。我想用它来查找所有类中最后有注释的所有字段,如下所示:
class Thing {
double x; // arbitrary comment (any text goes here)
}
到目前为止,我尝试过的任何方法似乎都不起作用。
我使用 IntelliJ IDEA,它有一个非常棒的特性,叫做结构搜索。我想用它来查找所有类中最后有注释的所有字段,如下所示:
class Thing {
double x; // arbitrary comment (any text goes here)
}
到目前为止,我尝试过的任何方法似乎都不起作用。
尝试以下结构搜索字符串:
@Modifier("Instance") $FieldType$ $Field$ = $Init$; // $Comment$
- 为除,之外的所有变量设置
Occurrences Count为(可选)。1, 1$Init$0, 1
如果您还想要静态字段:
$FieldType$ $Field$ = $Init$; // $Comment$
- 为除,之外的所有变量设置
Occurrences Count为(可选)。1, 1$Init$0, 1- Set
Field'sScript ConstrainttoField instanceof com.intellij.psi.PsiField(也可以定义Complete Match,没关系)。