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

Unified Diff: pkg/analysis_server/lib/plugin/edit/fix/fix_dart.dart

Issue 2669353002: Stop using Element.computeNode() in refactorings and fixes. (Closed)
Patch Set: documentation comments Created 3 years, 11 months 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
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/analysis_server.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/plugin/edit/fix/fix_dart.dart
diff --git a/pkg/analysis_server/lib/plugin/edit/fix/fix_dart.dart b/pkg/analysis_server/lib/plugin/edit/fix/fix_dart.dart
index 7b5d3d5970769cec40f5a947686306b5e8ccc74f..d2159d227429e29a687d30c9dbc4eb858fff0e86 100644
--- a/pkg/analysis_server/lib/plugin/edit/fix/fix_dart.dart
+++ b/pkg/analysis_server/lib/plugin/edit/fix/fix_dart.dart
@@ -13,7 +13,9 @@ import 'package:analysis_server/src/services/correction/namespace.dart'
show getExportedElement;
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/dart/element/element.dart';
+import 'package:analyzer/src/dart/analysis/ast_provider_context.dart';
import 'package:analyzer/src/dart/analysis/top_level_declaration.dart';
+import 'package:analyzer/src/dart/element/ast_provider.dart';
import 'package:analyzer/src/generated/engine.dart';
import 'package:analyzer/src/generated/source.dart';
import 'package:analyzer/src/task/dart.dart' show LIBRARY_ELEMENT4;
@@ -31,6 +33,11 @@ typedef Future<List<TopLevelDeclarationInSource>> GetTopLevelDeclarations(
*/
abstract class DartFixContext implements FixContext {
/**
+ * The provider for parsed or resolved ASTs.
+ */
+ AstProvider get astProvider;
+
+ /**
* The function to get top-level declarations from.
*/
GetTopLevelDeclarations get getTopLevelDeclarations;
@@ -65,7 +72,10 @@ abstract class DartFixContributor implements FixContributor {
return Fix.EMPTY_LIST;
}
DartFixContext dartContext = new DartFixContextImpl(
- context, _getTopLevelDeclarations(analysisContext), unit);
+ context,
+ _getTopLevelDeclarations(analysisContext),
+ new AstProviderForContext(analysisContext),
+ unit);
return internalComputeFixes(dartContext);
}
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/analysis_server.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698