Skip to content

Commit e287adf

Browse files
author
Merge Robot
committed
Robot-merge branch net231 into net231_meta_tracker_shakhov by Ivan.Shakhov <[email protected]>
2 parents 1ced244 + 09af2bc commit e287adf

File tree

99 files changed

+1141
-820
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+1141
-820
lines changed

CHANGELOG.md

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,67 @@ Since 2018.1, the version numbers and release cycle match Rider's versions and r
1010

1111
## 2023.1.0
1212
* [Commits](https://github.com/JetBrains/resharper-unity/compare/net223...net231)
13+
* [Milestone](https://github.com/JetBrains/resharper-unity/milestone/58?closed=1)
14+
15+
### Added
16+
17+
- Add context action and Generate menu item to generate baker and authoring classes from DOTS component data ([RIDER-85175](https://youtrack.jetbrains.com/issue/RIDER-85175))
18+
- Add file templates for DOTS component data, systems, aspects and entity jobs ([RIDER-85180](https://youtrack.jetbrains.com/issue/RIDER-85180))
19+
- Add inspection to check that `ComponentLookup` is updated in a system ([RIDER-85179](https://youtrack.jetbrains.com/issue/RIDER-85179))
20+
- Add quick fix to add a call to `ComponentLookup.Update` in a system's `OnUpdate` method ([RIDER-85179](https://youtrack.jetbrains.com/issue/RIDER-85179))
21+
- Add inspection and quick fix to ensure that a system calling `GetSingleton` has a corresponding call to `RequireForUpdate` ([RIDER-85181](https://youtrack.jetbrains.com/issue/RIDER-85181))
22+
- Add Find Usages support for methods used implicitly in animation clips ([RIDER-77030](https://youtrack.jetbrains.com/issue/RIDER-77030))
23+
- Add custom formatting rules to keep `[Header]` attribute on separate line ([RIDER-71840](https://youtrack.jetbrains.com/issue/RIDER-71840))
24+
- Rider: Provide link to online help for types and type members in Unity packages ([RIDER-86917](https://youtrack.jetbrains.com/issue/RIDER-86917))
25+
26+
### Changed
27+
28+
- Serialised fields are now accurately recognised in any class, not just known Unity types ([RIDER-79871](https://youtrack.jetbrains.com/issue/RIDER-79871), [RIDER-72838](https://youtrack.jetbrains.com/issue/RIDER-72838))
29+
- Re-evaluate resource warnings when a resource file is updated or deleted
30+
- Improve support for prefab modifications and event handlers
31+
- Rider: Allow static methods for `EventTrigger` usages
32+
- Rider: Update icons for `.asmdef`, `.asmref` and `.inputactions` files ([RIDER-68006](https://youtrack.jetbrains.com/issue/RIDER-68006))
33+
- Rider: Update Unity Explorer UI for new search experience ([RIDER-82417](https://youtrack.jetbrains.com/issue/RIDER-82417))
34+
- Rider: "ECS system" Code Vision lens renamed to "DOTS" ([RIDER-87790](https://youtrack.jetbrains.com/issue/RIDER-87790))
35+
36+
### Fixed
37+
38+
- Fix asset usages for package scripts and assets ([RIDER-85431](https://youtrack.jetbrains.com/issue/RIDER-85431))
39+
- Fix method usage inside `EventTrigger` prefab modification ([RIDER-47693](https://youtrack.jetbrains.com/issue/RIDER-47693))
40+
- Fix warning when a partial DOTS class and its generated part both declare the same base class ([RIDER-87055](https://youtrack.jetbrains.com/issue/RIDER-87055))
41+
- Fix exception when adding performance indicators ([RIDER-87523](https://youtrack.jetbrains.com/issue/RIDER-87523))
42+
- Fix memory leak when showing usages of code in Unity editor tool window ([RIDER-87538](https://youtrack.jetbrains.com/issue/RIDER-87538))
43+
- Fix indexing project settings and assembly definitions when asset indexing is disabled ([RIDER-87363](https://youtrack.jetbrains.com/issue/RIDER-87363))
44+
- Rider: Fix unable to find usages or `.asmdef` files when player projects generated ([RIDER-71238](https://youtrack.jetbrains.com/issue/RIDER-71238))
45+
- Rider: Fix completion list showing duplicate entries when player projects generated ([RIDER-75500](https://youtrack.jetbrains.com/issue/RIDER-75500))
46+
- Rider: Fix "Attach to Unity" run configuration form to resize gracefully ([RIDER-84643](https://youtrack.jetbrains.com/issue/RIDER-75500))
47+
- Rider: Fix online documentation URL for nested classes
48+
- Rider: Fix Unity Log view losing selected item when search field is cleared ([#2381](https://github.com/JetBrains/resharper-unity/issues/2381))
49+
- Rider: Fix issue with UnityYamlMerge not being called ([RIDER-87413](https://youtrack.jetbrains.com/issue/RIDER-87413))
50+
51+
52+
53+
## 2022.3.1
54+
* Released: [2022-12-21](https://blog.jetbrains.com/dotnet/2022/12/21/resharper-and-rider-2022-3-1-bug-fixes/)
55+
* Build: 2022.3.0.191
56+
* [Commits](https://github.com/JetBrains/resharper-unity/compare/net223-rtm-2022.3.0...net223-rtm-2022.3.1)
1357
* [Milestone](https://github.com/JetBrains/resharper-unity/milestone/57?closed=1)
58+
* [GitHub release](https://github.com/JetBrains/resharper-unity/releases/tag/net223-rtm-2022.3.1)
59+
* [ReSharper release](https://resharper-plugins.jetbrains.com/packages/JetBrains.Unity/2022.3.0.191)
60+
61+
### Fixed
62+
63+
- Rider: Stop ranking resource string literals with ML completion ([RIDER-85858](https://youtrack.jetbrains.com/issue/RIDER-85858))
64+
65+
1466

1567
## 2022.3.0
16-
* [Commits](https://github.com/JetBrains/resharper-unity/compare/net222...net223)
68+
* Released: [2022-12-07](https://blog.jetbrains.com/dotnet/2022/12/07/rider-2022-3/)
69+
* Build: 2022.3.0.183
70+
* [Commits](https://github.com/JetBrains/resharper-unity/compare/net222...net223-rtm-2022.3.0)
1771
* [Milestone](https://github.com/JetBrains/resharper-unity/milestone/55?closed=1)
72+
* [GitHub release](https://github.com/JetBrains/resharper-unity/releases/tag/net223-rtm-2022.3.0)
73+
* [ReSharper release](https://resharper-plugins.jetbrains.com/packages/JetBrains.Unity/2022.3.0.183)
1874

1975
### Added
2076

@@ -63,6 +119,15 @@ Since 2018.1, the version numbers and release cycle match Rider's versions and r
63119
- Rider: Fix issue reading packages with up-to-date but disabled `packages-lock.json` ([RIDER-81728](https://youtrack.jetbrains.com/issue/RIDER-81728), [#2355](https://github.com/JetBrains/resharper-unity/pull/2355))
64120
- Rider: Reduce overhead of checking for Android functionality
65121
- Rider: Improve startup time for very large projects when asset indexing disabled ([RIDER-83398](https://youtrack.jetbrains.com/issue/RIDER-83398))
122+
- Rider: Fix error when trying to invoke "Start Unity" action ([RIDER-85383](https://youtrack.jetbrains.com/issue/RIDER-85383))
123+
- Rider: Fix error starting Unity from toolbar if Android plugin is installed ([RIDER-85695](https://youtrack.jetbrains.com/issue/RIDER-85695))
124+
125+
126+
127+
## 2022.2.4
128+
* Released: [2022-11-08](https://blog.jetbrains.com/dotnet/2022/11/08/resharper-and-rider-2022-2-4-bug-fix/)
129+
* Build: 2022.2.3.184
130+
* No code changes
66131

67132

68133

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<ItemGroup>
4-
<PackageLock Include="CitizenMatt.ReSharper.LiveTemplateCompiler" Version="3.2.0" />
54
<PackageLock Include="Microsoft.NETFramework.ReferenceAssemblies.net472" Version="1.0.2" IsDevelopmentDependency="True" />
65
</ItemGroup>
7-
</Project>
6+
</Project>

resharper/resharper-unity/src/Unity.Rider/Common/CSharp/Daemon/CodeInsights/UnityCodeInsightFieldUsageProvider.cs

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#nullable enable
2+
13
using System;
24
using System.Collections.Generic;
35
using System.Linq;
@@ -59,7 +61,8 @@ public class UnityCodeInsightFieldUsageProvider : AbstractUnityCodeInsightProvid
5961
public override ICollection<CodeVisionRelativeOrdering> RelativeOrderings =>
6062
new[] {new CodeVisionRelativeOrderingLast()};
6163

62-
public UnityCodeInsightFieldUsageProvider(IFrontendBackendHost frontendBackendHost, BulbMenuComponent bulbMenu,
64+
public UnityCodeInsightFieldUsageProvider(IFrontendBackendHost frontendBackendHost,
65+
BulbMenuComponent bulbMenu,
6366
DeferredCacheController deferredCacheController,
6467
AssetInspectorValuesContainer inspectorValuesContainer,
6568
UnityEventsElementContainer unityEventsElementContainer)
@@ -117,7 +120,7 @@ public void AddInspectorHighlighting(IHighlightingConsumer consumer, ICSharpDecl
117120
IDeclaredElement declaredElement, string baseDisplayName, string baseTooltip, string moreText, IconModel iconModel,
118121
IEnumerable<BulbMenuItem> items, List<CodeVisionEntryExtraActionModel> extraActions)
119122
{
120-
string displayName = null;
123+
string? displayName = null;
121124

122125
var solution = element.GetSolution();
123126
Assertion.Assert(solution.Locks.IsReadAccessAllowed(), "ReadLock required");
@@ -174,8 +177,8 @@ public void AddInspectorHighlighting(IHighlightingConsumer consumer, ICSharpDecl
174177
}
175178

176179

177-
var initializer = (element as IFieldDeclaration).NotNull("element as IFieldDeclaration != null").Initial;
178-
var initValue = (initializer as IExpressionInitializer)?.Value?.ConstantValue.Value;
180+
var initializer = (element as IFieldDeclaration).NotNull().Initial;
181+
var initValue = (initializer as IExpressionInitializer)?.Value?.ConstantValue;
179182

180183
var initValueUnityPresentation = GetUnitySerializedPresentation(presentationType, initValue);
181184

@@ -246,24 +249,30 @@ private string GetTooltip(int changesCount, bool isEstimated, bool isUniqueChang
246249
return $"Changed in {changesCount} assets" + (isEstimated ? " + possible indirect changes" : "");
247250
}
248251

249-
private IAssetValue GetUnitySerializedPresentation(UnityPresentationType presentationType, object value)
252+
private IAssetValue GetUnitySerializedPresentation(UnityPresentationType presentationType, ConstantValue? value)
250253
{
251-
if (presentationType == UnityPresentationType.Bool && value is bool b)
254+
var b = false;
255+
if (presentationType == UnityPresentationType.Bool && (value == null || value.IsBoolean(out b)))
252256
return b ? new AssetSimpleValue("1") : new AssetSimpleValue("0");
253257

254-
if (presentationType == UnityPresentationType.ScriptableObject && value == null)
258+
if (presentationType == UnityPresentationType.ScriptableObject && (value == null || value.IsNull()))
255259
return new AssetReferenceValue(new LocalReference(0, 0));
256260

257-
if (presentationType == UnityPresentationType.FileId && value == null)
261+
if (presentationType == UnityPresentationType.FileId && (value == null || value.IsNull()))
258262
return new AssetReferenceValue(new LocalReference(0, 0));
259263

260-
if ((presentationType == UnityPresentationType.OtherSimple || presentationType == UnityPresentationType.Bool) && value == null)
264+
if (presentationType is UnityPresentationType.OtherSimple or UnityPresentationType.Bool &&
265+
(value == null || value.IsNull()))
266+
{
261267
return new AssetSimpleValue("0");
268+
}
262269

263-
if (value == null)
270+
if (value == null || value.IsNull())
264271
return new AssetSimpleValue(string.Empty);
265272

266-
return new AssetSimpleValue(value.ToString());
273+
#pragma warning disable CS0618
274+
return new AssetSimpleValue(value.Value?.ToString());
275+
#pragma warning restore CS0618
267276
}
268277

269278
private UnityPresentationType GetUnityPresentationType(IType type)
@@ -321,4 +330,4 @@ public enum UnityPresentationType
321330
UnityEvent
322331
}
323332
}
324-
}
333+
}

resharper/resharper-unity/src/Unity.Rider/Integration/CSharp/Feature/Settings/AdditionalFileLayoutSettingsHelper.cs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
#nullable enable
2+
13
using System;
24
using JetBrains.Application.Settings;
35
using JetBrains.DataFlow;
46
using JetBrains.Lifetimes;
57
using JetBrains.ReSharper.Plugins.Unity.CSharp.Psi.CodeStyle;
68
using JetBrains.ReSharper.Plugins.Unity.Rider.Resources;
7-
using JetBrains.Rider.Backend.Features.Dialog;
89
using JetBrains.Rider.Backend.Features.Settings.OptionsPage.CSharpFileLayout;
910
using JetBrains.Util;
1011

@@ -17,25 +18,21 @@ public class AdditionalFileLayoutSettingsHelper
1718
" \n" +
1819
"</Patterns>";
1920

20-
private static readonly object ourLocalChangeToken = new object();
21+
private static readonly object ourLocalChangeToken = new();
2122

22-
private readonly RiderDialogHost myDialogHost;
2323
private readonly string myDefaultWithRegions;
2424
private readonly string myDefaultWithoutRegions;
2525

26-
public AdditionalFileLayoutSettingsHelper(in Lifetime lifetime, IContextBoundSettingsStore settingsContext,
27-
RiderDialogHost dialogHost)
26+
public AdditionalFileLayoutSettingsHelper(in Lifetime lifetime, IContextBoundSettingsStore settingsContext)
2827
{
29-
myDialogHost = dialogHost;
30-
3128
myDefaultWithoutRegions = AdditionalFileLayoutResources.DefaultAdditionalFileLayoutPatterns.ReplaceNewLines("\n");
3229
myDefaultWithRegions = AdditionalFileLayoutResources.DefaultAdditionalFileLayoutPatternsWithRegions.ReplaceNewLines("\n");
3330

3431
var initialText = settingsContext.GetValue((AdditionalFileLayoutSettings s) => s.Pattern);
3532
if (initialText.IsNullOrEmpty()) initialText = AdditionalFileLayoutResources.DefaultAdditionalFileLayoutPatterns;
3633
initialText = initialText.ReplaceNewLines("\n");
3734

38-
Text = new Property<string>(lifetime, "AdditionalFileLayoutSettingsHelper.Text", initialText);
35+
Text = new Property<string>("AdditionalFileLayoutSettingsHelper.Text", initialText);
3936

4037
Text.Change.Advise_NoAcknowledgement(lifetime, args =>
4138
{
@@ -77,4 +74,4 @@ public void LoadDefaultPattern(DefaultPatternKind kind)
7774
}
7875
}
7976
}
80-
}
77+
}

resharper/resharper-unity/src/Unity.Rider/Integration/CSharp/Feature/Settings/UnityFileLayoutPageTab.cs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1+
#nullable enable
2+
13
using JetBrains.Application.UI.Options;
24
using JetBrains.Application.UI.Options.OptionsDialog;
35
using JetBrains.IDE.UI.Extensions;
46
using JetBrains.IDE.UI.Extensions.Properties;
57
using JetBrains.Lifetimes;
68
using JetBrains.ReSharper.Plugins.Unity.Rider.Resources;
7-
using JetBrains.ReSharper.Plugins.Unity.Rider.Resources;
8-
using JetBrains.Rider.Backend.Features.Dialog;
99
using JetBrains.Rider.Backend.Features.Settings.OptionsPage.CSharpFileLayout;
1010
using JetBrains.Rider.Model;
1111
using JetBrains.Rider.Model.UIAutomation;
@@ -15,22 +15,16 @@ namespace JetBrains.ReSharper.Plugins.Unity.Rider.Integration.CSharp.Feature.Set
1515
[OptionsComponent]
1616
public class UnityFileLayoutPageTab : IFileLayoutPageTab
1717
{
18-
private readonly RiderDialogHost myDialogHost;
19-
private readonly RdLanguage myFileLayoutLanguage = new RdLanguage("XML");
18+
private readonly RdLanguage myFileLayoutLanguage = new("XML");
2019

2120
private const string DummyFileName = "Dummy.filelayout";
2221

23-
public UnityFileLayoutPageTab(RiderDialogHost dialogHost)
24-
{
25-
myDialogHost = dialogHost;
26-
}
27-
2822
public string Title => "Unity";
2923

3024
public BeControl Create(Lifetime lifetime, OptionsPageContext optionsPageContext,
3125
OptionsSettingsSmartContext optionsSettingsSmartContext)
3226
{
33-
var fileLayoutSettings = new AdditionalFileLayoutSettingsHelper(lifetime, optionsSettingsSmartContext, myDialogHost);
27+
var fileLayoutSettings = new AdditionalFileLayoutSettingsHelper(lifetime, optionsSettingsSmartContext);
3428
var textControl = BeControls.GetLanguageTextControl(fileLayoutSettings.Text, lifetime, false, myFileLayoutLanguage, DummyFileName, true);
3529
var toolbar = BeControls.GetToolbar(textControl);
3630

@@ -49,4 +43,4 @@ public BeControl Create(Lifetime lifetime, OptionsPageContext optionsPageContext
4943
return grid.WithMargin(margin);
5044
}
5145
}
52-
}
46+
}

resharper/resharper-unity/src/Unity.Rider/Integration/Core/Caches/RiderDeferredCacheProgressBar.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
#nullable enable
2+
13
using System;
2-
using JetBrains.Annotations;
34
using JetBrains.Application.Threading;
45
using JetBrains.Application.Threading.Tasks;
56
using JetBrains.Collections.Viewable;
@@ -18,9 +19,9 @@ public class RiderDeferredCacheProgressBar : DeferredCacheProgressBar
1819
private readonly Lifetime myLifetime;
1920
private readonly DeferredHelperCache myCache;
2021
private readonly IShellLocks myLocks;
21-
[CanBeNull] private readonly BackgroundProgressManager myBackgroundProgressManager;
22+
private readonly BackgroundProgressManager? myBackgroundProgressManager;
2223

23-
public RiderDeferredCacheProgressBar(Lifetime lifetime, DeferredHelperCache cache, IShellLocks locks, [CanBeNull] BackgroundProgressManager backgroundProgressManager = null)
24+
public RiderDeferredCacheProgressBar(Lifetime lifetime, DeferredHelperCache cache, IShellLocks locks, BackgroundProgressManager? backgroundProgressManager = null)
2425
: base(lifetime, cache)
2526
{
2627
myLifetime = lifetime;
@@ -42,7 +43,7 @@ public override void Start(Lifetime startLifetime)
4243

4344
var count = myCache.FilesToProcess.Count;
4445
var processedCount = 0;
45-
var progress = new Property<double>(startLifetime, "DeferredCacheProgressBarProgress", 0);
46+
var progress = new Property<double>("DeferredCacheProgressBarProgress", 0);
4647

4748
myCache.AfterRemoveFromProcess.Advise(startLifetime, _ =>
4849
{
@@ -51,7 +52,7 @@ public override void Start(Lifetime startLifetime)
5152
progress.Value = Math.Min(0.99, ((double) processedCount) / count);
5253
});
5354

54-
var description = new Property<string>(startLifetime, "DeferredCacheProgressBarDescription", Strings.RiderDeferredCacheProgressBar_Start_Processing_assets);
55+
var description = new Property<string>("DeferredCacheProgressBarDescription", Strings.RiderDeferredCacheProgressBar_Start_Processing_assets);
5556
var task = BackgroundProgressBuilder.Create()
5657
.WithTitle(Strings.RiderDeferredCacheProgressBar_Start_Calculating_asset_index)
5758
.WithDescription(description)
@@ -65,4 +66,4 @@ public override void Start(Lifetime startLifetime)
6566
}
6667
}
6768
}
68-
}
69+
}

resharper/resharper-unity/src/Unity.Rider/Integration/Core/Feature/UnitTesting/RunViaUnityEditorStrategy.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#nullable enable
2+
13
using System;
24
using System.Collections.Generic;
35
using System.Diagnostics;
@@ -39,8 +41,6 @@
3941
using Status = JetBrains.Rider.Model.Unity.BackendUnity.Status;
4042
using UnitTestLaunch = JetBrains.Rider.Model.Unity.BackendUnity.UnitTestLaunch;
4143

42-
#nullable enable
43-
4444
namespace JetBrains.ReSharper.Plugins.Unity.Rider.Integration.Core.Feature.UnitTesting
4545
{
4646
[SolutionComponent]
@@ -87,7 +87,7 @@ public RunViaUnityEditorStrategy(ISolution solution,
8787
myLifetime = lifetime;
8888
myPackageCompatibilityValidator = packageCompatibilityValidator;
8989

90-
myUnityProcessId = new Property<int?>(lifetime, "RunViaUnityEditorStrategy.UnityProcessId");
90+
myUnityProcessId = new Property<int?>("RunViaUnityEditorStrategy.UnityProcessId");
9191

9292
myUnityProcessId.ForEachValue_NotNull(lifetime, (lt, processId) =>
9393
{
@@ -188,8 +188,7 @@ private Task Run(IUnitTestRun run)
188188

189189
private void RefreshAndRunTask(IUnitTestRun run, TaskCompletionSource<bool> tcs, Lifetime taskLifetime)
190190
{
191-
var cancellationTs = run.GetData(ourCancellationTokenSourceKey)
192-
.NotNull("run.GetData(ourCancellationTokenSourceKey) != null");
191+
var cancellationTs = run.GetData(ourCancellationTokenSourceKey).NotNull();
193192
var cancellationToken = cancellationTs.Token;
194193

195194
myLogger.Trace("Before calling Refresh.");
@@ -581,4 +580,4 @@ public override int GetHashCode()
581580
public bool IsUnmanaged => false;
582581
}
583582
}
584-
}
583+
}

0 commit comments

Comments
 (0)