[analysis_server] Switch selections in tests to markup instead of hard-coded numbers

See https://github.com/dart-lang/sdk/issues/60234

Change-Id: I39c9382acecd16d50d4af098fe5f19d49e024ef6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/453041
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
diff --git a/pkg/analysis_server/test/services/completion/dart/completion_printer.dart b/pkg/analysis_server/test/services/completion/dart/completion_printer.dart
index 38ae6bc..9d0cc5d 100644
--- a/pkg/analysis_server/test/services/completion/dart/completion_printer.dart
+++ b/pkg/analysis_server/test/services/completion/dart/completion_printer.dart
@@ -160,13 +160,45 @@
     _indent = indent;
   }
 
+  /// Writes the completion text, marked with a `[!range!]` or `^position`
+  /// indicating the selection.
   void _writeCompletion(CompletionSuggestion suggestion) {
     var completion = suggestion.completion;
+
+    var annotatedCompletion = completion;
+
+    // Show the selection in the completion text using `[!range!]` or
+    // `^position` markers.
+    if (configuration.withSelection) {
+      annotatedCompletion = switch ((
+        suggestion.selectionOffset,
+        suggestion.selectionLength,
+      )) {
+        // We don't annotate positions at the end of the string
+        (int offset, 0) when offset == suggestion.completion.length =>
+          completion,
+        // Position
+        (int offset, 0) => [
+          completion.substring(0, offset),
+          '^',
+          completion.substring(offset),
+        ].join(),
+        // Range
+        (int offset, int length) => [
+          completion.substring(0, offset),
+          '[!',
+          completion.substring(offset, offset + length),
+          '!]',
+          completion.substring(offset + length),
+        ].join(),
+      };
+    }
+
     if (RegExp(r'^\s').hasMatch(completion) ||
         RegExp(r'\s$').hasMatch(completion)) {
-      _writelnWithIndent('|$completion|');
+      _writelnWithIndent('|$annotatedCompletion|');
     } else {
-      _writelnWithIndent(completion);
+      _writelnWithIndent(annotatedCompletion);
     }
   }
 
@@ -319,18 +351,6 @@
     }
   }
 
-  void _writeSelection(CompletionSuggestion suggestion) {
-    if (configuration.withSelection) {
-      var offset = suggestion.selectionOffset;
-      var length = suggestion.selectionLength;
-      if (length != 0) {
-        _writelnWithIndent('selection: $offset $length');
-      } else if (offset != suggestion.completion.length) {
-        _writelnWithIndent('selection: $offset');
-      }
-    }
-  }
-
   void _writeSuggestion(CompletionSuggestion suggestion) {
     _writeCompletion(suggestion);
     _withIndent(() {
@@ -347,7 +367,6 @@
       _writeParameterNames(suggestion);
       _writeRelevance(suggestion);
       _writeReturnType(suggestion);
-      _writeSelection(suggestion);
     });
   }
 
diff --git a/pkg/analysis_server/test/services/completion/dart/completion_test.dart b/pkg/analysis_server/test/services/completion/dart/completion_test.dart
index d3cf776..23b163a 100644
--- a/pkg/analysis_server/test/services/completion/dart/completion_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/completion_test.dart
@@ -323,12 +323,10 @@
 replacement
   right: 5
 suggestions
-  import '';
+  import '^';
     kind: keyword
-    selection: 8
-  export '';
+  export '^';
     kind: keyword
-    selection: 8
   abstract
     kind: keyword
   base
@@ -357,12 +355,10 @@
     kind: keyword
   mixin
     kind: keyword
-  part '';
+  part '^';
     kind: keyword
-    selection: 6
-  part of '';
+  part of '^';
     kind: keyword
-    selection: 9
   sealed
     kind: keyword
   typedef
@@ -4113,35 +4109,30 @@
 suggestions
   @override
   // TODO: implement hashCode
-  int get hashCode => super.hashCode;
+  int get hashCode => [!super.hashCode!];
     kind: override
-    selection: 62 14
   @override
   // TODO: implement runtimeType
-  Type get runtimeType => super.runtimeType;
+  Type get runtimeType => [!super.runtimeType!];
     kind: override
-    selection: 69 17
   @override
   String toString() {
     // TODO: implement toString
-    return super.toString();
+    [!return super.toString();!]
   }
     kind: override
-    selection: 68 24
   @override
   bool operator ==(Object other) {
     // TODO: implement ==
-    return super == other;
+    [!return super == other;!]
   }
     kind: override
-    selection: 75 22
   @override
   noSuchMethod(Invocation invocation) {
     // TODO: implement noSuchMethod
-    return super.noSuchMethod(invocation);
+    [!return super.noSuchMethod(invocation);!]
   }
     kind: override
-    selection: 90 38
   A
     kind: class
   final
@@ -4583,35 +4574,30 @@
 suggestions
   @override
   // TODO: implement hashCode
-  int get hashCode => super.hashCode;
+  int get hashCode => [!super.hashCode!];
     kind: override
-    selection: 62 14
   @override
   // TODO: implement runtimeType
-  Type get runtimeType => super.runtimeType;
+  Type get runtimeType => [!super.runtimeType!];
     kind: override
-    selection: 69 17
   @override
   String toString() {
     // TODO: implement toString
-    return super.toString();
+    [!return super.toString();!]
   }
     kind: override
-    selection: 68 24
   @override
   bool operator ==(Object other) {
     // TODO: implement ==
-    return super == other;
+    [!return super == other;!]
   }
     kind: override
-    selection: 75 22
   @override
   noSuchMethod(Invocation invocation) {
     // TODO: implement noSuchMethod
-    return super.noSuchMethod(invocation);
+    [!return super.noSuchMethod(invocation);!]
   }
     kind: override
-    selection: 90 38
   num
     kind: class
   final
@@ -9053,9 +9039,8 @@
 replacement
   left: 6
 suggestions
-  import '';
+  import '^';
     kind: keyword
