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

Unified Diff: pkg/analysis_server/lib/src/services/index/index_unit.dart

Issue 2551023005: Prepare for decoupling analyzer ASTs from element model. (Closed)
Patch Set: Address review comments 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/lib/src/services/index/index_unit.dart
diff --git a/pkg/analysis_server/lib/src/services/index/index_unit.dart b/pkg/analysis_server/lib/src/services/index/index_unit.dart
index 5a9cb479fa000cae4ad9a4bb814e3b2c85056eab..8f1ce08b4ef969d25bccf550b4478ceffde6c8a9 100644
--- a/pkg/analysis_server/lib/src/services/index/index_unit.dart
+++ b/pkg/analysis_server/lib/src/services/index/index_unit.dart
@@ -3,6 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
import 'package:analyzer/dart/ast/ast.dart';
+import 'package:analyzer/dart/ast/standard_resolution_map.dart';
import 'package:analyzer/dart/ast/token.dart';
import 'package:analyzer/dart/ast/visitor.dart';
import 'package:analyzer/dart/element/element.dart';
@@ -489,7 +490,10 @@ class _IndexContributor extends _IndexDeclarationContributor {
@override
visitClassDeclaration(ClassDeclaration node) {
if (node.extendsClause == null) {
- ClassElement objectElement = node.element.supertype?.element;
+ ClassElement objectElement = resolutionMap
+ .elementDeclaredByClassDeclaration(node)
+ .supertype
+ ?.element;
recordRelationOffset(objectElement, IndexRelationKind.IS_EXTENDED_BY,
node.name.offset, 0, true);
}

Powered by Google App Engine
This is Rietveld 408576698