How can I use Intellij Structural Search to find all methods that use two named classes?

旧时模样 提交于 2019-12-08 17:00:36

问题


Say I have two Java classes, TradeType and InstrumentType. I know that somewhere in my codebase there is a method that maps from TradeType to InstrumentType.

How can I use Structural Search in Intellij to say

"find me all methods that have a single parameter of type TradeType and which return InstrumentType"


回答1:


Search template:

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

Then click Edit variables..., and set the following for the MethodName variable:

  • Occurrences count: Unlimited
  • This variable is target of the search

Also pay attention to what the scope of the search is.



来源:https://stackoverflow.com/questions/15088703/how-can-i-use-intellij-structural-search-to-find-all-methods-that-use-two-named

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!