Skip to content

Commit 451d97e

Browse files
author
Nikita.Lyubimov
committed
Add API to ignore ML sorting. Ignore ML sorting in some Unity items (fix RIDER-85858)
1 parent 21ac484 commit 451d97e

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

resharper/resharper-unity/src/Unity/CSharp/Feature/Services/CodeCompletion/UnityProjectSettingsCompletionProvider.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ private static bool IsPlayAnimationMethod([NotNull] IInvocationExpression invoca
9393
return invocationExpression.InvocationExpressionReference.IsAnimatorPlayMethod();
9494
}
9595

96-
private sealed class StringLiteralItem : TextLookupItemBase
96+
private sealed class StringLiteralItem : TextLookupItemBase, IMLSortingAwareItem
9797
{
9898
public StringLiteralItem([NotNull] string text)
9999
{
@@ -116,6 +116,8 @@ public override void Accept(
116116
{
117117
base.Accept(textControl, nameRange, LookupItemInsertType.Replace, suffix, solution, keepCaretStill);
118118
}
119+
120+
public bool UseMLSort() => false;
119121
}
120122
}
121123
}

resharper/resharper-unity/src/Unity/CSharp/Feature/Services/CodeCompletion/UnityResourcesCompletionProvider.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ bool CollectAutocompletion(ResourceLoadCache.ResourceCacheInfo assetsFolderResou
7272
return resourceLoadCache.CollectItems(CollectAutocompletion);
7373
}
7474

75-
private sealed class ResourcesCompletionItem : TextLookupItemBase
75+
private sealed class ResourcesCompletionItem : TextLookupItemBase, IMLSortingAwareItem
7676
{
7777
public ResourcesCompletionItem([NotNull] string text, [NotNull] string additionalInfo,
7878
ResourceLocationType locationType,
@@ -100,6 +100,8 @@ public override void Accept(
100100
{
101101
base.Accept(textControl, nameRange, LookupItemInsertType.Replace, suffix, solution, keepCaretStill);
102102
}
103+
104+
public bool UseMLSort() => false;
103105
}
104106
}
105107
}

resharper/resharper-unity/src/Unity/CSharp/Feature/Services/CodeCompletion/UnityTagsCompletionProvider.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ private static bool IsTagEquality(CSharpCodeCompletionContext context, out ICSha
9393
}
9494

9595

96-
private sealed class StringLiteralItem : TextLookupItemBase
96+
private sealed class StringLiteralItem : TextLookupItemBase, IMLSortingAwareItem
9797
{
9898
public StringLiteralItem([NotNull] string text)
9999
{
@@ -116,6 +116,8 @@ public override void Accept(
116116
{
117117
base.Accept(textControl, nameRange, LookupItemInsertType.Replace, suffix, solution, keepCaretStill);
118118
}
119+
120+
public bool UseMLSort() => false;
119121
}
120122
}
121123
}

0 commit comments

Comments
 (0)