Scope Language Syntax Reference
The scopes language is used in specifying project scopes involved in various kinds of analysis.
In this section:
Sets of files
- Single file is defined by a file name, i.e.
- Set of all files in a directory, not recursing into subdirectories, is defined by an asterisk after
slash, for example:
- Set of all files in a directory including contents of subdirectories, is defined by an asterisk after
double slash, for example
- Location modifiers
help you specify whether the desired set is located in the source files, library classes or test
code in the form of location modifiers
For example, the following scopeimplies all classes under the source root in the
com.intellij.openapipackage, excluding subpackages.
The default location is the module root.
- Module modifiers
help you narrow down the scope by specifying the name of the related module in one of the following ways:
src[module name]:<E> lib[module name]:<E> test[module name]:<E>
For example, the following scope
implies all classes under the source folders related to the module
MyModulein the package
com.intellij.openapi, excluding subpackages.
The scope language allows you to use common logical operators:
&& for AND || for OR ! for NOT
Besides that, the parentheses can be used to join the logical operators into groups. For example, the following scope
implies either <a> and <c>, or <b> and <c>.
Scopes are defined in the Scopes dialog box in the following ways:
- With the pointing device
- Specify file masks in the Pattern text box, or click and type the pattern in the editor.
- Using mouse
Select files and folders in the project tree view and click the buttons Include, Include Recursively, Exclude,
and Exclude Recursively. For information about the controls, refer to Scope page description.
Based on the inclusion/exclusion of file and directories, PhpStorm creates an expression and displays it in the Pattern field.
file:*.php||file:*.twig- include all PHP and Twig files.
file^*php&&!file:*test*.php- include all PHP files except those that contain the character string
testin their names.
file:www/wp-content/themes/my-site-child//*.php||file:www/wp-content/themes/my-site-child//*.css||file:www/wp-content/themes/my-site-child//*.js||file:www/wp-content/plugins/my-site//*.php||file:www/wp-content/plugins/my-site//*.css||file:www/wp-content/plugins/my-site//*.js- include all .PHP, .CSS, and .JS files from the theme and plugin of the WordPress website.