Scope language syntax reference
You can use the scopes language to specify project scopes: sets of files, directories, and subdirectories.
Sets of files
To add a single file, use a filename (for example,
To add all the files in a directory without subdirectories, use an asterisk after a slash (for example:
To add all the files in a directory with subdirectories, use an asterisk after a double slash (for example,
When you define scopes, you can use logical operators:
Also, you can use parentheses to join logical operators into groups. For example, the following scope includes either <a> and <c>, or <b> and <c>:
Create a new scope from existing scopes
You can make a new scope from several existing scopes. In this case, you can reference the existing scopes by using
For example, the
$Scope1||$Scope2 pattern places in a scope all files from
Scopes are defined in the Scopes dialog in the following ways:
In the Pattern field, specify file masks. Alternativlely, click the Expand button and type the pattern in the editor.
- Using the Mouse Pointer
In the tree view, select files and directories. To include or exclude files and directories, use the following buttons: Include, Include Recursively, Exclude, and Exclude Recursively. For more information about the buttons, see Define a new scope.
When you click the buttons, PyCharm creates an expression and displays it in the Pattern field.
!file:*/.npm//*- exclude all .npm folders.
file[Scientific_Sample]:*.py- include all Python files from the project
Scientific_Sample. Specifying the project name in the brackets is particularly helpful when you have several projects attached to the current one.