【问题标题】:How can I use Intellij Structural Search to find all methods that use two named classes?如何使用 Intellij 结构搜索来查找使用两个命名类的所有方法?
【发布时间】:2013-02-11 21:06:33
【问题描述】:

假设我有两个 Java 类,TradeType 和 InstrumentType。我知道在我的代码库的某个地方有一个从 TradeType 映射到 InstrumentType 的方法。

如何在 Intellij 中使用结构搜索来表示

“找到所有具有 TradeType 类型参数并返回 InstrumentType 的方法”

【问题讨论】:

    标签: intellij-idea structural-search


    【解决方案1】:

    搜索模板:

    class $Class$ { 
        InstrumentType $MethodName$(TradeType $Parameter$);
    }
    

    然后点击Edit variables...,为MethodName变量设置如下:

    • 出现次数:无限制
    • 此变量是搜索的目标

    还要注意搜索的范围是什么。

    【讨论】:

    • 这对我开始结构搜索很有帮助。这些文档并不是那么有用
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-07-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-10-24
    相关资源
    最近更新 更多