@@ -1068,35 +1068,6 @@ class SuggestionBuilder {
10681068 }
10691069 }
10701070
1071- /// Add a suggestion for a top-level [function] . If a [kind] is provided it
1072- /// will be used as the kind for the suggestion. If the function can only be
1073- /// referenced using a prefix, then the [prefix] should be provided.
1074- void suggestTopLevelFunction2 (
1075- TopLevelFunctionElement function, {
1076- CompletionSuggestionKind kind = CompletionSuggestionKind .INVOCATION ,
1077- String ? prefix,
1078- int ? relevance,
1079- }) {
1080- var completion = _getCompletionString2 (function);
1081- if (completion == null ) return ;
1082- if (_couldMatch (completion, prefix)) {
1083- relevance ?? = relevanceComputer.computeTopLevelRelevance2 (
1084- function,
1085- elementType: function.returnType,
1086- isNotImportedLibrary: isNotImportedLibrary,
1087- );
1088- _addBuilder (
1089- _createCompletionSuggestionBuilder2 (
1090- function,
1091- kind: kind,
1092- prefix: prefix,
1093- relevance: relevance,
1094- isNotImported: isNotImportedLibrary,
1095- ),
1096- );
1097- }
1098- }
1099-
11001071 /// Add a suggestion for a top-level property [getter] . If the accessor can
11011072 /// only be referenced using a prefix, then the [prefix] should be provided.
11021073 void suggestTopLevelGetter (
@@ -1424,43 +1395,6 @@ class SuggestionBuilder {
14241395 );
14251396 }
14261397
1427- /// Returns a [CompletionSuggestionBuilder] based on the [element] , or `null`
1428- /// if the element cannot be suggested.
1429- ///
1430- /// If the completion should be something different than the name of the
1431- /// element, then the [completion] should be supplied. If a [kind] is
1432- /// provided, then it will be used rather than the kind normally used for the
1433- /// element. If a [prefix] is provided, then the element name (or completion)
1434- /// will be prefixed. The [relevance] is the relevance of the suggestion.
1435- CompletionSuggestionBuilder ? _createCompletionSuggestionBuilder2 (
1436- Element2 element, {
1437- String ? completion,
1438- required CompletionSuggestionKind kind,
1439- required int relevance,
1440- required bool isNotImported,
1441- String ? prefix,
1442- }) {
1443- completion ?? = _getCompletionString2 (element);
1444- if (completion == null ) {
1445- return null ;
1446- }
1447-
1448- if (prefix != null ) {
1449- completion = '$prefix .$completion ' ;
1450- }
1451-
1452- return _CompletionSuggestionBuilderImpl (
1453- orgElement: element,
1454- suggestionBuilder: this ,
1455- kind: kind,
1456- completion: completion,
1457- relevance: relevance,
1458- libraryUriStr: libraryUriStr,
1459- requiredImports: requiredImports,
1460- isNotImported: isNotImported,
1461- );
1462- }
1463-
14641398 _ElementCompletionData _createElementCompletionData (Element2 element) {
14651399 var documentation = _getDocumentation (element);
14661400
@@ -1556,14 +1490,6 @@ class SuggestionBuilder {
15561490 return element.displayName;
15571491 }
15581492
1559- String ? _getCompletionString2 (Element2 element) {
1560- if (element is MethodElement2 && element.isOperator) {
1561- return null ;
1562- }
1563-
1564- return element.displayName;
1565- }
1566-
15671493 /// If the [element] has a documentation comment, return it.
15681494 _ElementDocumentation ? _getDocumentation (Element2 element) {
15691495 var doc = request.documentationComputer.compute (
0 commit comments