AppCode 2019.2 Help

Configure scopes

A scope is a filtered subset of files and directories in your project. When you enable a scope view, you limit operations like search and code inspection to the selected scope.

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.

Predefined scopes

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.

  • Project Source Files: this scope corresponds to the files that contain a project source code, including program and tests.

  • Project Non-Source Files: this scope corresponds to the other project files, e.g resources, licenses, and so on.

Predefined scopes cannot be edited.

Create a new scope

  1. In the Preferences dialog (⌘,), go to Appearance & Behavior | Scopes.

  2. Click Add scope (Insert) icon, select Local or Shared from the list, and specify the name of the scope.

    • Local scopes are intended for personal use only and are stored in your workspace. Default location: ~\Library\Preferences\.<product><version>\config\projects\<project_name>\.idea\workspace.xml

    • Shared scopes are defined for the current project and accessible for the team members via VCS. Default location: ~\Library\Preferences\.<product><version>\config\projects\<project_name>\.idea\scopes\

Configure a list of items in a scope

  1. In the Preferences dialog (⌘,), go to Appearance & Behavior | Scopes and select the scope that you want to configure.

  2. To define a pattern for the scope, perform one of the following actions:

    • To include files and directories in the scope, select files and directories and press Include or Include Recursively (with subdirectories) buttons. To exclude a file or a directory, use Exclude or Exclude Recursively. AppCode creates an expression and displays it in the Pattern field.

    • Specify a pattern in the Pattern field manually, using the scope language syntax .

  3. Click Apply.

Associate file color with a scope

Files that belong to different scopes can be highlighted in different colors throughout the AppCode user interface: in search result, in editor tabs, in the Project tool window. This allows much faster and easier navigation in large projects.

Scope highlighting in the editor tabs and search results

Associate file color with a scope

  1. Navigate to File | Settings | Appearance & Behavior | File Colors.

  2. Click Add icons general add svg.

  3. In the Add Color Label dialog, select a scope and pick a color for it.

  4. Click OK.

  5. Define the area where you want to use scope colors. To define the area, select Use in Editor Tabs or Use in Project View checkboxes.

  6. Select the accessibility level of the scope color association. To share the color association, click the Share icon (icons actions share).

    The default location for file color associations is ~\Library\Preferences\.<product><version>\config\projects\<project_name>\.idea\fileColors.xml

  7. Apply changes.

Arrange the order of scopes

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.

Arrange the order of scopes

  1. Navigate to Files | Settings | Appearance & Behavior | Scopes.

  2. Select a scope that you want to move.

  3. To change the order, click Move Up (icons actions previousOccurence svg) or Move Down icons icons actions nextOccurence svg.

  4. Click Apply.

Last modified: 29 August 2019

See Also