A scope() 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
.idea, as a file with the extension
- Local scopes are intended for personal use only and are stored in your workspace in the file
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.
Files belonging to different scopes can be highlighted in different colors throughout the AppCode's user interface: in navigation lists, in the editor tabs. This allows much faster and easier navigation in large projects.
If some file is included into several scopes, the order of the scopes becomes important: AppCode 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.
AppCode provides a number of predefined scopes, for example:
- Project Files. This scope includes all the files within the project content roots, Libraries and frameworks, generally, are not included in this scope.
- Problems. This scope includes the files within the project content roots in which syntactic errors are found.
- Open files.This scope corresponds to the files opened in AppCode editor.
- Current file. This scope corresponds to the file currently active in AppCode editor.
- Selected files. This scope corresponds to the files currently selected in AppCode (e.g. in the Project Tool Window).
Predefined scopes cannot be edited.