• Stars
    star
    1,209
  • Rank 38,754 (Top 0.8 %)
  • Language
    C#
  • License
    Apache License 2.0
  • Created about 9 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Unity support for both ReSharper and Rider

official JetBrains project Build status Build Status Join the chat at https://gitter.im/JetBrains/resharper-unity

Unity Support for ReSharper and Rider

The "Unity Support" plugin adds specific functionality for the Unity game engine to ReSharper and Rider.

Rider is JetBrains' cross platform .NET IDE, based on ReSharper and the IntelliJ Platform. It can be used on Windows, Mac and Linux and this plugin can replace the default MonoDevelop editor with an IDE providing rich code navigation, inspections and refactorings.

The plugin adds code completion and generation of Unity event functions, inspections for common errors, quick fixes, support for .shader files, automatic handling of .meta files and more. The Rider plugin includes additional support for attaching the debugger to the Editor instance and a Unity Editor plugin to improve integration.

Installation 2019.2+ with Rider package

In Unity choose Rider as External Editor in Unity settings.

For uninstall choose a different External Editor in Unity settings.

Installation 2019.1-

This plugin comes bundled with Rider, and manual installation is not required. However, it is necessary to configure Unity to use Rider as the external script editor:

  • Check if .sln file is present:
    • Start Rider and open the .sln file. Rider will install a Unity Editor plugin into the project (see below for more details)
    • Otherwise, start Rider and open project folder in Rider. Rider will show Notification, which allows to install Unity Editor plugin.
  • Switch back to the Unity Editor, with the same Unity project open. The new Unity Editor plugin will automatically configure Rider as the external script editor.

This only needs to be done once, and can also be done manually, via the Unity Editor's External Editor Preference pane.

Double clicking on C# scripts and .shader files will now automatically open Rider, load the solution and navigate to the file. More file types can be associated with Rider by editing Additional extensions in the Edit โ†’ Project Settings โ†’ Editor settings pane.

The solution can be loaded directly with the Assets โ†’ Open C# Project menu item.

Note that Rider will add an Assets โ†’ Open C# Project in Rider menu item for older versions of Unity. This is because prior to 2017.1, the Unity Editor doesn't recognise Rider as an editor that can load C# solutions, and will also launch MonoDevelop. Other than not launching MonoDevelop, these menu items are identical.

Rider will install the Unity Editor plugin in each Unity project it opens. See below for more details.

For uninstall choose a different external Editor in Unity settings, delete Editor plugin from your project.

ReSharper plugin installation

The ReSharper plugin is installed via the ReSharper โ†’ Extension Manager. Simply search for "Unity Support".

Features

Unity API knowledge:

  • The plugin knows about all Unity based classes (MonoBehaviour, ScriptableObject, EditorWindow, etc.) and their event functions via analysis of the Unity API surface and documentation.
  • Support for Unity API starting from 5.0.

Event functions:

  • Event functions and fields implicitly used by Unity are marked with an icon in the gutter.

  • Empty event functions are marked as dead code, with a Quick Fix to remove the method.

  • When Solution Wide Analysis is enabled, implicitly used fields and event functions are marked as in use. Fields are highlighted if they aren't accessed in your code.

  • A new "Generate Unity event function" menu item is added to the Alt+Insert Generate Code menu, to generate event functions via GUI. This action is also available from Alt+Enter on a Unity based class's name.

  • Auto complete will suggest event function names when declaring methods in Unity based classes, and expand to include method signature. Simply start typing an event function within a class deriving from a known Unity class, such as MonoBehaviour.

  • Incorrect method signatures and return types are shown as warnings, with a Quick Fix to create the correct signature.

  • Optional parameters are called out in a tooltip, and marked as unused if not used in the body of the method, e.g. OnCollisionEnter(Collision collision).

  • Suppress naming consistency warnings for known Unity event functions. E.g. ReSharper no longer suggests that AnimatorIK be renamed to AnimatorIk.

  • Descriptions for event functions and parameters in Unity based classes are shown in tooltips and QuickDoc. To show the information in tooltips, ReSharper's "Colour identifiers" and "Replace Visual Studio tooltips" setting must be enabled (search for them in settings). Alternatively, use the excellent Enhanced Tooltip plugin.

  • "Read more" in QuickDoc will navigate to the Unity API documentation, locally if available, or via the Unity website.

Coroutines and invokable methods:

  • Event functions that can be coroutines are called out in tooltips.

  • Context Action on methods that can be coroutines to convert method signature to/from coroutine.

  • Warnings for unused coroutine return values.

  • Code completion, find usages and rename support for string literals in MonoBehaviour.Invoke, IsInvoking, InvokeRepeating and CancelInvoke. Also supports StartCoroutine and StopCoroutine and understands overloads here.

Networking:

  • Code completion, find usages and rename support for string literals in [SyncVar(hook = "OnValueChanged")].
  • Highlight usage of SyncVarAttribute in any class other than NetworkBehaviour as an error.

Inspections and Quick Fixes:

  • Empty event functions are shown as dead code, with a quick fix to remove the method.

  • Using the SyncVarAttribute inside any class other than NetworkBehaviour is treated as an error.

  • Inspection and Quick Fix to use CompareTag instead of string comparison.

  • "Create serialized field" from usage of unresolved symbol.

  • Inspections and Quick Fixes for incorrect event function signatures and return types.

  • Inspections and Quick Fixes for incorrect method or static constructor signatures for InitializeOnLoad attributes.

  • Inspections for incorrectly calling new on a MonoBehaviour or ScriptableObject. Quick Fixes will convert to calls to GameObject.AddComponent<T>() and ScriptableObject.CreateInstance<T>().

  • Inspection for unused coroutine return value.

ShaderLab support:

Initial support for ShaderLab syntax in .shader files, with limited support for Cg/HLSL blocks.

ShaderLab:

  • Syntax and syntax error highlighting for ShaderLab syntax.

  • Colours highlighting and editing.

    Also available in Rider:

  • Rider includes simple word based completion (so called "hippie completion"). This provides completion based on words found in the current file. This is not available in ReSharper.

  • Brace matching and highlighting, comment/uncomment, and to-do explorer support.

  • Code folding in Rider.

Cg/HLSL (Rider only):

  • Syntax highlighting for CGPROGRAM/CGINCLUDE blocks and .cginc files. Currently no syntax error highlighting.

  • Simple word based completion (so called "hippie completion").

External Annotations:

See the ReSharper help for more details on External Annotations.

  • Treat code marked with attributes from UnityEngine.dll, UnityEngine.Networking.dll and UnityEditor.dll as implicitly used.
  • Mark Component.gameObject and Object.name as not-nullable.
  • Debug.Assert marked as assertion method to help null-value analysis (e.g. "value cannot be null" after Debug.Assert(x != null))
  • Debug.AssertFormat, LogFormat, etc. gets string formatting helper functionality.
  • Assertions.Assert methods marked as assertion methods to help null-value analysis.
  • EditorTestsWithLogParser.ExpectLogLineRegex gets regular expression helper functionality.
  • Various attributes now require the class they are applied to derive from a specific base type. E.g. [CustomEditor] requires a base class of Editor).
  • Support for Unity 2017.2's modularised UnityEngine assemblies.

Project and File Templates:

  • Project template Unity Class Library *

    Essentially it is a Class Library with reference to UnityEngine.dll

  • File templates for new C# script, tests and shader files.

    Also available in Rider:

  • Support for editing and creating File Templates and Live Templates for Unity projects in ReSharper. Note that Rider currently doesn't support editing File and Live Templates. This is planned for Rider 2017.3)

Other:

  • Synchronise .meta files on creation, deletion, rename and refactoring.

  • Automatically sets correct C# language version, if not already specified in .csproj - ReSharper will no longer suggest code fixes that won't compile! Supports the default C# 4 compiler, Unity 5.5's optional C# 6 compiler and the C# 6/7.0 compiler in the CSharp60Support plugin.

  • Disables the Assets and Assets\Scripts folders from being considered as "namespace providers". This means ReSharper will no longer suggest to include Assets or Scripts in the namespace of your code.

  • Support for UnityEngine.Color and UnityEngine.Color32. The colour is highlighted, and hitting Alt+Enter will open the colour palette editor to modify the colour. Also supports named colours and Color.HSVToRGB.

Rider specific functionality

