IntelliJ Structural Search to find classes that implement A but not B

两盒软妹~` 提交于 2019-12-04 07:31:23

To find classes that implement InterfaceA, but don't implement InterfaceB, I did the following:

  1. Search > Search Structurally
  2. Click Copy existing template
  3. Select implementors of an interface (within hierarcy) and click OK
  4. Click Edit Variables
  5. Select Interface in the Variables list
  6. Enter InterfaceA in Text / regular expression and click OK
  7. Click Find
  8. Search > Search Structurally
  9. Click Edit Variables
  10. Select Interface in the Variables list
  11. Enter InterfaceB in Text / regular expression, 0 in Minimum Count and 0 in Maximum Count and click OK
  12. Select Previous Search Results in the Scope dropdown
  13. Click Find

Note I had problems when I tried to use the Edit Query button at step 8. I didn't research/retry, but going back to the menu and selecting Search > Search Structurally definitely worked.

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