JetBrains Rider 2024.1 Help

Order of #includes

On this page, you can configure the #include ordering settings.

Sort include directives

Preserve existing #include groups during a sort

This option lets you configure whether the default sorting action should regroup all directives or sort each group separately.

Case-sensitive sort

Select this option to sort all #include directives of the same category as follows: place includes starting with uppercase letters before those starting with lowercase letters.

Group headers by directory

Select this option to create groups of headers based on their file path.

Put files before folders

By default, all #include directives are sorted in the path order. Disable this option if you prefer to have all includes in alphabetical order.

Sort order

Customize the sorting rules: order precompiled headers, the main header for the current file, add blank lines to separate your groups and find the place for all #include directives with names that match a regular expression pattern.

Main source file suffix

Regular expression for main source file suffix

Specify a regular expression pattern to determine the main header for the current file.

Consider only quoted includes as potential main headers

Select this option to improve main header detection.

Last modified: 17 April 2024