| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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.generated.incremental_resolver; | 5 library analyzer.src.generated.incremental_resolver; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 import 'dart:math' as math; | 8 import 'dart:math' as math; |
| 9 | 9 |
| 10 import 'package:analyzer/dart/ast/ast.dart'; | 10 import 'package:analyzer/dart/ast/ast.dart'; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 // A body change delta should never leak outside its source. | 70 // A body change delta should never leak outside its source. |
| 71 // It can cause invalidation of results (e.g. hints) in other sources, | 71 // It can cause invalidation of results (e.g. hints) in other sources, |
| 72 // but only when a result in the updated source is INVALIDATE_NO_DELTA. | 72 // but only when a result in the updated source is INVALIDATE_NO_DELTA. |
| 73 if (target.source != source) { | 73 if (target.source != source) { |
| 74 return DeltaResult.STOP; | 74 return DeltaResult.STOP; |
| 75 } | 75 } |
| 76 // don't invalidate results of standard Dart tasks | 76 // don't invalidate results of standard Dart tasks |
| 77 bool isByTask(TaskDescriptor taskDescriptor) { | 77 bool isByTask(TaskDescriptor taskDescriptor) { |
| 78 return taskDescriptor.results.contains(descriptor); | 78 return taskDescriptor.results.contains(descriptor); |
| 79 } | 79 } |
| 80 |
| 80 if (descriptor == CONTENT) { | 81 if (descriptor == CONTENT) { |
| 81 return DeltaResult.KEEP_CONTINUE; | 82 return DeltaResult.KEEP_CONTINUE; |
| 82 } | 83 } |
| 83 if (target is LibrarySpecificUnit && target.unit != source) { | 84 if (target is LibrarySpecificUnit && target.unit != source) { |
| 84 if (isByTask(GatherUsedLocalElementsTask.DESCRIPTOR) || | 85 if (isByTask(GatherUsedLocalElementsTask.DESCRIPTOR) || |
| 85 isByTask(GatherUsedImportedElementsTask.DESCRIPTOR)) { | 86 isByTask(GatherUsedImportedElementsTask.DESCRIPTOR)) { |
| 86 return DeltaResult.KEEP_CONTINUE; | 87 return DeltaResult.KEEP_CONTINUE; |
| 87 } | 88 } |
| 88 } | 89 } |
| 89 if (isByTask(BuildCompilationUnitElementTask.DESCRIPTOR) || | 90 if (isByTask(BuildCompilationUnitElementTask.DESCRIPTOR) || |
| (...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 802 AstNode parent = newComment.parent; | 803 AstNode parent = newComment.parent; |
| 803 if (parent is AnnotatedNode) { | 804 if (parent is AnnotatedNode) { |
| 804 setElementDocumentationForVariables(VariableDeclarationList list) { | 805 setElementDocumentationForVariables(VariableDeclarationList list) { |
| 805 for (VariableDeclaration variable in list.variables) { | 806 for (VariableDeclaration variable in list.variables) { |
| 806 Element variableElement = variable.element; | 807 Element variableElement = variable.element; |
| 807 if (variableElement is ElementImpl) { | 808 if (variableElement is ElementImpl) { |
| 808 setElementDocumentationComment(variableElement, parent); | 809 setElementDocumentationComment(variableElement, parent); |
| 809 } | 810 } |
| 810 } | 811 } |
| 811 } | 812 } |
| 813 |
| 812 Element parentElement = ElementLocator.locate(newComment.parent); | 814 Element parentElement = ElementLocator.locate(newComment.parent); |
| 813 if (parentElement is ElementImpl) { | 815 if (parentElement is ElementImpl) { |
| 814 setElementDocumentationComment(parentElement, parent); | 816 setElementDocumentationComment(parentElement, parent); |
| 815 } else if (parent is FieldDeclaration) { | 817 } else if (parent is FieldDeclaration) { |
| 816 setElementDocumentationForVariables(parent.fields); | 818 setElementDocumentationForVariables(parent.fields); |
| 817 } else if (parent is TopLevelVariableDeclaration) { | 819 } else if (parent is TopLevelVariableDeclaration) { |
| 818 setElementDocumentationForVariables(parent.variables); | 820 setElementDocumentationForVariables(parent.variables); |
| 819 } | 821 } |
| 820 } | 822 } |
| 821 } | 823 } |
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1320 @override | 1322 @override |
| 1321 String toString() => name; | 1323 String toString() => name; |
| 1322 } | 1324 } |
| 1323 | 1325 |
| 1324 class _TokenPair { | 1326 class _TokenPair { |
| 1325 final _TokenDifferenceKind kind; | 1327 final _TokenDifferenceKind kind; |
| 1326 final Token oldToken; | 1328 final Token oldToken; |
| 1327 final Token newToken; | 1329 final Token newToken; |
| 1328 _TokenPair(this.kind, this.oldToken, this.newToken); | 1330 _TokenPair(this.kind, this.oldToken, this.newToken); |
| 1329 } | 1331 } |
| OLD | NEW |