-    selection: 8
 ''');
   }
 
@@ -9106,10 +9091,9 @@
   @override
   String toString() {
     // TODO: implement toString
-    return super.toString();
+    [!return super.toString();!]
   }
     kind: override
-    selection: 68 24
   String
     kind: class
   abstract
@@ -9678,35 +9662,30 @@
 suggestions
   @override
   // TODO: implement hashCode
-  int get hashCode => super.hashCode;
+  int get hashCode => [!super.hashCode!];
     kind: override
-    selection: 62 14
   @override
   // TODO: implement runtimeType
-  Type get runtimeType => super.runtimeType;
+  Type get runtimeType => [!super.runtimeType!];
     kind: override
-    selection: 69 17
   @override
   String toString() {
     // TODO: implement toString
-    return super.toString();
+    [!return super.toString();!]
   }
     kind: override
-    selection: 68 24
   @override
   bool operator ==(Object other) {
     // TODO: implement ==
-    return super == other;
+    [!return super == other;!]
   }
     kind: override
-    selection: 75 22
   @override
   noSuchMethod(Invocation invocation) {
     // TODO: implement noSuchMethod
-    return super.noSuchMethod(invocation);
+    [!return super.noSuchMethod(invocation);!]
   }
     kind: override
-    selection: 90 38
   Collection
     kind: class
   List
@@ -9747,35 +9726,30 @@
 suggestions
   @override
   // TODO: implement hashCode
-  int get hashCode => super.hashCode;
+  int get hashCode => [!super.hashCode!];
     kind: override
-    selection: 62 14
   @override
   // TODO: implement runtimeType
-  Type get runtimeType => super.runtimeType;
+  Type get runtimeType => [!super.runtimeType!];
     kind: override
-    selection: 69 17
   @override
   String toString() {
     // TODO: implement toString
-    return super.toString();
+    [!return super.toString();!]
   }
     kind: override
-    selection: 68 24
   @override
   bool operator ==(Object other) {
     // TODO: implement ==
-    return super == other;
+    [!return super == other;!]
   }
     kind: override
-    selection: 75 22
   @override
   noSuchMethod(Invocation invocation) {
     // TODO: implement noSuchMethod
-    return super.noSuchMethod(invocation);
+    [!return super.noSuchMethod(invocation);!]
   }
     kind: override
-    selection: 90 38
   Collection
     kind: class
   List
@@ -9840,16 +9814,14 @@
 suggestions
   @override
   // TODO: implement hashCode
-  int get hashCode => super.hashCode;
+  int get hashCode => [!super.hashCode!];
     kind: override
-    selection: 62 14
   @override
   noSuchMethod(Invocation invocation) {
     // TODO: implement noSuchMethod
-    return super.noSuchMethod(invocation);
+    [!return super.noSuchMethod(invocation);!]
   }
     kind: override
-    selection: 90 38
   Collection
     kind: class
   static
diff --git a/pkg/analysis_server/test/services/completion/dart/declaration/closure_test.dart b/pkg/analysis_server/test/services/completion/dart/declaration/closure_test.dart
index 10f9d14..8e4e813 100644
--- a/pkg/analysis_server/test/services/completion/dart/declaration/closure_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/declaration/closure_test.dart
@@ -41,16 +41,14 @@
 ''');
     assertResponse('''
 suggestions
-  (a, b) => ,
+  (a, b) => ^,
     kind: invocation
     displayText: (a, b) =>
-    selection: 10
   (a, b) {
-${' ' * 4}
+    ^
   },
     kind: invocation
     displayText: (a, b) {}
-    selection: 13
 ''');
   }
 
@@ -70,11 +68,10 @@
     kind: invocation
     displayText: (a, b) =>
   (a, b) {
-${' ' * 6}
+      ^
     }
     kind: invocation
     displayText: (a, b) {}
-    selection: 15
 ''');
   }
 
@@ -88,16 +85,14 @@
 ''');
     assertResponse('''
 suggestions
-  (a, b) => ,
+  (a, b) => ^,
     kind: invocation
     displayText: (a, b) =>
-    selection: 10
   (a, b) {
-${' ' * 4}
+    ^
   },
     kind: invocation
     displayText: (a, b) {}
-    selection: 13
 ''');
   }
 
@@ -115,11 +110,10 @@
     kind: invocation
     displayText: (a, b) =>
   (a, b) {
-${' ' * 4}
+    ^
   }
     kind: invocation
     displayText: (a, b) {}
-    selection: 13
 ''');
   }
 
@@ -138,11 +132,10 @@
     kind: invocation
     displayText: (a, b, [c]) =>
   (List<int> a, Object? b, [dynamic c]) {
-${' ' * 2}
+  ^
 }
     kind: invocation
     displayText: (a, b, [c]) {}
-    selection: 42
 ''');
   }
 
@@ -156,16 +149,14 @@
 ''');
     assertResponse('''
 suggestions
-  (a, {b, c}) => ,
+  (a, {b, c}) => ^,
     kind: invocation
     displayText: (a, {b, c}) =>
-    selection: 15
   (a, {b, c}) {
-${' ' * 4}
+    ^
   },
     kind: invocation
     displayText: (a, {b, c}) {}
-    selection: 18
 ''');
   }
 
@@ -179,16 +170,14 @@
 ''');
     assertResponse('''
 suggestions
-  (a, [b, c]) => ,
+  (a, [b, c]) => ^,
     kind: invocation
     displayText: (a, [b, c]) =>
-    selection: 15
   (a, [b, c]) {
-${' ' * 4}
+    ^
   },
     kind: invocation
     displayText: (a, [b, c]) {}
-    selection: 18
 ''');
   }
 
@@ -202,16 +191,14 @@
 ''');
     assertResponse('''
 suggestions
-  (a, {b, required c}) => ,
+  (a, {b, required c}) => ^,
     kind: invocation
     displayText: (a, {b, c}) =>
-    selection: 24
   (a, {b, required c}) {
-${' ' * 4}
+    ^
   },
     kind: invocation
     displayText: (a, {b, c}) {}
-    selection: 27
 ''');
   }
 
@@ -225,11 +212,10 @@
     kind: invocation
     displayText: (a, b) =>
   (a, b) {
-${' ' * 2}
+  ^
 }
     kind: invocation
     displayText: (a, b) {}
-    selection: 11
 ''');
   }
 }
diff --git a/pkg/analysis_server/test/services/completion/dart/declaration/imported_reference_test.dart b/pkg/analysis_server/test/services/completion/dart/declaration/imported_reference_test.dart
index 51cc834..b34ee0f 100644
--- a/pkg/analysis_server/test/services/completion/dart/declaration/imported_reference_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/declaration/imported_reference_test.dart
@@ -1680,35 +1680,30 @@
 suggestions
   @override
   // TODO: implement hashCode
-  int get hashCode => super.hashCode;
+  int get hashCode => [!super.hashCode!];
     kind: override
-    selection: 62 14
   @override
   // TODO: implement runtimeType
-  Type get runtimeType => super.runtimeType;
+  Type get runtimeType => [!super.runtimeType!];
     kind: override
-    selection: 69 17
   @override
   String toString() {
     // TODO: implement toString
-    return super.toString();
+    [!return super.toString();!]
   }
     kind: override
-    selection: 68 24
   @override
   bool operator ==(Object other) {
     // TODO: implement ==
-    return super == other;
+    [!return super == other;!]
   }
     kind: override
-    selection: 75 22
   @override
   noSuchMethod(Invocation invocation) {
     // TODO: implement noSuchMethod
-    return super.noSuchMethod(invocation);
+    [!return super.noSuchMethod(invocation);!]
   }
     kind: override
-    selection: 90 38
   _B0
     kind: class
   x0.B
@@ -2613,35 +2608,30 @@
 suggestions
   @override
   // TODO: implement hashCode
-  int get hashCode => super.hashCode;
+  int get hashCode => [!super.hashCode!];
     kind: override
-    selection: 62 14
   @override
   // TODO: implement runtimeType
-  Type get runtimeType => super.runtimeType;
+  Type get runtimeType => [!super.runtimeType!];
     kind: override
-    selection: 69 17
   @override
   String toString() {
     // TODO: implement toString
-    return super.toString();
+    [!return super.toString();!]
   }
     kind: override
-    selection: 68 24
   @override
   bool operator ==(Object other) {
     // TODO: implement ==
-    return super == other;
+    [!return super == other;!]
   }
     kind: override
-    selection: 75 22
   @override
   noSuchMethod(Invocation invocation) {
     // TODO: implement noSuchMethod
-    return super.noSuchMethod(invocation);
+    [!return super.noSuchMethod(invocation);!]
   }
     kind: override
