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

Side by Side Diff: pkg/analyzer/lib/src/dart/analysis/index.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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'package:analyzer/dart/ast/ast.dart'; 5 import 'package:analyzer/dart/ast/ast.dart';
6 import 'package:analyzer/dart/ast/resolution_accessors.dart';
6 import 'package:analyzer/dart/ast/token.dart'; 7 import 'package:analyzer/dart/ast/token.dart';
7 import 'package:analyzer/dart/ast/visitor.dart'; 8 import 'package:analyzer/dart/ast/visitor.dart';
8 import 'package:analyzer/dart/element/element.dart'; 9 import 'package:analyzer/dart/element/element.dart';
9 import 'package:analyzer/dart/element/type.dart'; 10 import 'package:analyzer/dart/element/type.dart';
10 import 'package:analyzer/src/dart/element/member.dart'; 11 import 'package:analyzer/src/dart/element/member.dart';
11 import 'package:analyzer/src/generated/utilities_dart.dart'; 12 import 'package:analyzer/src/generated/utilities_dart.dart';
12 import 'package:analyzer/src/summary/format.dart' 13 import 'package:analyzer/src/summary/format.dart'
13 show AnalysisDriverUnitIndexBuilder; 14 show AnalysisDriverUnitIndexBuilder;
14 import 'package:analyzer/src/summary/idl.dart'; 15 import 'package:analyzer/src/summary/idl.dart';
15 16
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 499
499 @override 500 @override
500 visitBinaryExpression(BinaryExpression node) { 501 visitBinaryExpression(BinaryExpression node) {
501 recordOperatorReference(node.operator, node.bestElement); 502 recordOperatorReference(node.operator, node.bestElement);
502 super.visitBinaryExpression(node); 503 super.visitBinaryExpression(node);
503 } 504 }
504 505
505 @override 506 @override
506 visitClassDeclaration(ClassDeclaration node) { 507 visitClassDeclaration(ClassDeclaration node) {
507 if (node.extendsClause == null) { 508 if (node.extendsClause == null) {
508 ClassElement objectElement = node.element.supertype?.element; 509 ClassElement objectElement =
510 elementForClassDeclaration(node).supertype?.element;
509 recordRelationOffset(objectElement, IndexRelationKind.IS_EXTENDED_BY, 511 recordRelationOffset(objectElement, IndexRelationKind.IS_EXTENDED_BY,
510 node.name.offset, 0, true); 512 node.name.offset, 0, true);
511 } 513 }
512 recordIsAncestorOf(node.element); 514 recordIsAncestorOf(node.element);
513 super.visitClassDeclaration(node); 515 super.visitClassDeclaration(node);
514 } 516 }
515 517
516 @override 518 @override
517 visitClassTypeAlias(ClassTypeAlias node) { 519 visitClassTypeAlias(ClassTypeAlias node) {
518 recordIsAncestorOf(node.element); 520 recordIsAncestorOf(node.element);
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
799 final String value; 801 final String value;
800 802
801 /** 803 /**
802 * The unique id of the string. It is set after indexing of the whole 804 * The unique id of the string. It is set after indexing of the whole
803 * package is done and we are assembling the full package index. 805 * package is done and we are assembling the full package index.
804 */ 806 */
805 int id; 807 int id;
806 808
807 _StringInfo(this.value); 809 _StringInfo(this.value);
808 } 810 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698