在 Android Studio 中搜索整个项目中所有出现的字符串 [英] Search all the occurrences of a string in the entire project in Android Studio

查看:58
本文介绍了在 Android Studio 中搜索整个项目中所有出现的字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始使用 Android Studio (IntelliJ),现在我正在寻找该功能来查找项目中任何文件中出现的字符串.例如:我想找到所有包含字符串 ".getUuid()"

I've just started using Android Studio (IntelliJ), and I now look for the feature to find the occurrence of a string in any of the files in my project. For example: I want to find all the files that contain the string ".getUuid()"

右上角的搜索没有给我正确的结果,我认为我在编辑">查找"下找不到此功能.

The search at the top right doesn't give me the correct results, and I don't think I can find this feature under Edit > Find.

有人能指出我正确的方向吗?

Could anybody point me at the right direction?

推荐答案

TLDR: ⌃⇧F 在 MacOS 上将打开在路径中查找";对话框.

TLDR: ⌃⇧F on MacOS will open "Find in path" dialog.

首先,这个 IDEA 有一个很好的Find Usages";命令.可以在上下文菜单中找到,当光标在某个字段、方法等上时.

First of all, this IDEA has a nice "Find Usages" command. It can be found in the context menu, when the cursor is on some field, method, etc.

它是上下文感知的,据我所知,它是查找类、方法或字段用法的最佳方式.

It's context-aware, and as far as I know, is the best way to find class, method or field usage.

或者,您可以使用

编辑 >查找 >在路径中查找...

Edit > Find > Find in path…

对话框,可让您搜索整个工作区.

dialog, which allows you to search the whole workspace.

在 IDEA 13 中还有一个很棒的Search Everywhere"选项,默认情况下由双 Shift 调用.它允许您在项目、文件、类、设置等中进行搜索.

Also in IDEA 13 there is an awesome "Search Everywhere" option, by default called by double Shift. It allows you to search in project, files, classes, settings, and so on.

您也可以使用在路径中查找..."从项目结构"对话框中进行搜索.只需在具体目录上通过鼠标右键调用它,搜索范围将仅限于该目录及其子目录内.

Also you can search from Project Structure dialog with "Find in Path…". Just call it by right mouse button on concrete directory and the search will be scoped, only inside that directory and it's sub-directory.

享受吧!

这篇关于在 Android Studio 中搜索整个项目中所有出现的字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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