-    selection: 90 38
   A0
     kind: class
 ''');
@@ -2662,35 +2652,30 @@
 suggestions
   @override
   // TODO: implement hashCode
-  int get hashCode => super.hashCode;
+  int get hashCode => [!super.hashCode!];
     kind: override
-    selection: 62 14
   @override
   // TODO: implement runtimeType
-  Type get runtimeType => super.runtimeType;
+  Type get runtimeType => [!super.runtimeType!];
     kind: override
-    selection: 69 17
   @override
   String toString() {
     // TODO: implement toString
-    return super.toString();
+    [!return super.toString();!]
   }
     kind: override
-    selection: 68 24
   @override
   bool operator ==(Object other) {
     // TODO: implement ==
-    return super == other;
+    [!return super == other;!]
   }
     kind: override
-    selection: 75 22
   @override
   noSuchMethod(Invocation invocation) {
     // TODO: implement noSuchMethod
-    return super.noSuchMethod(invocation);
+    [!return super.noSuchMethod(invocation);!]
   }
     kind: override
-    selection: 90 38
   A0
     kind: class
 ''');
@@ -2711,35 +2696,30 @@
 suggestions
   @override
   // TODO: implement hashCode
-  int get hashCode => super.hashCode;
+  int get hashCode => [!super.hashCode!];
     kind: override
-    selection: 62 14
   @override
   // TODO: implement runtimeType
-  Type get runtimeType => super.runtimeType;
+  Type get runtimeType => [!super.runtimeType!];
     kind: override
-    selection: 69 17
   @override
   String toString() {
     // TODO: implement toString
-    return super.toString();
+    [!return super.toString();!]
   }
     kind: override
-    selection: 68 24
   @override
   bool operator ==(Object other) {
     // TODO: implement ==
-    return super == other;
+    [!return super == other;!]
   }
     kind: override
-    selection: 75 22
   @override
   noSuchMethod(Invocation invocation) {
     // TODO: implement noSuchMethod
-    return super.noSuchMethod(invocation);
+    [!return super.noSuchMethod(invocation);!]
   }
     kind: override
-    selection: 90 38
   A0
     kind: class
 ''');
@@ -2778,35 +2758,30 @@
 suggestions
   @override
   // TODO: implement hashCode
-  int get hashCode => super.hashCode;
+  int get hashCode => [!super.hashCode!];
     kind: override
-    selection: 62 14
   @override
   // TODO: implement runtimeType
-  Type get runtimeType => super.runtimeType;
+  Type get runtimeType => [!super.runtimeType!];
     kind: override
-    selection: 69 17
   @override
   String toString() {
     // TODO: implement toString
-    return super.toString();
+    [!return super.toString();!]
   }
     kind: override
-    selection: 68 24
   @override
   bool operator ==(Object other) {
     // TODO: implement ==
-    return super == other;
+    [!return super == other;!]
   }
     kind: override
-    selection: 75 22
   @override
   noSuchMethod(Invocation invocation) {
     // TODO: implement noSuchMethod
-    return super.noSuchMethod(invocation);
+    [!return super.noSuchMethod(invocation);!]
   }
     kind: override
-    selection: 90 38
   A0
     kind: class
 ''');
@@ -4661,35 +4636,30 @@
 suggestions
   @override
   // TODO: implement hashCode
-  int get hashCode => super.hashCode;
+  int get hashCode => [!super.hashCode!];
     kind: override
-    selection: 62 14
   @override
   // TODO: implement runtimeType
-  Type get runtimeType => super.runtimeType;
+  Type get runtimeType => [!super.runtimeType!];
     kind: override
-    selection: 69 17
   @override
   String toString() {
     // TODO: implement toString
-    return super.toString();
+    [!return super.toString();!]
   }
     kind: override
-    selection: 68 24
   @override
   bool operator ==(Object other) {
     // TODO: implement ==
-    return super == other;
+    [!return super == other;!]
   }
     kind: override
-    selection: 75 22
   @override
   noSuchMethod(Invocation invocation) {
     // TODO: implement noSuchMethod
-    return super.noSuchMethod(invocation);
+    [!return super.noSuchMethod(invocation);!]
   }
     kind: override
-    selection: 90 38
   C0
     kind: class
   C1
@@ -4725,35 +4695,30 @@
 suggestions
   @override
   // TODO: implement hashCode
-  int get hashCode => super.hashCode;
+  int get hashCode => [!super.hashCode!];
     kind: override
-    selection: 62 14
   @override
   // TODO: implement runtimeType
-  Type get runtimeType => super.runtimeType;
+  Type get runtimeType => [!super.runtimeType!];
     kind: override
-    selection: 69 17
   @override
   String toString() {
     // TODO: implement toString
-    return super.toString();
+    [!return super.toString();!]
   }
     kind: override
-    selection: 68 24
   @override
   bool operator ==(Object other) {
     // TODO: implement ==
-    return super == other;
+    [!return super == other;!]
   }
     kind: override
-    selection: 75 22
   @override
   noSuchMethod(Invocation invocation) {
     // TODO: implement noSuchMethod
-    return super.noSuchMethod(invocation);
+    [!return super.noSuchMethod(invocation);!]
   }
     kind: override
-    selection: 90 38
   C0
     kind: class
   C1
diff --git a/pkg/analysis_server/test/services/completion/dart/declaration/library_prefix_test.dart b/pkg/analysis_server/test/services/completion/dart/declaration/library_prefix_test.dart
index 0c471f5..e1df904 100644
--- a/pkg/analysis_server/test/services/completion/dart/declaration/library_prefix_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/declaration/library_prefix_test.dart
@@ -136,35 +136,30 @@
 suggestions
   @override
   // TODO: implement hashCode
-  int get hashCode => super.hashCode;
+  int get hashCode => [!super.hashCode!];
     kind: override
-    selection: 62 14
   @override
   // TODO: implement runtimeType
-  Type get runtimeType => super.runtimeType;
+  Type get runtimeType => [!super.runtimeType!];
     kind: override
-    selection: 69 17
   @override
   String toString() {
     // TODO: implement toString
-    return super.toString();
+    [!return super.toString();!]
   }
     kind: override
-    selection: 68 24
   @override
   bool operator ==(Object other) {
     // TODO: implement ==
-    return super == other;
+    [!return super == other;!]
   }
     kind: override
-    selection: 75 22
   @override
   noSuchMethod(Invocation invocation) {
     // TODO: implement noSuchMethod
-    return super.noSuchMethod(invocation);
+    [!return super.noSuchMethod(invocation);!]
   }
     kind: override
-    selection: 90 38
   x0.B
     kind: class
   x0
diff --git a/pkg/analysis_server/test/services/completion/dart/declaration/local_reference_test.dart b/pkg/analysis_server/test/services/completion/dart/declaration/local_reference_test.dart
index 11ebac9..361f904 100644
--- a/pkg/analysis_server/test/services/completion/dart/declaration/local_reference_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/declaration/local_reference_test.dart
@@ -2032,35 +2032,30 @@
 suggestions
   @override
   // TODO: implement hashCode
-  int get hashCode => super.hashCode;
+  int get hashCode => [!super.hashCode!];
     kind: override
-    selection: 62 14
   @override
   // TODO: implement runtimeType
-  Type get runtimeType => super.runtimeType;
+  Type get runtimeType => [!super.runtimeType!];
     kind: override
