Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(201)

Unified Diff: pkg/analysis_server/test/services/correction/assist_test.dart

Issue 2551023005: Prepare for decoupling analyzer ASTs from element model. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;

Powered by Google App Engine
This is Rietveld 408576698