Singularity/Library/PackageCache/com.unity.ide.rider@3.0.20/Documentation~/using-the-jetbrains-rider-e...
2024-05-06 11:45:45 -07:00

6.5 KiB
Raw Permalink Blame History

Using the JetBrains Rider Editor package

To use the package, go to Edit > Preferences > External Tools, click on the External Script Editor dropdown menu and select your version of Rider. When you select this option, the window reloads.

After the window reloads, new settings that control production of .csproj files become available.


External Tools tab in the Preferences window

Commandline endpoints

Q: Generate sln/csproj files for CI?

A: Unity -batchmode -quit -projectPath ProjectPath -executeMethod Packages.Rider.Editor.RiderScriptEditor.SyncSolution

Q: Generate sln/csproj and open External Editor?

A: Unity -batchmode -quit -projectPath ProjectPath -executeMethod Packages.Rider.Editor.RiderScriptEditor.SyncSolutionAndOpenExternalEditor

Package preferences

Property: Description:
Extensions handled This field lists the file extensions that open in JetBrains Rider. This field contains a variety of extensions by default.
Generate .csproj files for: Each setting in this list enables or disables production of .csproj files for a different type of package. The Regenerate project files button updates existing .csproj files and creates the necessary new ones based on the settings you choose. These settings control whether to generate .csproj files for any installed packages. For more information on how to install packages, see the Adding and removing packages documentation.
    Embedded     packages Any package that appears under your projects Packages folder is an embedded package. An embedded package is not necessarily built-in; you can create your own packages and embed them inside your project. This setting is enabled by default. For more information on embedded packages, see the Embedded dependencies documentation.
    Local     packages Any package that you install from a local repository stored on your machine, but from outside of your Unity project. This setting is enabled by default.
    Registry     packages Any package that you install from either the official Unity registry or a custom registry. Packages in the Unity registry are available to install directly from the Package Manager. For more information about the Unity package registry, see the Package Registry section of the Unity Package Manager documentation. For information on creating and using custom registries in addition to the Unity registry, see the Scoped package registries documentation.
    Git     packages Any package you install directly from a Git repository using a URL.
    Built-in     packages Any package that is already installed as part of the default Unity installation.
    Tarball     packages Any package you install from a GZip tarball archive on the local machine, outside of your Unity project.
    Unknown     packages Any package which Unity cannot determine an origin for. This could be because the package doesnt list its origin, or that Unity doesnt recognize the origin listed.
Player projects For each player project, generate an additional .csproj file named 'originalProjectName.Player.csproj'. This allows different project types to have their code included in Riders systems, such as assembly definitions or testing suites.

This package also adds a second tab under Preferences named Rider, pictured below.


Rider tab in the Preferences window

Note

The Logging Level menu does not control the level of Unity's logging, only the level of log messages that Rider package logs in its own log file. For more information on controlling Unity's logging level, see the Stack Trace Logging section of the Console Window documentation.

Property: Description:
Pass Console to Rider If Pass Console to Rider is enabled, Rider can access data that Unity sends to the Unity Console and display it within its own environment instead.
Log file The Log file field contains an Open log button. Select this button to open the log file inside the Rider IDE. This button is unavailable when Logging Level is set to OFF.
Logging Level The Logging Level menu controls how detailed are the Rider package logs. Those logs may be used for troubleshooting communication between Rider and Unity. Rider package logs all messages of the type you select as well as any messages of a more severe type. For example, if you choose WARN, then Rider logs all ERROR and FATAL messages as well as WARN messages. The message types are listed below in order of severity, with FATAL as the most severe type of message and TRACE as the least severe.
OFF Rider does not produce any logs.
**FATAL Logs information relating to serious problems that cause the application to crash. This setting produces the smallest logs.
ERROR Logs information about errors that prevent some functionality from working, but dont cause the application to fail (for example, a failed database connection).
WARN Logs information about possible problems, or any unusual behaviour. Warnings dont indicate that something has gone wrong, but that Unity detects something that might potentially cause an issue if not investigated.
INFO Logs information about normal operation of the application, such as a successful database connection attempt.
VERBOSE Logs detailed but not exhaustive information about your code. This setting is helpful for checking how your code executes or providing diagnostic information for other developers.
TRACE Logs as much information about the application as possible. This can create a very large and detailed log, so its good practice to only use it when attempting to find the cause of a specific issue with your code.