-    selection: 69 17
   @override
   String toString() {
     // TODO: implement toString
-    return super.toString();
+    [!return super.toString();!]
   }
     kind: override
-    selection: 68 24
   @override
   bool operator ==(Object other) {
     // TODO: implement ==
-    return super == other;
+    [!return super == other;!]
   }
     kind: override
-    selection: 75 22
   @override
   noSuchMethod(Invocation invocation) {
     // TODO: implement noSuchMethod
-    return super.noSuchMethod(invocation);
+    [!return super.noSuchMethod(invocation);!]
   }
     kind: override
-    selection: 90 38
   x0.B0
     kind: class
   A0
@@ -5703,35 +5698,30 @@
 suggestions
   @override
   // TODO: implement hashCode
-  int get hashCode => super.hashCode;
+  int get hashCode => [!super.hashCode!];
     kind: override
-    selection: 62 14
   @override
   // TODO: implement runtimeType
-  Type get runtimeType => super.runtimeType;
+  Type get runtimeType => [!super.runtimeType!];
     kind: override
-    selection: 69 17
   @override
   String toString() {
     // TODO: implement toString
-    return super.toString();
+    [!return super.toString();!]
   }
     kind: override
-    selection: 68 24
   @override
   bool operator ==(Object other) {
     // TODO: implement ==
-    return super == other;
+    [!return super == other;!]
   }
     kind: override
-    selection: 75 22
   @override
   noSuchMethod(Invocation invocation) {
     // TODO: implement noSuchMethod
-    return super.noSuchMethod(invocation);
+    [!return super.noSuchMethod(invocation);!]
   }
     kind: override
-    selection: 90 38
   C0
     kind: class
   C1
@@ -5768,35 +5758,30 @@
 suggestions
   @override
   // TODO: implement hashCode
-  int get hashCode => super.hashCode;
+  int get hashCode => [!super.hashCode!];
     kind: override
-    selection: 62 14
   @override
   // TODO: implement runtimeType
-  Type get runtimeType => super.runtimeType;
+  Type get runtimeType => [!super.runtimeType!];
     kind: override
-    selection: 69 17
   @override
   String toString() {
     // TODO: implement toString
-    return super.toString();
+    [!return super.toString();!]
   }
     kind: override
-    selection: 68 24
   @override
   bool operator ==(Object other) {
     // TODO: implement ==
-    return super == other;
+    [!return super == other;!]
   }
     kind: override
-    selection: 75 22
   @override
   noSuchMethod(Invocation invocation) {
     // TODO: implement noSuchMethod
-    return super.noSuchMethod(invocation);
+    [!return super.noSuchMethod(invocation);!]
   }
     kind: override
-    selection: 90 38
   C0
     kind: class
   C1
@@ -6059,35 +6044,30 @@
 suggestions
   @override
   // TODO: implement hashCode
-  int get hashCode => super.hashCode;
+  int get hashCode => [!super.hashCode!];
     kind: override
-    selection: 62 14
   @override
   // TODO: implement runtimeType
-  Type get runtimeType => super.runtimeType;
+  Type get runtimeType => [!super.runtimeType!];
     kind: override
-    selection: 69 17
   @override
   String toString() {
     // TODO: implement toString
-    return super.toString();
+    [!return super.toString();!]
   }
     kind: override
-    selection: 68 24
   @override
   bool operator ==(Object other) {
     // TODO: implement ==
-    return super == other;
+    [!return super == other;!]
   }
     kind: override
-    selection: 75 22
   @override
   noSuchMethod(Invocation invocation) {
     // TODO: implement noSuchMethod
-    return super.noSuchMethod(invocation);
+    [!return super.noSuchMethod(invocation);!]
   }
     kind: override
-    selection: 90 38
   _B0
     kind: class
   x0.B0
@@ -7511,35 +7491,30 @@
 suggestions
   @override
   // TODO: implement hashCode
-  int get hashCode => super.hashCode;
+  int get hashCode => [!super.hashCode!];
     kind: override
-    selection: 62 14
   @override
   // TODO: implement runtimeType
-  Type get runtimeType => super.runtimeType;
+  Type get runtimeType => [!super.runtimeType!];
     kind: override
-    selection: 69 17
   @override
   String toString() {
     // TODO: implement toString
-    return super.toString();
+    [!return super.toString();!]
   }
     kind: override
-    selection: 68 24
   @override
   bool operator ==(Object other) {
     // TODO: implement ==
-    return super == other;
+    [!return super == other;!]
   }
     kind: override
-    selection: 75 22
   @override
   noSuchMethod(Invocation invocation) {
     // TODO: implement noSuchMethod
-    return super.noSuchMethod(invocation);
+    [!return super.noSuchMethod(invocation);!]
   }
     kind: override
-    selection: 90 38
   T0
     kind: typeParameter
 ''');
diff --git a/pkg/analysis_server/test/services/completion/dart/declaration/type_member_test.dart b/pkg/analysis_server/test/services/completion/dart/declaration/type_member_test.dart
index ae3c91b..3dfb5dd 100644
--- a/pkg/analysis_server/test/services/completion/dart/declaration/type_member_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/declaration/type_member_test.dart
@@ -1338,35 +1338,30 @@
 suggestions
   @override
   // TODO: implement hashCode
-  int get hashCode => super.hashCode;
+  int get hashCode => [!super.hashCode!];
     kind: override
-    selection: 62 14
   @override
   // TODO: implement runtimeType
-  Type get runtimeType => super.runtimeType;
+  Type get runtimeType => [!super.runtimeType!];
     kind: override
-    selection: 69 17
   @override
   String toString() {
     // TODO: implement toString
-    return super.toString();
+    [!return super.toString();!]
   }
     kind: override
-    selection: 68 24
   @override
   bool operator ==(Object other) {
     // TODO: implement ==
-    return super == other;
+    [!return super == other;!]
   }
     kind: override
-    selection: 75 22
   @override
   noSuchMethod(Invocation invocation) {
     // TODO: implement noSuchMethod
-    return super.noSuchMethod(invocation);
+    [!return super.noSuchMethod(invocation);!]
   }
     kind: override
-    selection: 90 38
   _B0
     kind: class
   x0.B
@@ -3726,35 +3721,30 @@
 suggestions
   @override
   // TODO: implement hashCode
-  int get hashCode => super.hashCode;
+  int get hashCode => [!super.hashCode!];
     kind: override
-    selection: 62 14
   @override
   // TODO: implement runtimeType
-  Type get runtimeType => super.runtimeType;
+  Type get runtimeType => [!super.runtimeType!];
     kind: override
-    selection: 69 17
   @override
   String toString() {
     // TODO: implement toString
-    return super.toString();
+    [!return super.toString();!]
   }
     kind: override
-    selection: 68 24
   @override
   bool operator ==(Object other) {
     // TODO: implement ==
-    return super == other;
+    [!return super == other;!]
   }
     kind: override
-    selection: 75 22
   @override
   noSuchMethod(Invocation invocation) {
     // TODO: implement noSuchMethod
-    return super.noSuchMethod(invocation);
+    [!return super.noSuchMethod(invocation);!]
   }
     kind: override
-    selection: 90 38
   C0
     kind: class
   C1
@@ -3792,35 +3782,30 @@
 suggestions
   @override
   // TODO: implement hashCode
-  int get hashCode => super.hashCode;
+  int get hashCode => [!super.hashCode!];
     kind: override
-    selection: 62 14
   @override
   // TODO: implement runtimeType
-  Type get runtimeType => super.runtimeType;
+  Type get runtimeType => [!super.runtimeType!];
     kind: override
-    selection: 69 17
   @override
   String toString() {
     // TODO: implement toString
-    return super.toString();
+    [!return super.toString();!]
   }
     kind: override
-    selection: 68 24
   @override
   bool operator ==(Object other) {
     // TODO: implement ==
-    return super == other;
+    [!return super == other;!]
   }
     kind: override
-    selection: 75 22
   @override
   noSuchMethod(Invocation invocation) {
     // TODO: implement noSuchMethod
-    return super.noSuchMethod(invocation);
+    [!return super.noSuchMethod(invocation);!]
   }
     kind: override
-    selection: 90 38
   C0
     kind: class
   C1
diff --git a/pkg/analysis_server/test/services/completion/dart/location/argument_list_test.dart b/pkg/analysis_server/test/services/completion/dart/location/argument_list_test.dart
index d360256..274c490 100644
--- a/pkg/analysis_server/test/services/completion/dart/location/argument_list_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/location/argument_list_test.dart
@@ -265,9 +265,8 @@
 
     assertResponse(r'''
 suggestions
