JetBrains Rider 2018.2 Help

Using Scopes

A scope(scope icon) is a subset of files, and/or directories in your solution, to which you can limit the application of specific operations, e.g. search.

Scopes get more helpful as your solution grows larger. There is a number of predefined scopes that cover basic cases. Additionally, it is possible to add custom scopes to your solution. 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 solution 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

JetBrains Rider 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, JetBrains Rider creates an expression and displays it in the Pattern.

    Refer to the section Configuring Scopes and File Colors.

Predefined scopes

JetBrains Rider provides a number of predefined scopes, for example:

  • Project Files. This scope includes all the files within the solution content roots generally, are not included in this scope.

  • Problems. This scope includes the files within the solution content roots in which syntactic errors are found.

  • Project and Libraries. This scope includes all the files within the solution content roots, and also all module dependencies, libraries and SDKs.

    In the Explorer window, this scope corresponds to the scope view All.

  • Project Production Files. This scope is similar to the Project Files scope. The difference is that the test source roots are not included. In the Explorer window, this scope corresponds to the scope view Production.

  • Project Test Files. This scope is limited to the solution test source roots. In the Explorer window, this scope corresponds to the scope view Tests.

  • Non-Project Files. This scope is available only as a view in the Explorer window. It is limited to libraries and SDKs.

  • Changed Files. This scope corresponds to all changed files, that is, ones associated with all existing changelists.

  • Default. This scope corresponds to the files associated with the Default changelist.

  • Favorite '<name>'. This scope corresponds to a list of favorite items with the specified name.

    SeeManaging Your Project Favorites.

  • Open files.This scope corresponds to the files opened in JetBrains Rider editor.

  • Current file. This scope corresponds to the file currently active in JetBrains Rider editor.

  • Selected files. This scope corresponds to the files currently selected in JetBrains Rider (e.g. in the Explorer window).

Predefined scopes cannot be edited.

Last modified: 21 December 2018

See Also