Skip to content

Commit

Permalink
Merge pull request #1967 from JetBrains/net203-mte-RIDER-55362
Browse files Browse the repository at this point in the history
Fix debug message complaining about accessing old setting
  • Loading branch information
citizenmatt committed Dec 16, 2020
2 parents eb31867 + 1537da9 commit f8d1f86
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 7 deletions.
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,31 @@ This plugin has functionality that is common to both ReSharper and Rider. It als
Since 2018.1, the version numbers and release cycle match Rider's versions and release dates. The plugin is always bundled with Rider, but is released for ReSharper separately. Sometimes the ReSharper version isn't released. This is usually because the changes are not applicable to ReSharper, but also by mistake.


## 2020.3.1
* [Commits](https://github.com/JetBrains/resharper-unity/compare/net203-rtm-2020.3.0...net203-rtm-2020.3.1)
* [Milestone](https://github.com/JetBrains/resharper-unity/milestone/43?closed=1)

# Changed

- Disable performance and Burst context with comment ([#1948](https://github.com/JetBrains/resharper-unity/pull/1948))

# Fixed

- Fix performance context and Burst actions not showing if caret was on first character of method declaration ([#1948](https://github.com/JetBrains/resharper-unity/pull/1948))
- Rider: Fix showing incorrect Code Vision link for expensive code ([#1948](https://github.com/JetBrains/resharper-unity/pull/1948))
- Rider: Fix automatically refreshing assets before running unit tests ([RIDER-54359](https://youtrack.jetbrains.com/issue/RIDER-54359), [#1960](https://github.com/JetBrains/resharper-unity/pull/1960))
- Rider: Fix missing trace scenario in Diagnostic Tools dialog ([#1962](https://github.com/JetBrains/resharper-unity/pull/1962))
- Unity editor: Fix log message on incorrect access of deprecated settings ([RIDER-55362](https://youtrack.jetbrains.com/issue/RIDER-55362), [#1967](https://github.com/JetBrains/resharper-unity/pull/1967))



## 2020.3.0
* Released: [2020-12-14](https://blog.jetbrains.com/dotnet/2020/12/14/rider-2020-3-release/)
* Build: 2020.3.0.5061
* [Commits](https://github.com/JetBrains/resharper-unity/compare/net202...net203-rtm-2020.3.0)
* [Milestone](https://github.com/JetBrains/resharper-unity/milestone/41?closed=1)
* [GitHub release](https://github.com/JetBrains/resharper-unity/releases/tag/net203-rtm-2020.3.0)
* [ReSharper release](https://resharper-plugins.jetbrains.com/packages/JetBrains.Unity/2020.3.0.125)

### Added

Expand Down
2 changes: 1 addition & 1 deletion rider/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ productVersion=2020.3
# Revision for plugin version, appended to productVersion, e.g. 2020.2.2
# Used for published version, plus retrieving correct changelog notes
# TODO: Should ideally come from the TC build. Manually incrementing for each release is error prone (RIDER-49929)
maintenanceVersion=0
maintenanceVersion=1

# Set to "true" on the command line to skip building the dotnet tasks, as a no-op
# nuget restore and msbuild takes too long
Expand Down
4 changes: 2 additions & 2 deletions unity/EditorPlugin/EditorPrefsWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ public static bool AutoRefresh
}

// This is an internal Unity setting. Introduced in 2018.2 (moved in 2018.3). The enum is internal, so we can only
// use the int value, which matches ScriptCompilationDuringPlay, which is a protocol type, and we can't rely on the
// int mapping.
// use the int value, which matches our ScriptCompilationDuringPlay, which is a protocol type. Don't rely on casting
// Unity's value to our value - use the helpers.
// https://github.com/Unity-Technologies/UnityCsReference/blob/2018.2/Editor/Mono/PreferencesWindow/PreferencesWindow.cs#L1154
// https://github.com/Unity-Technologies/UnityCsReference/blob/2018.3/Editor/Mono/PreferencesWindow/PreferencesSettingsProviders.cs#L1074
public static ScriptCompilationDuringPlay ScriptCompilationDuringPlay
Expand Down
9 changes: 5 additions & 4 deletions unity/EditorPlugin/PluginEntryPoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,10 @@ private static PlayModeState GetPlayModeState()

private static void SetupAssemblyReloadEvents()
{
// Unity supports recompile/reload settings natively for Unity 2018.2+
if (UnityUtils.UnityVersion >= new Version(2018, 2))
return;

// playmodeStateChanged was marked obsolete in 2017.1. Still working in 2018.3
#pragma warning disable 618
EditorApplication.playmodeStateChanged += () =>
Expand Down Expand Up @@ -369,10 +373,7 @@ private static int CreateProtocolForSolution(Lifetime lifetime, string solutionN
paths[0], paths[1],
Process.GetCurrentProcess().Id));
var scriptCompilationDuringPlay = UnityUtils.UnityVersion >= new Version(2018, 2)
? EditorPrefsWrapper.ScriptCompilationDuringPlay
: PluginSettings.AssemblyReloadSettings;
model.UnityApplicationSettings.ScriptCompilationDuringPlay.Set(scriptCompilationDuringPlay);
model.UnityApplicationSettings.ScriptCompilationDuringPlay.Set(UnityUtils.SafeScriptCompilationDuringPlay);
model.UnityProjectSettings.ScriptingRuntime.SetValue(UnityUtils.ScriptingRuntime);
Expand Down
1 change: 1 addition & 0 deletions unity/EditorPlugin/PluginSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ private static void RiderPreferencesItem()

EditorGUILayout.HelpBox(loggingMsg, MessageType.None);

// This setting is natively supported in Unity 2018.2+
if (UnityUtils.UnityVersion < new Version(2018, 2))
{
EditorGUI.BeginChangeCheck();
Expand Down
5 changes: 5 additions & 0 deletions unity/EditorPlugin/UnityUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ internal static int ScriptingRuntime
}
}

internal static ScriptCompilationDuringPlay SafeScriptCompilationDuringPlay =>
UnityVersion >= new Version(2018, 2)
? EditorPrefsWrapper.ScriptCompilationDuringPlay
: PluginSettings.AssemblyReloadSettings;

internal static ScriptCompilationDuringPlay ToScriptCompilationDuringPlay(int value)
{
switch (value)
Expand Down

0 comments on commit f8d1f86

Please sign in to comment.