PyCharm Edu 4.0 Help

Scope

Basics

A scope(/help/img/idea/2017.2/scope_icon.png) is a subset of files, and/or directories in your project, to which you can limit the application of specific operations, e.g. search, code inspection, etc. Besides, you can configure coloring for each scope to see at once what sort of file you are dealing with.

Scopes get more helpful as your project grows larger. There is a number of predefined scopes that cover basic cases. Additionally, it is possible to add custom scopes to your project. For example, you can create custom scopes for tests or for the files you are responsible for in your team.

Types of scopes

Scopes can be either shared or local:

  • Shared scopes are accessible for the team members via VCS and are stored at the project level. in the scopes directory under .idea, as a file with the extension xml, i.e. .idea/scopes/<scope_name>.xml.
  • Local scopes are intended for personal use only and are stored in your workspace in the file workspace.xml under .idea.

If necessary, you can share a local scope, make a shared scope local, or create a copy of the scope. For more information, see Configuring Scopes and File Colors.

Defining scopes

PyCharm Edu provides a special language that enables you to flexibly define the sets of entities included in a scope. See Scope Language Syntax Reference for details.

To create and edit scopes, use the Scopes page of the Settings/Preferences 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, PyCharm Edu creates an expression and displays it in the Pattern.

    Refer to the section Configuring Scopes and File Colors.

To view the available scopes, click the /help/img/idea/2017.2/arrow_down_hide_settings.png (next to the Project header of the Project Tool Window.

Scopes coloring

Files belonging to different scopes can be highlighted in different colors throughout the PyCharm Edu's user interface: in navigation lists, in the editor tabs, in the Project window. This allows much faster and easier navigation in large projects.

/help/img/idea/2017.2/py_scope_highlighting.png

If some file is included into several scopes, the order of the scopes becomes important: PyCharm Edu uses the color of the uppermost scope (shown in the Scopes settings page) to highlight such file. Of course, you can change the order of the scopes, and thus the resulted highlighting.

For detailed instructions on how to configure the scope order and scope-color associations, see Configuring Scopes and File Colors.

Predefined scopes

PyCharm Edu provides a number of predefined scopes, for example:

/help/img/idea/2017.2/py_predefined_scopes.png

Predefined scopes cannot be edited.

Last modified: 26 October 2017

See Also