Cleanup after element model migration

Change-Id: I4a0ac8ed2554d1f5ad11fb5093e5cd587b87cdd4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/413523
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart b/pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart
index dcf0de8..2e3ef8c 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart
@@ -1068,35 +1068,6 @@
     }
   }
 
-  /// Add a suggestion for a top-level [function]. If a [kind] is provided it
-  /// will be used as the kind for the suggestion. If the function can only be
-  /// referenced using a prefix, then the [prefix] should be provided.
-  void suggestTopLevelFunction2(
-    TopLevelFunctionElement function, {
-    CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION,
-    String? prefix,
-    int? relevance,
-  }) {
-    var completion = _getCompletionString2(function);
-    if (completion == null) return;
-    if (_couldMatch(completion, prefix)) {
-      relevance ??= relevanceComputer.computeTopLevelRelevance2(
-        function,
-        elementType: function.returnType,
-        isNotImportedLibrary: isNotImportedLibrary,
-      );
-      _addBuilder(
-        _createCompletionSuggestionBuilder2(
-          function,
-          kind: kind,
-          prefix: prefix,
-          relevance: relevance,
-          isNotImported: isNotImportedLibrary,
-        ),
-      );
-    }
-  }
-
   /// Add a suggestion for a top-level property [getter]. If the accessor can
   /// only be referenced using a prefix, then the [prefix] should be provided.
   void suggestTopLevelGetter(
@@ -1424,43 +1395,6 @@
     );
   }
 
-  /// Returns a [CompletionSuggestionBuilder] based on the [element], or `null`
-  /// if the element cannot be suggested.
-  ///
-  /// If the completion should be something different than the name of the
-  /// element, then the [completion] should be supplied. If a [kind] is
-  /// provided, then it will be used rather than the kind normally used for the
-  /// element. If a [prefix] is provided, then the element name (or completion)
-  /// will be prefixed. The [relevance] is the relevance of the suggestion.
-  CompletionSuggestionBuilder? _createCompletionSuggestionBuilder2(
-    Element2 element, {
-    String? completion,
-    required CompletionSuggestionKind kind,
-    required int relevance,
-    required bool isNotImported,
-    String? prefix,
-  }) {
-    completion ??= _getCompletionString2(element);
-    if (completion == null) {
-      return null;
-    }
-
-    if (prefix != null) {
-      completion = '$prefix.$completion';
-    }
-
-    return _CompletionSuggestionBuilderImpl(
-      orgElement: element,
-      suggestionBuilder: this,
-      kind: kind,
-      completion: completion,
-      relevance: relevance,
-      libraryUriStr: libraryUriStr,
-      requiredImports: requiredImports,
-      isNotImported: isNotImported,
-    );
-  }
-
   _ElementCompletionData _createElementCompletionData(Element2 element) {
     var documentation = _getDocumentation(element);
 
@@ -1556,14 +1490,6 @@
     return element.displayName;
   }
 
-  String? _getCompletionString2(Element2 element) {
-    if (element is MethodElement2 && element.isOperator) {
-      return null;
-    }
-
-    return element.displayName;
-  }
-
   /// If the [element] has a documentation comment, return it.
   _ElementDocumentation? _getDocumentation(Element2 element) {
     var doc = request.documentationComputer.compute(