The scopes language is used in specifying project scopes involved in various kinds of analysis.
In this section:
Sets of classes
- Single class is defined by a class name, i.e. com.intellij.OpenApi.MyClass.
- Set of all classes in a package, not recursing into subpackages, is defined by an asterisk after dot, for example: com.intellij.OpenApi.*.
- Set of all classes in a package including contents of subpackages, is defined by an asterisk after double dot, for example com.intellij.OpenApi..*
- 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 src:, lib:, file:,
For example, the following scopeimplies all classes under the source root in the com.intellij.OpenApi package, excluding subpackages.
- 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 MyModule in the package com.intellij.OpenApi, excluding subpackages.
The language allows you to use common logical operators:
AND (&&) OR (||) NOT (!)
Scopes are defined in the Scopes dialog box in the following modes:
Manually, by specifying file masks in the Pattern text box. The following elements and structures are used:
- The file: modifier. The element is mandatory.
- The * asterisk to denote any symbol in a file name or file extension.
- Logical operators AND (&&), OR (||), and NOT (!).
- By selecting files and folders and clicking the buttons Include, Include Recursively, Exclude, and Exclude Recursively. Based on the inclusion/exclusion, PyCharm creates an expression and displays it in the Pattern.