-  children: [],
+  children: [^],
     kind: namedArgument
-    selection: 11
 ''');
   }
 
@@ -289,9 +288,8 @@
 
     assertResponse(r'''
 suggestions
-  children: [],
+  children: [^],
     kind: namedArgument
-    selection: 11
 ''');
   }
 
@@ -360,9 +358,8 @@
 
     assertResponse(r'''
 suggestions
-  children: [],
+  children: [^],
     kind: namedArgument
-    selection: 11
 ''');
   }
 
@@ -386,9 +383,8 @@
 
     assertResponse(r'''
 suggestions
-  backgroundColor: ,
+  backgroundColor: ^,
     kind: namedArgument
-    selection: 17
 ''');
   }
 
@@ -412,9 +408,8 @@
 
     assertResponse(r'''
 suggestions
-  children: [],
+  children: [^],
     kind: namedArgument
-    selection: 11
 ''');
   }
 
@@ -437,9 +432,8 @@
 
     assertResponse(r'''
 suggestions
-  children: ,
+  children: ^,
     kind: namedArgument
-    selection: 10
 ''');
   }
 
@@ -461,9 +455,8 @@
 
     assertResponse(r'''
 suggestions
-  slivers: [],
+  slivers: [^],
     kind: namedArgument
-    selection: 10
 ''');
   }
 
@@ -547,9 +540,8 @@
 replacement
   left: 1
 suggestions
-  foo01: ,
+  foo01: ^,
     kind: namedArgument
-    selection: 7
 ''', where: where);
       },
     );
@@ -612,9 +604,8 @@
       check: (String where) {
         assertResponse(r'''
 suggestions
-  foo01: ,
+  foo01: ^,
     kind: namedArgument
-    selection: 7
 ''', where: where);
       },
     );
@@ -687,9 +678,8 @@
       check: (String where) {
         assertResponse(r'''
 suggestions
-  foo02: ,
+  foo02: ^,
     kind: namedArgument
-    selection: 7
 ''', where: where);
       },
     );
diff --git a/pkg/analysis_server/test/services/completion/dart/location/block_test.dart b/pkg/analysis_server/test/services/completion/dart/location/block_test.dart
index a8a9da8..b22100e 100644
--- a/pkg/analysis_server/test/services/completion/dart/location/block_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/location/block_test.dart
@@ -70,10 +70,9 @@
   left: 5
 suggestions
   setState(() {
-$spaces_8
+$spaces_8^
 $spaces_6});
     kind: invocation
-    selection: 22
 ''',
     );
   }
@@ -87,10 +86,9 @@
   left: 5
 suggestions
   setState(() {
-$spaces_6
+$spaces_6^
 $spaces_4});
     kind: invocation
-    selection: 20
 ''',
     );
   }
@@ -102,10 +100,9 @@
           '''
 suggestions
   setState(() {
-$spaces_6
+$spaces_6^
 $spaces_4});
     kind: invocation
-    selection: 20
 ''',
     );
   }
diff --git a/pkg/analysis_server/test/services/completion/dart/location/class_body_test.dart b/pkg/analysis_server/test/services/completion/dart/location/class_body_test.dart
index 72a31f2..c7076bc 100644
--- a/pkg/analysis_server/test/services/completion/dart/location/class_body_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/location/class_body_test.dart
@@ -29,35 +29,30 @@
 suggestions
   @override
   // TODO: implement hashCode
-  int get hashCode => super.hashCode;
+  int get hashCode => [!super.hashCode!];
     kind: override
-    selection: 62 14
   @override
   // TODO: implement runtimeType
-  Type get runtimeType => super.runtimeType;
+  Type get runtimeType => [!super.runtimeType!];
     kind: override
-    selection: 69 17
   @override
   String toString() {
     // TODO: implement toString
-    return super.toString();
+    [!return super.toString();!]
   }
     kind: override
-    selection: 68 24
   @override
   bool operator ==(Object other) {
     // TODO: implement ==
-    return super == other;
+    [!return super == other;!]
   }
     kind: override
-    selection: 75 22
   @override
   noSuchMethod(Invocation invocation) {
     // TODO: implement noSuchMethod
-    return super.noSuchMethod(invocation);
+    [!return super.noSuchMethod(invocation);!]
   }
     kind: override
-    selection: 90 38
   final
     kind: keyword
   static
@@ -93,35 +88,30 @@
 suggestions
   @override
   // TODO: implement hashCode
-  int get hashCode => super.hashCode;
+  int get hashCode => [!super.hashCode!];
     kind: override
-    selection: 62 14
   @override
   // TODO: implement runtimeType
-  Type get runtimeType => super.runtimeType;
+  Type get runtimeType => [!super.runtimeType!];
     kind: override
-    selection: 69 17
   @override
   String toString() {
     // TODO: implement toString
-    return super.toString();
+    [!return super.toString();!]
   }
     kind: override
-    selection: 68 24
   @override
   bool operator ==(Object other) {
     // TODO: implement ==
-    return super == other;
+    [!return super == other;!]
   }
     kind: override
-    selection: 75 22
   @override
   noSuchMethod(Invocation invocation) {
     // TODO: implement noSuchMethod
-    return super.noSuchMethod(invocation);
+    [!return super.noSuchMethod(invocation);!]
   }
     kind: override
-    selection: 90 38
   final
     kind: keyword
   static
@@ -157,35 +147,30 @@
 suggestions
   @override
   // TODO: implement hashCode
-  int get hashCode => super.hashCode;
+  int get hashCode => [!super.hashCode!];
     kind: override
-    selection: 62 14
   @override
   // TODO: implement runtimeType
-  Type get runtimeType => super.runtimeType;
+  Type get runtimeType => [!super.runtimeType!];
     kind: override
-    selection: 69 17
   @override
   String toString() {
     // TODO: implement toString
-    return super.toString();
+    [!return super.toString();!]
   }
     kind: override
-    selection: 68 24
   @override
   bool operator ==(Object other) {
     // TODO: implement ==
-    return super == other;
+    [!return super == other;!]
   }
     kind: override
