在路径上下文中查找
Find In Path context
我在 Linux 上使用 IntelliJ IDEA 14.0.3。
在菜单中有编辑 - 查找 - 在路径中查找。在搜索对话框中有一个组合框上下文,其值在任何地方,在评论中,...
是否可以定义我自己的上下文以及如何定义?
您不能添加自己的上下文,但可以添加 scope:
To create and edit scopes, use the Scopes page of the Settings dialog. Scopes are defined in the following modes:
Manually, by specifying file masks according to the scope language syntax in the Pattern text box.
By selecting files and folders and clicking the buttons Include, Include Recursively, Exclude, and Exclude Recursively. Based on the inclusion/exclusion, IntelliJ IDEA creates an expression and displays it in the Pattern.
Refer to the section Configuring Scopes and File Colors.
所以基本上范围定义了哪些文件属于它(例如 src/test 中的所有文件)。
定义自己的范围后,您可以在 Find in Path
中使用它,方法是将 scope
更改为 custom
并选择您的范围。这将只搜索在您的范围内定义的文件。您还可以使用上下文来进一步缩小搜索范围。
这是您在评论中提供的示例的配置和结果:
我在 Linux 上使用 IntelliJ IDEA 14.0.3。
在菜单中有编辑 - 查找 - 在路径中查找。在搜索对话框中有一个组合框上下文,其值在任何地方,在评论中,...
是否可以定义我自己的上下文以及如何定义?
您不能添加自己的上下文,但可以添加 scope:
To create and edit scopes, use the Scopes page of the Settings dialog. Scopes are defined in the following modes:
Manually, by specifying file masks according to the scope language syntax in the Pattern text box. By selecting files and folders and clicking the buttons Include, Include Recursively, Exclude, and Exclude Recursively. Based on the inclusion/exclusion, IntelliJ IDEA creates an expression and displays it in the Pattern. Refer to the section Configuring Scopes and File Colors.
所以基本上范围定义了哪些文件属于它(例如 src/test 中的所有文件)。
定义自己的范围后,您可以在 Find in Path
中使用它,方法是将 scope
更改为 custom
并选择您的范围。这将只搜索在您的范围内定义的文件。您还可以使用上下文来进一步缩小搜索范围。
这是您在评论中提供的示例的配置和结果: