• Stars
    star
    1,199
  • Rank 37,403 (Top 0.8 %)
  • Language
    C#
  • License
    Apache License 2.0
  • Created over 8 years ago
  • Updated 6 days 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
45,725
star
2

intellij-community

IntelliJ IDEA Community Edition & IntelliJ Platform
16,452
star
3

compose-multiplatform

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

JetBrainsMono

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

ideavim

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

Exposed

Kotlin SQL Framework
Kotlin
7,869
star
7

kotlin-native

Kotlin/Native infrastructure
Kotlin
7,048
star
8

ring-ui

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

kotlinconf-app

KotlinConf Schedule Application
Kotlin
2,830
star
10

intellij-platform-plugin-template

Template repository for creating plugins for IntelliJ Platform
Kotlin
2,791
star
11

skija

Java bindings for Skia
Java
2,605
star
12

create-react-kotlin-app

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

projector-docker

Run JetBrains IDEs remotely with Docker
Shell
2,209
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 MPP bindings to Skia
C++
1,685
star
17

compose-multiplatform-ios-android-template

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

MPS

JetBrains Meta programming System
JetBrains MPS
1,500
star
19

lets-plot

Multiplatform plotting library based on the Grammar of Graphics
Kotlin
1,446
star
20

kotlin-web-site

The Kotlin programming language website
JavaScript
1,413
star
21

intellij-platform-gradle-plugin

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

phpstorm-stubs

PHP runtime & extensions header files for PhpStorm
PHP
1,297
star
23

kotlin-wrappers

Kotlin wrappers for popular JavaScript libraries
Kotlin
1,294
star
24

idea-gitignore

.ignore support plugin for IntelliJ IDEA
Kotlin
1,287
star
25

projector-server

Server-side library for running Swing applications remotely
Kotlin
1,230
star
26

intellij-sdk-docs

IntelliJ SDK Platform Documentation
Markdown
1,181
star
27

xodus

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

intellij-scala

Scala plugin for IntelliJ IDEA
Scala
1,137
star
29

kotless

Kotlin Serverless Framework
Kotlin
1,124
star
30

JetBrainsRuntime

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

intellij-sdk-code-samples

Mirror of the IntelliJ SDK Docs Code Samples
Java
980
star
32

js-graphql-intellij-plugin

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

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
34

projector-client

Common and client-related code for running Swing applications remotely
Kotlin
813
star
35

projector-installer

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

Grammar-Kit

Grammar files support & parser/PSI generation for IntelliJ IDEA
Java
688
star
37

Arend

The Arend Proof Assistant
Java
676
star
38

amper

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

markdown

Markdown parser written in kotlin
Kotlin
617
star
40

jediterm

Pure Java Terminal Emulator. Works with SSH and PTY.
Java
611
star
41

compose-multiplatform-template

Compose Multiplatform Application project template
Kotlin
603
star
42

jewel

An implementation of the IntelliJ look and feels in Compose for Desktop
Kotlin
580
star
43

Nitra

Public Nitra repository
Nemerle
549
star
44

lincheck

Framework for testing concurrent data structures
Kotlin
520
star
45

intellij-micropython

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

kotlin-playground

Self-contained component to embed in websites for running Kotlin code
JavaScript
422
star
47

colorSchemeTool

Python
396
star
48

compose-multiplatform-desktop-template

Compose Multiplatform Desktop Application project template
Kotlin
393
star
49

lets-plot-kotlin

Grammar of Graphics for Kotlin
Kotlin
389
star
50

Qodana

๐Ÿ“ Source repository of Qodana Help
388
star
51

rd

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

java-annotations

Annotations for JVM-based languages.
Java
362
star
53

phpstorm-attributes

PhpStorm specific attributes
PHP
357
star
54

Unity3dRider

Unity JetBrains Rider integration
348
star
55

godot-support

C#
339
star
56

pty4j

Pty for Java
Java
338
star
57

resharper-fsharp

F# support in JetBrains Rider
F#
320
star
58

phpstorm-workshop

Code for the PhpStorm workshop
PHP
287
star
59

awesome-pycharm

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

web-types

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

meta-runner-power-pack

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

inspection-plugin

Gradle plugin to launch IDEA inspections
Kotlin
255
star
63

youtrack-mobile

A iOS and Android client for YouTrack
TypeScript
255
star
64

gradle-changelog-plugin

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

ideolog

Interactive viewer for '.log' files.
Kotlin
250
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
234
star
67

gradle-idea-ext-plugin

Plugin to store IJ settings in gradle script
Groovy
227
star
68

php-timeline

Notable events of PHP history
222
star
69

resharper-rider-samples

Simple interactive exercises to help learn ReSharper and Rider
C#
221
star
70

la-clojure

Clojure plugin for IntelliJ IDEA
Java
220
star
71

kotlin-compiler-server

Server for executing kotlin code
Kotlin
216
star
72

jdk8u_jdk

Java
210
star
73

jcef

A simple framework for embedding Chromium-based browsers into Java-based applications.
Java
206
star
74

pest-intellij

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

youtrack-workflows

YouTrack Custom Workflow Repository
JavaScript
194
star
76

psiviewer

PSI Viewer for IntelliJ IDEA plugin development
Java
175
star
77

svg-mixer

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

compose-for-web-demos

Historical repository of early Compose for Web effort.
171
star
79

phpstorm-docker-images

Pre-configured Docker images used by PhpStorm team
Dockerfile
170
star
80

rider-efcore

Entity Framework Core UI plugin for JetBrains Rider
Kotlin
169
star
81

jetbrains_guide

JetBrains Guides where Developer Advocacy and the community share ideas.
CSS
168
star
82

kotlin-web-demo

Online mini-IDE for Kotlin
Kotlin
168
star
83

intellij-plugin-verifier

Compatibility verification tool for IntelliJ Platform plugins
Kotlin
165
star
84

intellij-samples

Code that demonstrates various IntelliJ IDEA features
Java
163
star
85

jdk8u_hotspot

C++
159
star
86

resharper-rider-plugin

https://www.jetbrains.com/help/resharper/sdk/
PowerShell
158
star
87

qodana-cli

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

teamcity-messages

Python Unit Test Reporting to TeamCity
Python
139
star
89

ruby-type-inference

Dynamic definitions and types provider for ruby static analysis
Kotlin
136
star
90

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
134
star
91

resharper-angularjs

ReSharper plugin for AngularJS support
JavaScript
134
star
92

clion-remote

134
star
93

golandtipsandtricks

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

python-skeletons

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

clion-wsl

Shell
130
star
96

phpstorm-phpstan-plugin

PHPStan plugin for PhpStorm
Java
130
star
97

teamcity-docker-samples

TeamCity docker compose samples
Shell
128
star
98

phpstorm-psalm-plugin

Psalm plugin for PhpStorm
Java
126
star
99

jdk8u

Shell
123
star
100

YouTrackSharp

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