コード例 #1
0
ファイル: WrapItemsAction.cs プロジェクト: zuvys/roslyn
        public static ImmutableArray <CodeAction> SortActionsByMostRecentlyUsed(ImmutableArray <CodeAction> codeActions)
        {
            // make a local so this array can't change out from under us.
            var mruTitles = s_mruTitles;

            return(codeActions.Sort((d1, d2) => ComparerWithState.CompareTo(d1, d2, (mruTitles, codeActions), s_comparers)));
        }
コード例 #2
0
        public int CompareTo(PackageWithAssemblyResult? other)
        {
            if (other is null)
                return 1;

            return ComparerWithState.CompareTo(this, other, s_comparers);
        }
コード例 #3
0
            public int CompareTo(Document document, Reference other)
            {
                var diff = ComparerWithState.CompareTo(this, other, document, s_comparers);

                if (diff != 0)
                {
                    return(diff);
                }

                // Both our names need to change.  Sort by the name we're
                // changing to.
                diff = StringComparer.OrdinalIgnoreCase.Compare(
                    SearchResult.DesiredName,
                    other.SearchResult.DesiredName
                    );
                if (diff != 0)
                {
                    return(diff);
                }

                // If the weights are the same and no names changed, just order
                // them based on the namespace we're adding an import for.
                return(INamespaceOrTypeSymbolExtensions.CompareNameParts(
                           SearchResult.NameParts,
                           other.SearchResult.NameParts,
                           placeSystemNamespaceFirst: true
                           ));
            }
コード例 #4
0
            public int Compare(SyntaxToken x, SyntaxToken y)
            {
                if (x.Kind() == y.Kind())
                {
                    return(0);
                }

                return(ComparerWithState.CompareTo(x, y, s_comparers));
            }
コード例 #5
0
        public int CompareTo(VirtualTreePoint other)
        {
            if (Text != other.Text)
            {
                throw new InvalidOperationException(EditorFeaturesResources.Can_t_compare_positions_from_different_text_snapshots);
            }

            return(ComparerWithState.CompareTo(this, other, s_comparers));
        }
コード例 #6
0
 public int CompareTo(PatternMatch other, bool ignoreCase)
 => ComparerWithState.CompareTo(this, other, ignoreCase, s_comparers);
コード例 #7
0
 public int CompareTo(MatchResult other, string filterText)
 => ComparerWithState.CompareTo(this, other, filterText, s_comparers);
コード例 #8
0
 // For ordering of NavigateToItems, see
 // http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.language.navigateto.interfaces.navigatetoitem.aspx
 protected static int CompareNavigateToItems(NavigateToItem a, NavigateToItem b)
 => ComparerWithState.CompareTo(a, b, s_comparisonComponents);
コード例 #9
0
ファイル: FilterResult.cs プロジェクト: wuhanhan/roslyn
 public int CompareTo(FilterResult other)
 => ComparerWithState.CompareTo(this, other, s_comparers);
コード例 #10
0
 public int CompareTo(PackageWithAssemblyResult other)
 => ComparerWithState.CompareTo(this, other, s_comparers);
コード例 #11
0
ファイル: MatchResult.cs プロジェクト: belav/csharpier-repos
 // This comparison is used in the deletion/backspace scenario for selecting best elements.
 public int CompareTo(MatchResult <TEditorCompletionItem> other, string filterText)
 => ComparerWithState.CompareTo(this, other, filterText, s_comparers);