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

Unified Diff: pkg/analyzer/lib/src/generated/incremental_resolver.dart

Issue 764493002: Incremental improvements in the matcher. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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/analyzer/test/generated/incremental_resolver_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/incremental_resolver.dart
diff --git a/pkg/analyzer/lib/src/generated/incremental_resolver.dart b/pkg/analyzer/lib/src/generated/incremental_resolver.dart
index 15797524c29b45cccb5add42ab6d93c0aca05fd7..5f0d8ab0765858b7135cdf1c180d8f3df6afee06 100644
--- a/pkg/analyzer/lib/src/generated/incremental_resolver.dart
+++ b/pkg/analyzer/lib/src/generated/incremental_resolver.dart
@@ -279,6 +279,9 @@ class DeclarationMatcher extends RecursiveAstVisitor {
node.parameters.parameters.length == 0) {
name = "unary-";
}
+ if (node.isSetter) {
+ name += '=';
+ }
// prepare element
Token property = node.propertyKeyword;
ExecutableElement element;
@@ -441,15 +444,20 @@ class DeclarationMatcher extends RecursiveAstVisitor {
if (type == null) {
return _assertTrue(false);
}
+ // prepare name
+ Identifier nameIdentifier = node.name;
+ if (nameIdentifier is PrefixedIdentifier) {
+ nameIdentifier = (nameIdentifier as PrefixedIdentifier).identifier;
+ }
+ String nodeName = nameIdentifier.name;
// check specific type kinds
- String nodeName = node.name.name;
if (type is InterfaceType) {
_assertEquals(nodeName, type.name);
// check arguments
TypeArgumentList nodeArgumentList = node.typeArguments;
List<DartType> typeArguments = type.typeArguments;
if (nodeArgumentList == null) {
- // Node doesn't have type arguments, so all type argument of the
+ // Node doesn't have type arguments, so all type arguments of the
// element must be "dynamic".
for (DartType typeArgument in typeArguments) {
_assertTrue(typeArgument.isDynamic);
@@ -698,6 +706,8 @@ class IncrementalResolver {
// If we are replacing the whole declaration (e.g. rename a parameter), we
// can try to find the corresponding Element in the enclosing one, see if it
// is compatible, and if 'yes', then restore and update it.
+ // TODO(scheglov) This should be rewritten. It causes validating the whole
+ // class, when just one method is changed.
if (node is Declaration) {
node = node.parent;
}
@@ -914,6 +924,8 @@ class PoorMansIncrementalResolver {
return false;
}
}
+// print('oldNode: $oldNode');
+// print('newNode: $newNode');
// prepare update range
_updateOffset = oldNode.offset;
_updateEndOld = oldNode.end;
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/incremental_resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698