-    selection: 75 22
   @override
   noSuchMethod(Invocation invocation) {
     // TODO: implement noSuchMethod
-    return super.noSuchMethod(invocation);
+    [!return super.noSuchMethod(invocation);!]
   }
     kind: override
-    selection: 90 38
   final
     kind: keyword
   static
@@ -221,35 +206,30 @@
 suggestions
   @override
   // TODO: implement hashCode
-  int get hashCode => super.hashCode;
+  int get hashCode => [!super.hashCode!];
     kind: override
-    selection: 62 14
   @override
   // TODO: implement runtimeType
-  Type get runtimeType => super.runtimeType;
+  Type get runtimeType => [!super.runtimeType!];
     kind: override
-    selection: 69 17
   @override
   String toString() {
     // TODO: implement toString
-    return super.toString();
+    [!return super.toString();!]
   }
     kind: override
-    selection: 68 24
   @override
   bool operator ==(Object other) {
     // TODO: implement ==
-    return super == other;
+    [!return super == other;!]
   }
     kind: override
-    selection: 75 22
   @override
   noSuchMethod(Invocation invocation) {
     // TODO: implement noSuchMethod
-    return super.noSuchMethod(invocation);
+    [!return super.noSuchMethod(invocation);!]
   }
     kind: override
-    selection: 90 38
   final
     kind: keyword
   static
@@ -300,35 +280,30 @@
 suggestions
   @override
   // TODO: implement hashCode
-  int get hashCode => super.hashCode;
+  int get hashCode => [!super.hashCode!];
     kind: override
-    selection: 62 14
   @override
   // TODO: implement runtimeType
-  Type get runtimeType => super.runtimeType;
+  Type get runtimeType => [!super.runtimeType!];
     kind: override
-    selection: 69 17
   @override
   String toString() {
     // TODO: implement toString
-    return super.toString();
+    [!return super.toString();!]
   }
     kind: override
-    selection: 68 24
   @override
   bool operator ==(Object other) {
     // TODO: implement ==
-    return super == other;
+    [!return super == other;!]
   }
     kind: override
-    selection: 75 22
   @override
   noSuchMethod(Invocation invocation) {
     // TODO: implement noSuchMethod
-    return super.noSuchMethod(invocation);
+    [!return super.noSuchMethod(invocation);!]
   }
     kind: override
-    selection: 90 38
   final
     kind: keyword
   static
@@ -699,11 +674,10 @@
   override
   void foo01() {
     // TODO: implement foo01
-    super.foo01();
+    [!super.foo01();!]
   }
     kind: override
     displayText: override foo01() { … }
-    selection: 59 14
   override
     kind: topLevelVariable
     displayText: null
@@ -754,11 +728,10 @@
   override
   void foo01() {
     // TODO: implement foo01
-    super.foo01();
+    [!super.foo01();!]
   }
     kind: override
     displayText: override foo01() { … }
-    selection: 59 14
   override
     kind: topLevelVariable
     displayText: null
@@ -783,11 +756,10 @@
   override
   void foo01() {
     // TODO: implement foo01
-    super.foo01();
+    [!super.foo01();!]
   }
     kind: override
     displayText: override foo01() { … }
-    selection: 59 14
   override
     kind: topLevelVariable
     displayText: null
@@ -841,11 +813,10 @@
   override
   void foo01() {
     // TODO: implement foo01
-    super.foo01();
+    [!super.foo01();!]
   }
     kind: override
     displayText: override foo01() { … }
-    selection: 59 14
   override
     kind: topLevelVariable
     displayText: null
@@ -871,11 +842,10 @@
   override
   void foo01() {
     // TODO: implement foo01
-    super.foo01();
+    [!super.foo01();!]
   }
     kind: override
     displayText: override foo01() { … }
-    selection: 59 14
   override
     kind: topLevelVariable
     displayText: null
@@ -907,11 +877,10 @@
   override
   bool operator ==(Object other) {
     // TODO: implement ==
-    return super == other;
+    [!return super == other;!]
   }
     kind: override
     displayText: override ==(Object other) { … }
-    selection: 74 22
   override
     kind: topLevelVariable
     displayText: null
@@ -991,11 +960,10 @@
   @override
   void foo01() {
     // TODO: implement foo01
-    super.foo01();
+    [!super.foo01();!]
   }
     kind: override
     displayText: foo01() { … }
-    selection: 60 14
 ''');
   }
 
@@ -1048,11 +1016,10 @@
   @override
   void foo01() {
     // TODO: implement foo01
-    super.foo01();
+    [!super.foo01();!]
   }
     kind: override
     displayText: foo01() { … }
-    selection: 60 14
 ''');
   }
 
@@ -1074,11 +1041,10 @@
   @override
   void foo01() {
     // TODO: implement foo01
-    super.foo01();
+    [!super.foo01();!]
   }
     kind: override
     displayText: foo01() { … }
-    selection: 60 14
 ''');
   }
 
@@ -1106,11 +1072,10 @@
   @override
   void foo01() {
     // TODO: implement foo01
-    super.foo01();
+    [!super.foo01();!]
   }
     kind: override
     displayText: foo01() { … }
-    selection: 60 14
 ''');
   }
 
@@ -1136,19 +1101,17 @@
   @override
   void foo01() {
     // TODO: implement foo01
-    super.foo01();
+    [!super.foo01();!]
   }
     kind: override
     displayText: foo01() { … }
-    selection: 60 14
   @override
   void foo02() {
     // TODO: implement foo02
-    super.foo02();
+    [!super.foo02();!]
   }
     kind: override
     displayText: foo02() { … }
-    selection: 60 14
 ''');
   }
 
@@ -1176,11 +1139,10 @@
   @override
   void foo02() {
     // TODO: implement foo02
-    super.foo02();
+    [!super.foo02();!]
   }
     kind: override
     displayText: foo02() { … }
-    selection: 60 14
 ''');
   }
 
@@ -1203,19 +1165,17 @@
   @override
   void _foo01() {
     // TODO: implement _foo01
-    super._foo01();
+    [!super._foo01();!]
   }
     kind: override
     displayText: _foo01() { … }
-    selection: 62 15
   @override
   void foo02() {
     // TODO: implement foo02
-    super.foo02();
+    [!super.foo02();!]
   }
     kind: override
     displayText: foo02() { … }
-    selection: 60 14
 ''');
   }
 
@@ -1243,11 +1203,10 @@
   @override
   FutureOr<void> foo01() {
     // TODO: implement foo01
-    return super.foo01();
+    [!return super.foo01();!]
   }
     kind: override
     displayText: foo01() { … }
-    selection: 70 21
 ''');
   }
 
@@ -1269,11 +1228,10 @@
 suggestions
   void foo01() {
     // TODO: implement foo01
-    super.foo01();
+    [!super.foo01();!]
   }
     kind: override
     displayText: foo01() { … }
-    selection: 48 14
 ''');
   }
 
@@ -1300,11 +1258,10 @@
 suggestions
   void foo01() {
     // TODO: implement foo01
-    super.foo01();
+    [!super.foo01();!]
   }
     kind: override
     displayText: foo01() { … }
-    selection: 48 14
 ''');
   }
 
@@ -1325,11 +1282,10 @@
 suggestions
   @override
   void foo01() {
-    // TODO: implement foo01
+    // TODO: implement foo01^
   }
     kind: override
     displayText: foo01() { … }
