Przeglądaj źródła

Documentation: Add preferred coding style options to CLion configuration

Linus Groh 4 lat temu
rodzic
commit
358356758a

+ 11 - 1
Documentation/CLionConfiguration.md

@@ -16,7 +16,7 @@ After opening the `serenity` repository in CLion as a new project, the "`Open Pr
 
 
 > _If you have not built the Toolchain at this point, please do so: `./Toolchain/BuildIt.sh`_
 > _If you have not built the Toolchain at this point, please do so: `./Toolchain/BuildIt.sh`_
 
 
-If you already have the project open, you can go to "`File->Settings->Build, Execution, Deployment->Cmake`" to find these options.
+If you already have the project open, you can go to `File -> Settings -> Build, Execution, Deployment -> CMake` to find these options.
 
 
 Remember to recreate the CMake cache after changing any of the options.
 Remember to recreate the CMake cache after changing any of the options.
 
 
@@ -30,6 +30,16 @@ want exclude Toolchain files as well, follow the same procedure with the followi
 - `Toolchain/Tarballs`
 - `Toolchain/Tarballs`
 - `Toolchain/Build`
 - `Toolchain/Build`
 
 
+## Code Generation Settings
+
+To make code generated by CLion (e.g. identifier names, const placement) match the SerenityOS coding style, change the
+following options under `Settings -> Editor -> Code Style -> C/C++`:
+
+- On the `Code Generation` tab set `const/volatile qualifier placement` to `int const x = 0`
+- On the `Naming Convention` tab, select the following:
+
+  ![Screenshot of Naming Convention settings](./CLion_Naming_Convention.png)
+
 ## Notes for WSL Users
 ## Notes for WSL Users
 
 
 It is possible to set the embedded terminal in CLion to the one that your WSL distribution provides.
 It is possible to set the embedded terminal in CLion to the one that your WSL distribution provides.

BIN
Documentation/CLion_Naming_Convention.png