PhpStorm 2017.1 Help

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. MyDir/MyFile.txt
  • Set of all files in a directory, not recursing into subdirectories, is defined by an asterisk after slash, for example: file:src/main/myDir/*
  • Set of all files in a directory including contents of subdirectories, is defined by an asterisk after double slash, for example file:src/main/myDir//*

Logical Operators

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

(<a>||<b>)&&<c>

implies either <a> and <c>, or <b> and <c>.

Defining Scopes

Scopes are defined in the Scopes dialog box in the following ways:

  • Manually
  • With the pointing device
Manually
Specify file masks in the Pattern text box, or click /help/img/idea/2017.1/editorIcon.gif and type the pattern in the editor.
Using the Mouse Pointer
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.

/help/img/idea/2017.1/wi_scope.png

Examples

  • 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 test in 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.
  • file:*.js||file:*.coffee - include all JavaScript and CoffeeScript files.
  • file:*js&&!file:*.min.* - include all JavaScript files except those that were generated through minification, which is indicated by the min extension.

See Also

Reference:

Last modified: 19 July 2017