-    selection: 55
 ''');
   }
 
@@ -1351,11 +1307,10 @@
   @override
   void foo01() {
     // TODO: implement foo01
-    super.foo01();
+    [!super.foo01();!]
   }
     kind: override
     displayText: foo01() { … }
-    selection: 60 14
 ''');
   }
 
@@ -1377,11 +1332,10 @@
   @override
   void foo01(int a, int b, {int? c, int? d}) {
     // TODO: implement foo01
-    super.foo01(a, b, c: c, d: d);
+    [!super.foo01(a, b, c: c, d: d);!]
   }
     kind: override
     displayText: foo01(int a, int b, {int? c, int? d}) { … }
-    selection: 90 30
 ''');
   }
 
@@ -1403,11 +1357,10 @@
   @override
   void foo01(int a, int b) {
     // TODO: implement foo01
-    super.foo01(a, b);
+    [!super.foo01(a, b);!]
   }
     kind: override
     displayText: foo01(int a, int b) { … }
-    selection: 72 18
 ''');
   }
 
@@ -1429,11 +1382,10 @@
   @override
   bool operator ==(Object other) {
     // TODO: implement ==
-    return super == other;
+    [!return super == other;!]
   }
     kind: override
     displayText: ==(Object other) { … }
-    selection: 75 22
 ''');
   }
 
@@ -1459,11 +1411,10 @@
   @override
   int operator +(int other) {
     // TODO: implement +
-    return super + other;
+    [!return super + other;!]
   }
     kind: override
     displayText: +(int other) { … }
-    selection: 69 21
 ''');
   }
 
@@ -1505,11 +1456,10 @@
   override
   void foo01() {
     // TODO: implement foo01
-    super.foo01();
+    [!super.foo01();!]
   }
     kind: override
     displayText: override foo01() { … }
-    selection: 59 14
   override
     kind: topLevelVariable
     displayText: null
@@ -1532,11 +1482,10 @@
   @override
   void foo01() {
     // TODO: implement foo01
-    super.foo01();
+    [!super.foo01();!]
   }
     kind: override
     displayText: foo01() { … }
-    selection: 60 14
 ''');
   }
 
@@ -1558,11 +1507,10 @@
   override
   void foo01() {
     // TODO: implement foo01
-    super.foo01();
+    [!super.foo01();!]
   }
     kind: override
     displayText: override foo01() { … }
-    selection: 59 14
   override
     kind: topLevelVariable
     displayText: null
@@ -1587,11 +1535,10 @@
   @override
   void foo01() {
     // TODO: implement foo01
-    super.foo01();
+    [!super.foo01();!]
   }
     kind: override
     displayText: foo01() { … }
-    selection: 60 14
 ''');
   }
 
@@ -1615,11 +1562,10 @@
   @override
   void foo01() {
     // TODO: implement foo01
-    super.foo01();
+    [!super.foo01();!]
   }
     kind: override
     displayText: foo01() { … }
-    selection: 60 14
 ''');
   }
 
@@ -1640,11 +1586,10 @@
 suggestions
   @override
   void foo01() {
-    // TODO: implement foo01
+    // TODO: implement foo01^
   }
     kind: override
     displayText: foo01() { … }
-    selection: 55
 ''');
   }
 
@@ -1666,11 +1611,10 @@
   @override
   void foo01() {
     // TODO: implement foo01
-    super.foo01();
+    [!super.foo01();!]
   }
     kind: override
     displayText: foo01() { … }
-    selection: 60 14
 ''');
   }
 }
diff --git a/pkg/analysis_server/test/services/completion/dart/location/class_declaration_test.dart b/pkg/analysis_server/test/services/completion/dart/location/class_declaration_test.dart
index 71a3f5f..52e8532 100644
--- a/pkg/analysis_server/test/services/completion/dart/location/class_declaration_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/location/class_declaration_test.dart
@@ -136,9 +136,8 @@
 ''');
     assertResponse(r'''
 suggestions
-  Test {}
+  Test {^}
     kind: identifier
-    selection: 6
 ''');
   }
 
diff --git a/pkg/analysis_server/test/services/completion/dart/location/compilation_unit_member_test.dart b/pkg/analysis_server/test/services/completion/dart/location/compilation_unit_member_test.dart
index 069d9d6..406511c 100644
--- a/pkg/analysis_server/test/services/completion/dart/location/compilation_unit_member_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/location/compilation_unit_member_test.dart
@@ -147,12 +147,10 @@
 ''');
     assertResponse(r'''
 suggestions
-  import '';
+  import '^';
     kind: keyword
-    selection: 8
-  export '';
+  export '^';
     kind: keyword
-    selection: 8
   abstract
     kind: keyword
   base
@@ -181,12 +179,10 @@
     kind: keyword
   mixin
     kind: keyword
-  part '';
+  part '^';
     kind: keyword
-    selection: 6
-  part of '';
+  part of '^';
     kind: keyword
-    selection: 9
   sealed
     kind: keyword
   typedef
@@ -208,12 +204,10 @@
     // TODO(brianwilkerson): Should not suggest export or part directives.
     assertResponse(r'''
 suggestions
-  import '';
+  import '^';
     kind: keyword
-    selection: 8
-  export '';
+  export '^';
     kind: keyword
-    selection: 8
   abstract
     kind: keyword
   base
@@ -242,9 +236,8 @@
     kind: keyword
   mixin
     kind: keyword
-  part '';
+  part '^';
     kind: keyword
-    selection: 6
   sealed
     kind: keyword
   typedef
@@ -263,17 +256,14 @@
 ''');
     assertResponse(r'''
 suggestions
-  import '';
+  import '^';
     kind: keyword
-    selection: 8
-  export '';
+  export '^';
     kind: keyword
-    selection: 8
   library
     kind: keyword
-  part '';
+  part '^';
     kind: keyword
-    selection: 6
 ''');
   }
 
@@ -286,9 +276,8 @@
 replacement
   left: 3
 suggestions
-  import '';
+  import '^';
     kind: keyword
-    selection: 8
 ''');
   }
 
@@ -314,17 +303,14 @@
 replacement
   right: 3
 suggestions
-  import '';
+  import '^';
     kind: keyword
-    selection: 8
-  export '';
+  export '^';
     kind: keyword
-    selection: 8
   library
     kind: keyword
-  part '';
+  part '^';
     kind: keyword
-    selection: 6
 ''');
   }
 
@@ -403,12 +389,10 @@
 ''');
     assertResponse(r'''
 suggestions
-  import '';
+  import '^';
     kind: keyword
-    selection: 8
-  export '';
+  export '^';
     kind: keyword
-    selection: 8
   abstract
     kind: keyword
   base
@@ -435,9 +419,8 @@
     kind: keyword
   mixin
     kind: keyword
-  part '';
+  part '^';
     kind: keyword
-    selection: 6
   sealed
     kind: keyword
   typedef
@@ -533,27 +516,24 @@
     kind: keyword
   enum
     kind: keyword
-  export '';
+  export '^';
     kind: keyword
-    selection: 8
   extension
     kind: keyword
   external
     kind: keyword
   final
     kind: keyword
-  import '';
+  import '^';
     kind: keyword
-    selection: 8
   interface
     kind: keyword
   late
     kind: keyword
   mixin
     kind: keyword
-  part '';
+  part '^';
     kind: keyword
-    selection: 6
   sealed
     kind: keyword
   typedef
