Skip to content

Commit

Permalink
Add API to ignore ML sorting. Ignore ML sorting in some Unity items (…
Browse files Browse the repository at this point in the history
…fix RIDER-85858)
  • Loading branch information
Nikita.Lyubimov committed Dec 2, 2022
1 parent 21ac484 commit 451d97e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ private static bool IsPlayAnimationMethod([NotNull] IInvocationExpression invoca
return invocationExpression.InvocationExpressionReference.IsAnimatorPlayMethod();
}

private sealed class StringLiteralItem : TextLookupItemBase
private sealed class StringLiteralItem : TextLookupItemBase, IMLSortingAwareItem
{
public StringLiteralItem([NotNull] string text)
{
Expand All @@ -116,6 +116,8 @@ public override void Accept(
{
base.Accept(textControl, nameRange, LookupItemInsertType.Replace, suffix, solution, keepCaretStill);
}

public bool UseMLSort() => false;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ bool CollectAutocompletion(ResourceLoadCache.ResourceCacheInfo assetsFolderResou
return resourceLoadCache.CollectItems(CollectAutocompletion);
}

private sealed class ResourcesCompletionItem : TextLookupItemBase
private sealed class ResourcesCompletionItem : TextLookupItemBase, IMLSortingAwareItem
{
public ResourcesCompletionItem([NotNull] string text, [NotNull] string additionalInfo,
ResourceLocationType locationType,
Expand Down Expand Up @@ -100,6 +100,8 @@ public override void Accept(
{
base.Accept(textControl, nameRange, LookupItemInsertType.Replace, suffix, solution, keepCaretStill);
}

public bool UseMLSort() => false;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ private static bool IsTagEquality(CSharpCodeCompletionContext context, out ICSha
}


private sealed class StringLiteralItem : TextLookupItemBase
private sealed class StringLiteralItem : TextLookupItemBase, IMLSortingAwareItem
{
public StringLiteralItem([NotNull] string text)
{
Expand All @@ -116,6 +116,8 @@ public override void Accept(
{
base.Accept(textControl, nameRange, LookupItemInsertType.Replace, suffix, solution, keepCaretStill);
}

public bool UseMLSort() => false;
}
}
}

0 comments on commit 451d97e

Please sign in to comment.