rider.rst 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. .. _doc_configuring_an_ide_rider:
  2. JetBrains Rider
  3. ===============
  4. `JetBrains Rider <https://www.jetbrains.com/rider/>`_ is a commercial
  5. `JetBrains <https://www.jetbrains.com/>`_ IDE for C++, C# and GDScript that uses the same solution system as Visual Studio.
  6. .. note::
  7. This documentation is for contributing to the game engine, not for using
  8. JetBrains Rider as a C# or GDScript editor. To code C# or GDScript in an external editor, see
  9. :ref:`the C# guide to configure an external editor <doc_c_sharp_setup_external_editor>`.
  10. Importing the project
  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. If you are starting from the scratch, please follow :ref:`instructions<doc_compiling_index>`, specifically:
  16. - Install all the dependencies.
  17. - Figure out the scons command for compiling to target a specific platform.
  18. Provide scons with additional arguments to request a solution file generation:
  19. - Add `vsproj=yes dev_build=yes` to the scons command
  20. The ``vsproj`` parameter signals that you want Visual Studio solution generated.
  21. The ``dev_build`` parameter ensures the debug symbols are included, allowing to e.g. step through code using breakpoints.
  22. - Open the generated ``godot.sln`` in Rider.
  23. .. note:: Ensure that the appropriate Solution configuration is selected on the
  24. Rider toolbar. It affects resolve of the SDKs, code analysis, build, run,
  25. etc.
  26. Compiling and debugging the project
  27. -----------------------------------
  28. Rider comes with a built-in debugger that can be used to debug the Godot project. You can launch the debugger
  29. by pressing the **Debug** icon at the top of the screen, this only works for the Project Manager,
  30. if you want to debug the editor, you need to configure the debugger first.
  31. .. figure:: img/rider_run_debug.webp
  32. :align: center
  33. - Click on the **Godot > Edit Configurations** option at the top of the screen.
  34. .. figure:: img/rider_configurations.webp
  35. :align: center
  36. - Ensure the following values for the C++ Project Run Configuration:
  37. - Exe Path : ``$(LocalDebuggerCommand)``
  38. - Program Arguments: ``-e --path <path to the Godot project>``
  39. - Working Directory: ``$(LocalDebuggerWorkingDirectory)``
  40. - Before Launch has a value of "Build Project"
  41. This will tell the executable to debug the specified project without opening the Project Manager.
  42. Use the root path to the project folder, not ``project.godot`` file path.
  43. .. figure:: img/rider_configurations_changed.webp
  44. :align: center
  45. - Finally click on "Apply" and "OK" to save the changes.
  46. - When you press the **Debug** icon at the top of the screen, JetBrains Rider will launch the Godot editor with the debugger attached.
  47. Alternatively you can use **Run > Attach to Process** to attach the debugger to a running Godot instance.
  48. .. figure:: img/rider_attach_to_process.webp
  49. :align: center
  50. - You can find the Godot instance by searching for ``godot.editor`` and then clicking ``Attach with LLDB``
  51. .. figure:: img/rider_attach_to_process_dialog.webp
  52. :align: center
  53. |
  54. Debug visualizers
  55. -----------------
  56. Debug visualizers customize how complex data structures are displayed during debugging.
  57. For Windows "natvis" (short for "Native Visualization") built-in with Godot are automatically used.
  58. For other operating systems, similar functionality can be setup manually.
  59. Please follow `RIDER-123535 <https://youtrack.jetbrains.com/issue/RIDER-123535/nix-Debug-Godot-Cpp-from-Rider-pretty-printers-usability>`_.
  60. Unit testing
  61. ------------
  62. Leverage Rider :ref:`doctest<doc_unit_testing>` support.
  63. Please refer to `the instructions <https://github.com/JetBrains/godot-support/wiki/Godot-doctest-Unit-Tests>`_.
  64. Profiling
  65. ---------
  66. Please refer to `the profiling instructions <https://github.com/JetBrains/godot-support/wiki/Profiling-Godot-engine-(native-code)-with-dotTrace-or-JetBrains-Rider>`_.
  67. Please consult the `JetBrains Rider documentation <https://www.jetbrains.com/rider/documentation/>`_ for any specific information about the JetBrains IDE.
  68. Known issues
  69. ------------
  70. Debugging Windows MinGV build - symbols are not loaded. Reported `RIDER-106816 <https://youtrack.jetbrains.com/issue/RIDER-106816/Upgrade-LLDB-to-actual-version>`_.