Chromium Code Reviews| Index: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/index/IndexContributor.java |
| diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/index/IndexContributor.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/index/IndexContributor.java |
| index f8abed5ae7f7dd94a2c16f0c31237a0cb9e84f84..5c024b4bd2d1fb5ad71e5d663f61ab12910e783a 100644 |
| --- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/index/IndexContributor.java |
| +++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/index/IndexContributor.java |
| @@ -110,7 +110,8 @@ public class IndexContributor extends GeneralizingASTVisitor<Void> { |
| if (node.getParent() instanceof PrefixedIdentifier) { |
| PrefixedIdentifier propertyAccess = (PrefixedIdentifier) node.getParent(); |
| SimpleIdentifier qualifier = propertyAccess.getPrefix(); |
| - if (qualifier instanceof SimpleIdentifier && qualifier.getElement() instanceof LibraryElement) { |
| + if (qualifier instanceof SimpleIdentifier |
| + && qualifier.getStaticElement() instanceof LibraryElement) { |
| return qualifier.getName(); |
| } |
| } |
| @@ -374,7 +375,7 @@ public class IndexContributor extends GeneralizingASTVisitor<Void> { |
| @Override |
| public Void visitConstructorName(ConstructorName node) { |
| - ConstructorElement element = node.getElement(); |
| + ConstructorElement element = node.getStaticElement(); |
| Location location; |
| if (node.getName() != null) { |
| int start = node.getPeriod().getOffset(); |
| @@ -441,7 +442,7 @@ public class IndexContributor extends GeneralizingASTVisitor<Void> { |
| @Override |
| public Void visitMethodInvocation(MethodInvocation node) { |
| SimpleIdentifier name = node.getMethodName(); |
| - Element element = name.getElement(); |
| + Element element = name.getStaticElement(); |
|
scheglov
2013/08/19 21:47:02
getBestElement()
Brian Wilkerson
2013/08/20 18:22:38
Done
|
| if (element instanceof MethodElement) { |
| Location location = createLocation(name); |
| Relationship relationship; |
| @@ -484,7 +485,7 @@ public class IndexContributor extends GeneralizingASTVisitor<Void> { |
| return null; |
| } |
| // prepare information |
| - Element element = node.getElement(); |
| + Element element = node.getStaticElement(); |
|
scheglov
2013/08/19 21:47:02
getBestElement()
Brian Wilkerson
2013/08/20 18:22:38
Done
|
| // qualified name reference |
| recordQualifiedMemberReference(node, element, nameElement, location); |
| // stop if already handled |
| @@ -532,7 +533,7 @@ public class IndexContributor extends GeneralizingASTVisitor<Void> { |
| @Override |
| public Void visitSuperConstructorInvocation(SuperConstructorInvocation node) { |
| - ConstructorElement element = node.getElement(); |
| + ConstructorElement element = node.getStaticElement(); |
| Location location; |
| if (node.getConstructorName() != null) { |
| int start = node.getPeriod().getOffset(); |
| @@ -656,7 +657,7 @@ public class IndexContributor extends GeneralizingASTVisitor<Void> { |
| private boolean isAlreadyHandledName(SimpleIdentifier node) { |
| ASTNode parent = node.getParent(); |
| if (parent instanceof MethodInvocation) { |
| - Element element = node.getElement(); |
| + Element element = node.getStaticElement(); |
| if (element instanceof MethodElement || element instanceof FunctionElement) { |
| return ((MethodInvocation) parent).getMethodName() == node; |
| } |
| @@ -678,7 +679,7 @@ public class IndexContributor extends GeneralizingASTVisitor<Void> { |
| * top-level element and not qualified with import prefix. |
| */ |
| private void recordImportElementReferenceWithoutPrefix(SimpleIdentifier node) { |
| - Element element = node.getElement(); |
| + Element element = node.getStaticElement(); |
| if (element != null && element.getEnclosingElement() instanceof CompilationUnitElement |
| && !isIdentifierInPrefixedIdentifier(node)) { |
| LibraryElement importLibraryElement = element.getLibrary(); |
| @@ -738,7 +739,7 @@ public class IndexContributor extends GeneralizingASTVisitor<Void> { |
| if (superNode != null) { |
| Identifier superName = superNode.getName(); |
| if (superName != null) { |
| - Element superElement = superName.getElement(); |
| + Element superElement = superName.getStaticElement(); |
| recordRelationship(superElement, relationship, createLocation(superNode)); |
| } |
| } |