@@ -600,12 +580,10 @@
     // TODO(brianwilkerson): We should not be suggesting directives.
     assertResponse(r'''
 suggestions
-  import '';
+  import '^';
     kind: keyword
-    selection: 8
-  export '';
+  export '^';
     kind: keyword
-    selection: 8
   abstract
     kind: keyword
   base
@@ -632,9 +610,8 @@
     kind: keyword
   mixin
     kind: keyword
-  part '';
+  part '^';
     kind: keyword
-    selection: 6
   sealed
     kind: keyword
   typedef
@@ -664,17 +641,14 @@
 replacement
   right: 3
 suggestions
-  import '';
+  import '^';
     kind: keyword
-    selection: 8
-  export '';
+  export '^';
     kind: keyword
-    selection: 8
   library
     kind: keyword
-  part '';
+  part '^';
     kind: keyword
-    selection: 6
 ''');
   }
 
@@ -701,12 +675,10 @@
 ''');
     assertResponse(r'''
 suggestions
-  import '';
+  import '^';
     kind: keyword
-    selection: 8
-  export '';
+  export '^';
     kind: keyword
-    selection: 8
   abstract
     kind: keyword
   base
@@ -735,12 +707,10 @@
     kind: keyword
   mixin
     kind: keyword
-  part '';
+  part '^';
     kind: keyword
-    selection: 6
-  part of '';
+  part of '^';
     kind: keyword
-    selection: 9
   sealed
     kind: keyword
   typedef
@@ -758,12 +728,10 @@
 ''');
     assertResponse(r'''
 suggestions
-  import '';
+  import '^';
     kind: keyword
-    selection: 8
-  export '';
+  export '^';
     kind: keyword
-    selection: 8
   abstract
     kind: keyword
   base
@@ -792,12 +760,10 @@
     kind: keyword
   mixin
     kind: keyword
-  part '';
+  part '^';
     kind: keyword
-    selection: 6
-  part of '';
+  part of '^';
     kind: keyword
-    selection: 9
   sealed
     kind: keyword
   typedef
@@ -882,9 +848,8 @@
     kind: keyword
   interface
     kind: keyword
-  part of '';
+  part of '^';
     kind: keyword
-    selection: 9
   typedef
     kind: keyword
 ''');
@@ -899,9 +864,8 @@
 replacement
   left: 1
 suggestions
-  import '';
+  import '^';
     kind: keyword
-    selection: 8
   covariant
     kind: keyword
   dynamic
@@ -955,9 +919,8 @@
 replacement
   left: 3
 suggestions
-  import '';
+  import '^';
     kind: keyword
-    selection: 8
 ''');
   }
 
@@ -971,9 +934,8 @@
 replacement
   left: 3
 suggestions
-  import '';
+  import '^';
     kind: keyword
-    selection: 8
 ''');
   }
 
@@ -983,12 +945,10 @@
 ''');
     assertResponse(r'''
 suggestions
-  import '';
+  import '^';
     kind: keyword
-    selection: 8
-  export '';
+  export '^';
     kind: keyword
-    selection: 8
   abstract
     kind: keyword
   base
@@ -1017,12 +977,10 @@
     kind: keyword
   mixin
     kind: keyword
-  part '';
+  part '^';
     kind: keyword
-    selection: 6
-  part of '';
+  part of '^';
     kind: keyword
-    selection: 9
   sealed
     kind: keyword
   typedef
@@ -1059,9 +1017,8 @@
     kind: keyword
   interface
     kind: keyword
-  part of '';
+  part of '^';
     kind: keyword
-    selection: 9
   typedef
     kind: keyword
 ''');
@@ -1076,9 +1033,8 @@
 replacement
   left: 1
 suggestions
-  import '';
+  import '^';
     kind: keyword
-    selection: 8
   covariant
     kind: keyword
   dynamic
@@ -1106,9 +1062,8 @@
 replacement
   left: 1
 suggestions
-  import '';
+  import '^';
     kind: keyword
-    selection: 8
   dynamic
     kind: keyword
   enum
diff --git a/pkg/analysis_server/test/services/completion/dart/location/compilation_unit_test.dart b/pkg/analysis_server/test/services/completion/dart/location/compilation_unit_test.dart
index afef847..46f9812 100644
--- a/pkg/analysis_server/test/services/completion/dart/location/compilation_unit_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/location/compilation_unit_test.dart
@@ -38,9 +38,8 @@
 replacement
   left: 3
 suggestions
-  export '';
+  export '^';
     kind: keyword
-    selection: 8
 ''');
   }
 
@@ -52,9 +51,8 @@
 replacement
   left: 3
 suggestions
-  import '';
+  import '^';
     kind: keyword
-    selection: 8
 ''');
   }
 
@@ -66,12 +64,10 @@
 replacement
   left: 3
 suggestions
-  part '';
+  part '^';
     kind: keyword
-    selection: 6
-  part of '';
+  part of '^';
     kind: keyword
-    selection: 9
 ''');
   }
 
@@ -84,9 +80,8 @@
 replacement
   left: 3
 suggestions
-  part '';
+  part '^';
     kind: keyword
-    selection: 6
 ''');
   }
 }
diff --git a/pkg/analysis_server/test/services/completion/dart/location/enum_declaration_test.dart b/pkg/analysis_server/test/services/completion/dart/location/enum_declaration_test.dart
index a379308..ad03c75 100644
--- a/pkg/analysis_server/test/services/completion/dart/location/enum_declaration_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/location/enum_declaration_test.dart
@@ -372,9 +372,8 @@
 ''');
     assertResponse(r'''
 suggestions
-  Test {}
+  Test {^}
     kind: identifier
-    selection: 6
 ''');
   }
 
diff --git a/pkg/analysis_server/test/services/completion/dart/location/extension_type_declaration_test.dart b/pkg/analysis_server/test/services/completion/dart/location/extension_type_declaration_test.dart
index 18d6a93..5ce0146 100644
--- a/pkg/analysis_server/test/services/completion/dart/location/extension_type_declaration_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/location/extension_type_declaration_test.dart
@@ -145,9 +145,8 @@
 ''');
     assertResponse(r'''
 suggestions
-  Test {}
+  Test {^}
     kind: identifier
-    selection: 6
 ''');
   }
 
diff --git a/pkg/analysis_server/test/services/completion/dart/location/mixin_declaration_test.dart b/pkg/analysis_server/test/services/completion/dart/location/mixin_declaration_test.dart
index 79eb3cf..c73a5ec 100644
--- a/pkg/analysis_server/test/services/completion/dart/location/mixin_declaration_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/location/mixin_declaration_test.dart
@@ -62,9 +62,8 @@
 ''');
     assertResponse(r'''
 suggestions
-  Test {}
+  Test {^}
     kind: identifier
-    selection: 6
 ''');
   }
 }
diff --git a/pkg/analysis_server/test/services/completion/dart/location/record_literal_test.dart b/pkg/analysis_server/test/services/completion/dart/location/record_literal_test.dart
index c38b815..13c76d0 100644
--- a/pkg/analysis_server/test/services/completion/dart/location/record_literal_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/location/record_literal_test.dart
@@ -271,9 +271,8 @@
 replacement
   left: 3
 suggestions
-  foo01: ,
+  foo01: ^,
     kind: namedArgument
-    selection: 7
 ''');
   }