Back to Devexpress

Options Layers

coderushforroslyn-120314-configuration-options-options-layers.md

latest6.5 KB
Original Source

Options Layers

  • May 25, 2020
  • 4 minutes to read

CodeRush stores configuration settings in layers. Options Layers allow you to perform the following actions:

  • Share options with team developers working on the same solution.

CodeRush applies these options automatically to all team members when the solution is open.

  • Use different options for different solutions.

For example, the “bb” Template Name Variable shortcut can reference your custom “BigBus” class in one solution, and the “BelgianBeer” class in another.

The following table describes the predefined layers:

NamePriorityDescriptionLocationWhich Options to Store
Solution PersonalHighestYour preferences for the current solutionSolution directory ( .cr\personal ). You need to correct .gitignore or .hgignore file if you use git or mercurial as the source control to exclude the .cr\personal folder.Solution Team options you need to override
Solution TeamMiddlePreferences shared with a teamSolution directory ( .cr\team ). If you want to share files with your team, add these files to the .cr\team directory and commit them to the source control.Code Style, Code Analysis options, etc.
PersonalLowestThe default preferences for all your solutionsUser’s AppData directoryCoding Assistance, Visualization options, etc.

You can also add child options layers to any predefined layer. The custom layers are used to specify options that are not defined in the base layer. See the Custom Layers section for more information.

Smart Save

If you modify an option, CodeRush automatically updates the layer in which this option was previously set. If an option is not found in existing layers, CodeRush saves it to the user’s AppData directory.

For example, you set the default Right Margin value to 150. CodeRush saves this change to the Personal layer. Next, your team leader then sets this value to 160 in the team-shared solution, and CodeRush saves this value to the Solution Team layer. Modifications are visible after you pull changes from your VCS. Finally, you set the Right Margin value to 170. CodeRush now changes the option value only in the Solution Personal layer. This allows you to use the new options value without modifying the Solution Team layer.

Save Options to a Specific Layer

Use one of the following approaches to save options to a specific layer:

  1. The CodeRush Options window.
  • Choose CodeRush | Options… menu item in Visual Studio to access options.

  • Change options, click the Save To drop-down button, and choose the layer from the list.

  1. The Options Layers window.
  • Select the CodeRush | Options Layers… menu item to open the Options Layers window.

  • Double-click a layer or select it and click Edit ( ) to edit its configuration.

  • Modify options and click OK to save the changes and close this window.

CodeRush stores options whose values are different from the default ones. Refer to the Storing a Default Value in a Layer section for information on how to store a default value.

Layers Merging

The actual configuration settings are determined by merging all layers. Options defined in higher priority layers override the corresponding options in lower priority layers.

The table below shows an example of layer merging.

OptionDefaultPersonalSolution TeamSolution PersonalMerged
Enable Debug Visualizertrueundefinedundefinedundefinedtrue
Enable Smart Semicolonfalsetrueundefinedundefinedtrue
Right Margin Value12016080undefined80
Local declaration styleUse implicitundefinedUse explicitundefinedUse explicit
Apply variable declaration stylefalsetruetruefalsefalse

Note

To make an option undefined, set it to its default value.

Storing a Default Value in a Layer

When you edit a layer in the Options Layers window, you can store values different from the default layers.

To override an option value stored in the Solution Team layer with the default value, store the default value in the Solution Personal layer. For this, use one of the ways described in the Save Options to a Specific Layer section.

Custom Layers

You can add options custom layers to any predefined layer. For example, if you do not want to setup your personal navigation options for every solution. Options custom layers have a higher priority than the shipped layers.

Follow the steps below to add a new custom layer.

  • Open the Options Layers window.

  • Select the layer you want to override and click the “+” button.

  • Specify a folder to store new settings or use a folder with pre-existing settings, and click OK.

Reorder Custom Layers

Use arrow buttons to reorder custom layers.

The top custom layers have the highest priority.

Delete a Custom Layer

  • Select a custom layer and click the cross (x) button.

  • Click Yes to confirm the deletion.

See Also

How to: Define Persistent Local Settings