OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 library analyzer.src.task.incremental_element_builder; | 5 library analyzer.src.task.incremental_element_builder; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 | 8 |
9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
10 import 'package:analyzer/dart/ast/token.dart'; | 10 import 'package:analyzer/dart/ast/token.dart'; |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 unitElementHolder.addAccessor(element); | 148 unitElementHolder.addAccessor(element); |
149 } else if (element is TopLevelVariableElement) { | 149 } else if (element is TopLevelVariableElement) { |
150 unitElementHolder.addTopLevelVariable(element); | 150 unitElementHolder.addTopLevelVariable(element); |
151 } | 151 } |
152 } | 152 } |
153 | 153 |
154 ClassElementDelta _processClassMembers( | 154 ClassElementDelta _processClassMembers( |
155 ClassDeclaration oldClass, ClassDeclaration newClass) { | 155 ClassDeclaration oldClass, ClassDeclaration newClass) { |
156 // If the class hierarchy or type parameters are changed, | 156 // If the class hierarchy or type parameters are changed, |
157 // then the class changed too much - don't compute the delta. | 157 // then the class changed too much - don't compute the delta. |
158 if (TokenUtils.getFullCode(newClass.typeParameters) != | 158 if (newClass.abstractKeyword != null && oldClass.abstractKeyword == null || |
| 159 newClass.abstractKeyword == null && oldClass.abstractKeyword != null || |
| 160 TokenUtils.getFullCode(newClass.typeParameters) != |
159 TokenUtils.getFullCode(oldClass.typeParameters) || | 161 TokenUtils.getFullCode(oldClass.typeParameters) || |
160 TokenUtils.getFullCode(newClass.extendsClause) != | 162 TokenUtils.getFullCode(newClass.extendsClause) != |
161 TokenUtils.getFullCode(oldClass.extendsClause) || | 163 TokenUtils.getFullCode(oldClass.extendsClause) || |
162 TokenUtils.getFullCode(newClass.withClause) != | 164 TokenUtils.getFullCode(newClass.withClause) != |
163 TokenUtils.getFullCode(oldClass.withClause) || | 165 TokenUtils.getFullCode(oldClass.withClause) || |
164 TokenUtils.getFullCode(newClass.implementsClause) != | 166 TokenUtils.getFullCode(newClass.implementsClause) != |
165 TokenUtils.getFullCode(oldClass.implementsClause)) { | 167 TokenUtils.getFullCode(oldClass.implementsClause)) { |
166 return null; | 168 return null; |
167 } | 169 } |
168 // Build the old class members map. | 170 // Build the old class members map. |
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
695 } | 697 } |
696 } | 698 } |
697 super.visitElement(element); | 699 super.visitElement(element); |
698 } | 700 } |
699 | 701 |
700 static bool _isVariableInitializer(Element element) { | 702 static bool _isVariableInitializer(Element element) { |
701 return element is FunctionElement && | 703 return element is FunctionElement && |
702 element.enclosingElement is VariableElement; | 704 element.enclosingElement is VariableElement; |
703 } | 705 } |
704 } | 706 } |
OLD | NEW |