Configuring code style
If certain coding guidelines exist in a company, one has to follow these guidelines when creating source code. DataSpell helps you maintain the required code style.
The IDE comes with two pre-defined schemes: the Project scheme and the Default scheme.
In the Project scheme, the settings that you configure apply only to your current project.
These settings are stored in the codeStyles folder under .idea and are shared through VCS together with the project.
The IDE creates the folder after you modify code style settings for your project.
In the Default scheme (IDE-level scheme), the settings that you configure apply to all existing projects that have the Default code style scheme selected.
These settings are stored in the codestyles folder under the DataSpell configuration directory and are not shared through VCS.
If you want to use the project code style scheme as your default scheme, you can copy it to the IDE level. The other way around is also possible: you can overwrite your current project settings with the settings from an IDE-level scheme and share them with other members of your team.
note
There can be only one Project code style scheme. On the IDE level, you can have multiple schemes. Several projects can refer to the same IDE-level code style scheme.
In DataSpell, code style settings are language-specific, so you need to configure them for every language that you use in your project separately. You can also copy the settings from one language and apply them to another language.
Press CtrlAlt0S to open settings and then select Editor | Code Style.
To configure a scheme for new projects, go to File | New Projects Setup | Settings for New Projects | Editor | Code Style.
Select the language for which you want to configure the code style.
Select the code style Scheme that you want to configure: the Project scheme or one of the IDE-level schemes.
tip
Click
next to the Default scheme and select Duplicate to create a copy of the scheme.
Browse through the tabs and configure code style preferences.
Use the right section of the dialog to preview the changes. When you change a setting, one or several blinking areas appear in the preview area emphasizing the changes.
For most of the supported languages, you can copy code style settings from other languages or frameworks.
Press CtrlAlt0S to open settings and then select Editor | Code Style.
To configure a scheme for new projects, go to File | New Projects Setup | Settings for New Projects | Editor | Code Style in the main menu.
Select the language for which you want to configure the code style.
Select the code style Scheme that you want to modify: the Project scheme or one of the IDE-level schemes.
Click Set from in the upper-right corner.
The link is shown only if it is possible to apply code style settings from another language.
From the list that appears, select the language to copy the code style from.
note
Only applicable settings are copied from another language, other settings are left intact.
Thanks for your feedback!