|
| 1 | +.. _doc_configuring_an_ide_rider: |
| 2 | + |
| 3 | +Rider |
| 4 | +===== |
| 5 | + |
| 6 | +`Rider <https://www.jetbrains.com/rider/>`_ is a commercial |
| 7 | +`JetBrains <https://www.jetbrains.com/>`_ IDE for C# and C++ that uses the same solution system as Visual Studio. |
| 8 | + |
| 9 | +Importing the project |
| 10 | +--------------------- |
| 11 | + |
| 12 | +.. tip:: If you already use Visual Studio as your main IDE, you can use the same solution file in Rider. |
| 13 | + Rider and Visual Studio use the same solution format, so you can switch between the two IDEs without rebuilding the solution file. |
| 14 | + Debug configurations need to be changed when going from one IDE to another. |
| 15 | + |
| 16 | +Rider requires a solution file to work on a project. While Godot does not come |
| 17 | +with the solution file, it can be generated using SCons. |
| 18 | + |
| 19 | +- Navigate to the Godot root folder and open a Command Prompt or PowerShell window. |
| 20 | +- Copy, paste and run the next command to generate the solution. |
| 21 | + |
| 22 | +:: |
| 23 | + |
| 24 | + scons platform=windows vsproj=yes dev_build=yes |
| 25 | + |
| 26 | +The ``vsproj`` parameter signals that you want Visual Studio solution generated. |
| 27 | +The ``dev_build`` parameter makes sure the debug symbols are included, allowing to e.g. step through code using breakpoints. |
| 28 | + |
| 29 | +- If you have Rider setup as your main IDE for .sln, you can now open the project by double-clicking on the ``godot.sln`` in the project root |
| 30 | + or by using the **Open** option inside of Rider. |
| 31 | + |
| 32 | +.. note:: Rider could fail to build the first time you open the project. |
| 33 | + If that is the case, you can close Rider and open the solution in Visual Studio, build it, close Visual Studio, |
| 34 | + and open the solution in Rider again. You are now able to build the project from Rider. |
| 35 | + |
| 36 | +Compiling and debugging the project |
| 37 | +----------------------------------- |
| 38 | +Rider comes with a built-in debugger that can be used to debug the Godot project. You can launch the debugger |
| 39 | +by pressing the **Debug** icon at the top of the screen, this only works for the Project manager, |
| 40 | +if you want to debug the editor, you need to configure the debugger first. |
| 41 | + |
| 42 | +.. figure:: img/rider_run_debug.webp |
| 43 | + :align: center |
| 44 | + |
| 45 | +- Click on the **Godot > Edit Configurations** option at the top of the screen. |
| 46 | + |
| 47 | +.. figure:: img/rider_configurations.webp |
| 48 | + :align: center |
| 49 | + |
| 50 | +- Delete what is under **Program arguments** and paste the following line: |
| 51 | + |
| 52 | +:: |
| 53 | + |
| 54 | + --e --path <path to the Godot project> |
| 55 | + |
| 56 | +This will tell the executable to debug the specified project without using the project manager. |
| 57 | +Use the root path to the project folder, not ``project.godot`` file path. |
| 58 | + |
| 59 | +.. figure:: img/rider_configurations_changed.webp |
| 60 | + :align: center |
| 61 | + |
| 62 | +- Finally click on apply and ok to save the changes. |
| 63 | + |
| 64 | +- You can now launch the debugger by pressing the **Debug** icon at the top of the screen and it will open the project to debug. |
| 65 | + |
| 66 | +Alternatively you can use **Run > Attach to Process** to attach the debugger to a running Godot instance. |
| 67 | + |
| 68 | +.. figure:: img/rider_attach_to_process.webp |
| 69 | + :align: center |
0 commit comments