| Index: pkg/analysis_server/test/services/correction/assist_test.dart
|
| diff --git a/pkg/analysis_server/test/services/correction/assist_test.dart b/pkg/analysis_server/test/services/correction/assist_test.dart
|
| index a2abeee9b09daaec8baeb7ab63ce7cdf28baeb6b..6454cb2e7b9863480dd47033467e24a8a868ea60 100644
|
| --- a/pkg/analysis_server/test/services/correction/assist_test.dart
|
| +++ b/pkg/analysis_server/test/services/correction/assist_test.dart
|
| @@ -10,6 +10,7 @@ import 'package:analysis_server/plugin/edit/assist/assist_core.dart';
|
| import 'package:analysis_server/plugin/protocol/protocol.dart';
|
| import 'package:analysis_server/src/plugin/server_plugin.dart';
|
| import 'package:analysis_server/src/services/correction/assist.dart';
|
| +import 'package:analyzer/dart/ast/resolution_accessors.dart';
|
| import 'package:analyzer/src/generated/engine.dart';
|
| import 'package:analyzer/src/generated/source.dart';
|
| import 'package:plugin/manager.dart';
|
| @@ -64,8 +65,8 @@ class AssistProcessorTest extends AbstractSingleUnitTest {
|
| * Asserts that there is no [Assist] of the given [kind] at [offset].
|
| */
|
| assertNoAssist(AssistKind kind) async {
|
| - List<Assist> assists = await computeAssists(
|
| - plugin, context, testUnit.element.source, offset, length);
|
| + List<Assist> assists = await computeAssists(plugin, context,
|
| + elementForCompilationUnit(testUnit).source, offset, length);
|
| for (Assist assist in assists) {
|
| if (assist.kind == kind) {
|
| throw fail('Unexpected assist $kind in\n${assists.join('\n')}');
|
| @@ -2683,8 +2684,8 @@ main(p) {
|
|
|
| test_invalidSelection() async {
|
| resolveTestUnit('');
|
| - List<Assist> assists =
|
| - await computeAssists(plugin, context, testUnit.element.source, -1, 0);
|
| + List<Assist> assists = await computeAssists(
|
| + plugin, context, elementForCompilationUnit(testUnit).source, -1, 0);
|
| expect(assists, isEmpty);
|
| }
|
|
|
| @@ -4157,8 +4158,8 @@ main() {
|
| * Computes assists and verifies that there is an assist of the given kind.
|
| */
|
| Future<Assist> _assertHasAssist(AssistKind kind) async {
|
| - List<Assist> assists = await computeAssists(
|
| - plugin, context, testUnit.element.source, offset, length);
|
| + List<Assist> assists = await computeAssists(plugin, context,
|
| + elementForCompilationUnit(testUnit).source, offset, length);
|
| for (Assist assist in assists) {
|
| if (assist.kind == kind) {
|
| return assist;
|
|
|