The plugin also adds some functionality just for Rider:

  • The Library and Temp folders are automatically excluded from Rider's full text search, used for the "Find in Path" feature. These folders can become very large, and can take a long time to index if not excluded.

  • Rider will automatically create an "Attach to Unity Editor" run configuration. When the debug button is clicked, Rider will automatically attach to the editor and start debugging. Rider will look for a Library/EditorInstance.json file, created by Unity 2017.1, or by EditorPlugin. If the file doesn't exist and only a single instance of Unity is running, Rider will attach to this instance. If multiple instances are running, Rider will prompt for which instance to attach to.

  • Rider will install a Unity Editor plugin whenever a Unity project is opened. See below for more details.

Please suggest new features in the issues!

Unity Editor plugin

For Unity 2019.2+ with Rider package Editor plugin is loaded directly from Rider installation.

By default, when Rider opens a Unity project, it will automatically install a Unity Editor plugin, and keep it up to date with new versions. This behaviour can be disabled in Rider's Preferences โ†’ Languages & Frameworks โ†’ Unity Engine.

This plugin does the following:

  • Automatically set Rider as the default external script editor.
  • Ensure the C# solution and project files are up to date, and make minor changes required by Rider:
    • Attempts to set appropriate TargetFrameworkVersion. This is customizable in Preferences. Note that this affects how Rider resolves references, and does not change how Unity builds a project.
    • Set the LangVersion correctly, so that Rider does not suggest C# 6 features when Unity is targeting C# 4, or C# 7 features when Unity is targeting C# 6.
    • Add references to UnityEditor.iOS.Extensions.Xcode.dll and UnityEditor.iOS.Extensions.Common.dll, which are referenced when Unity builds, but not included in the generated project files.
    • Add options defined in mcs.rsp or smcs.rsp and gmcs.rsp files, such as conditional compilation defines, the unsafe keyword and [references(#270)]. Adding them to the project file makes the information available to Rider's analysis.
  • Use interprocess communication to speed up opening C# scripts, .shader files and text assets in Rider, if it's already running. It will launch Rider and load the solution if it isn't.
  • Add a Rider Preference pane:
    • Enable logging to the console for troubleshooting. Please use this before logging an issue.
    • Customize TargetFrameworkVersion for generated project files. Note that this only affects how Rider resolves references, and does not change how Unity builds a project.
  • Provide extra functionality for older versions of the Unity Editor (prior to Unity 2017.1):
    • Create a file called Library/EditorInstance.json that contains process information for debugging the Unity Editor. This file is created natively by Unity since 2017.1.
    • Add an Assets โ†’ Open C# Project in Rider menu item. Earlier versions of Unity do not recognise Rider as an editor that can correctly open solutions, and so will launch both Rider and MonoDevelop when the Assets โ†’ Open C# Project menu item is selected.

Rider will automatically add this plugin to all Unity projects that are opened. It will initially install the plugin to Assets/Plugins/Editor/JetBrains/JetBrains.Rider.Unity.Editor.Plugin.Repacked.dll, but will look for the file by name if it is moved.

Supported Unity versions: 5.0+

Roadmap

Check the milestones for plans, and please raise an issue with feature requests or bugs.

More Repositories

1

kotlin

The Kotlin Programming Language.
Kotlin
48,745
star
2

intellij-community

IntelliJ IDEA Community Edition & IntelliJ Platform
Java
17,135
star
3

compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
Kotlin
16,179
star
4

JetBrainsMono

JetBrains Mono โ€“ the free and open-source typeface for developers
Shell
10,765
star
5

Exposed

Kotlin SQL Framework
Kotlin
8,296
star
6

ideavim

IdeaVim โ€“ A Vim engine for JetBrains IDEs
Kotlin
7,980
star
7

kotlin-native

Kotlin/Native infrastructure
Kotlin
7,026
star
8

ring-ui

A collection of JetBrains Web UI components
TypeScript
3,595
star
9

intellij-platform-plugin-template

Template repository for creating plugins for IntelliJ Platform
Kotlin
3,048
star
10

kotlinconf-app

KotlinConf Schedule Application
Kotlin
2,967
star
11

skija

Java bindings for Skia
Java
2,628
star
12

create-react-kotlin-app

Create React apps using Kotlin with no build configuration
JavaScript
2,480
star
13

projector-docker

Run JetBrains IDEs remotely with Docker
Shell
2,235
star
14

intellij-plugins

Open-source plugins included in the distribution of IntelliJ IDEA Ultimate and other IDEs based on the IntelliJ Platform
Java
2,002
star
15

svg-sprite-loader

Webpack loader for creating SVG sprites.
JavaScript
1,998
star
16

skiko

Kotlin Multiplatform bindings to Skia
C++
1,825
star
17

compose-multiplatform-ios-android-template

Compose Multiplatform iOS+Android Application project template
Kotlin
1,600
star
18

lets-plot

Multiplatform plotting library based on the Grammar of Graphics
Kotlin
1,559
star
19

MPS

JetBrains Meta programming System
JetBrains MPS
1,527
star
20

kotlin-web-site

The Kotlin programming language website
JavaScript
1,474
star
21

intellij-platform-gradle-plugin

Gradle plugin for building plugins for IntelliJ-based IDEs
Kotlin
1,426
star
22

kotlin-wrappers

Kotlin wrappers for popular JavaScript libraries
Kotlin
1,339
star
23

phpstorm-stubs

PHP runtime & extensions header files for PhpStorm
PHP
1,317
star
24

JetBrainsRuntime

Runtime environment based on OpenJDK for running IntelliJ Platform-based products on Windows, macOS, and Linux
Java
1,312
star
25

idea-gitignore

.ignore support plugin for IntelliJ IDEA
Kotlin
1,290
star
26

projector-server

Server-side library for running Swing applications remotely
Kotlin
1,246
star
27

intellij-sdk-docs

IntelliJ SDK Platform Documentation
Markdown
1,212
star
28

intellij-scala

Scala plugin for IntelliJ IDEA
Scala
1,192
star
29

xodus

Transactional schema-less embedded database used by JetBrains YouTrack and JetBrains Hub.
Java
1,180
star
30

kotless

Kotlin Serverless Framework
Kotlin
1,147
star
31

intellij-sdk-code-samples

Mirror of the IntelliJ SDK Docs Code Samples
Java
1,074
star
32

amper

Amper - a project configuration and build tool with a focus on the user experience and the IDE support
Kotlin
995
star
33

js-graphql-intellij-plugin

GraphQL language support for WebStorm, IntelliJ IDEA and other IDEs based on the IntelliJ Platform.
Java
879
star
34

android

Android Plugin for IntelliJ IDEA. This repository is a subset of https://git.jetbrains.org/?p=idea/android.git cut according to GitHub file size limitations.
Kotlin
863
star
35

projector-installer

Install, configure and run JetBrains IDEs with Projector Server on Linux or in WSL
Python
808
star
36

projector-client

Common and client-related code for running Swing applications remotely
Kotlin
806
star
37

Grammar-Kit

Grammar files support & parser/PSI generation for IntelliJ IDEA
Java
715
star
38

jewel

An implementation of the IntelliJ look and feels in Compose for Desktop
Kotlin
709
star
39

markdown

Markdown parser written in kotlin
Kotlin
691
star
40

Arend

The Arend Proof Assistant
Java
691
star
41

jediterm

Pure Java Terminal Emulator. Works with SSH and PTY.
Java
675
star
42

compose-multiplatform-template

Compose Multiplatform Application project template
Kotlin
623
star
43

lincheck

Framework for testing concurrent data structures
Kotlin
576
star
44

Nitra

Public Nitra repository
Nemerle
549
star
45

intellij-micropython

Plugin for MicroPython devices in PyCharm and IntelliJ
Python
506
star
46

compose-multiplatform-desktop-template

Compose Multiplatform Desktop Application project template
Kotlin
447
star
47

kotlin-playground

Self-contained component to embed in websites for running Kotlin code
JavaScript
440
star
48

lets-plot-kotlin

Grammar of Graphics for Kotlin
Kotlin
434
star
49

java-annotations

Annotations for JVM-based languages.
Kotlin
405
star
50

colorSchemeTool

Python
396
star
51

Qodana

๐Ÿ“ Source repository of Qodana Help
389
star
52

phpstorm-attributes

PhpStorm specific attributes
PHP
388
star
53

godot-support

C#
385
star
54

rd

Reactive Distributed communication framework for .NET, Kotlin, C++. Inspired by Rider IDE.
C#
385
star
55

pty4j

Pty for Java
Java
354
star
56

Unity3dRider

Unity JetBrains Rider integration
348
star
57

resharper-fsharp

F# support in JetBrains Rider
F#
328
star
58

phpstorm-workshop

Code for the PhpStorm workshop
PHP
287
star
59

web-types

JSON standard for documenting web component libraries for IDEs, documentation generators and other tools
TypeScript
280
star
60

awesome-pycharm

A curated list of resources for learning and using PyCharm, a Python IDE from JetBrains
280
star
61

gradle-changelog-plugin

Plugin for parsing and managing the Changelog in a "keep a changelog" style.
Kotlin
266
star
62

youtrack-mobile

A iOS and Android client for YouTrack
TypeScript
265
star
63

meta-runner-power-pack

A set of Meta-runners for TeamCity
PowerShell
256
star
64

inspection-plugin

Gradle plugin to launch IDEA inspections
Kotlin
256
star
65

ideolog

Interactive viewer for '.log' files.
Kotlin
254
star
66

qodana-action

โš™๏ธ Scan your Go, Java, Kotlin, PHP, Python, JavaScript, TypeScript, .NET projects at GitHub with Qodana. This repository contains Qodana for Azure, GitHub, CircleCI and Gradle
JavaScript
248
star
67

jcef

A simple framework for embedding Chromium-based browsers into Java-based applications.
Java
245
star
68

kotlin-compiler-server

Server for executing kotlin code
Kotlin
241
star
69

gradle-idea-ext-plugin

Plugin to store IJ settings in gradle script
Groovy
233
star
70

resharper-rider-samples

Simple interactive exercises to help learn ReSharper and Rider
C#
225
star
71

php-timeline

Notable events of PHP history
222
star
72

la-clojure

Clojure plugin for IntelliJ IDEA
Java
220
star
73

jdk8u_jdk

Java
212
star
74

pest-intellij

The official Pest Plugin for PhpStorm / IntelliJ IDEA
Kotlin
197
star
75

youtrack-workflows

YouTrack Custom Workflow Repository
JavaScript
194
star
76

psiviewer

PSI Viewer for IntelliJ IDEA plugin development
Java
184
star
77

intellij-plugin-verifier

Compatibility verification tool for IntelliJ Platform plugins
Kotlin
178
star
78

resharper-rider-plugin

https://www.jetbrains.com/help/resharper/sdk/
PowerShell
175
star
79

rider-efcore

Entity Framework Core UI plugin for JetBrains Rider
Kotlin
174
star
80

svg-mixer

Node.js toolset for generating & transforming SVG images and sprites in modern way
JavaScript
173
star
81

qodana-cli

๐Ÿ”ง JetBrains Qodanaโ€™s official command line tool
Go
171
star
82

phpstorm-docker-images

Pre-configured Docker images used by PhpStorm team
Dockerfile
171
star
83

compose-for-web-demos

Historical repository of early Compose for Web effort.
170
star
84

kotlin-web-demo

Online mini-IDE for Kotlin
Kotlin
167
star
85

intellij-samples

Code that demonstrates various IntelliJ IDEA features
Java
167
star
86

jetbrains_guide

JetBrains Guides where Developer Advocacy and the community share ideas.
CSS
164
star
87

jdk8u_hotspot

C++
159
star
88

educational-plugin

Educational plugin to learn and teach programming languages such as Kotlin, Java, Python, JavaScript, and others right inside of JetBrains IntelliJ Platform based IDEs.
Kotlin
152
star
89

teamcity-messages

Python Unit Test Reporting to TeamCity
Python
139
star
90

lets-plot-skia

Skia frontend for Lets-Plot multiplatform plotting library.
Kotlin
137
star
91

ruby-type-inference

Dynamic definitions and types provider for ruby static analysis
Kotlin
137
star
92

YouTrackSharp

.NET Standard 2.0 Library to access YouTrack API.
C#
134
star
93

clion-remote

134
star
94

resharper-angularjs

ReSharper plugin for AngularJS support
JavaScript
134
star
95

UnrealLink

C++
132
star
96

golandtipsandtricks

This is an ever evolving repository for GoLand Tips&Tricks
Go
132
star
97

python-skeletons

The python-skeltons repo is deprecated: use PEP 484 and Typeshed instead
Python
132
star
98

phpstorm-phpstan-plugin

PHPStan plugin for PhpStorm
Java
131
star
99

clion-wsl

Shell
130
star
100

teamcity-docker-samples

TeamCity docker compose samples
Shell
128
star