better naming PY-11316 Unresolved reference 'numpy.square'
authorEkaterina Tuzova <Ekaterina.Tuzova@jetbrains.com>
Tue, 24 Feb 2015 17:51:44 +0000 (20:51 +0300)
committerEkaterina Tuzova <Ekaterina.Tuzova@jetbrains.com>
Tue, 24 Feb 2015 17:51:44 +0000 (20:51 +0300)
python/src/com/jetbrains/python/psi/resolve/QualifiedNameResolverImpl.java

index 9699a8ff149818b1f310b00ab6c7c28f8461944b..8c0c38f21410818d37b4781a10e8b93d77c47ecf 100644 (file)
@@ -248,8 +248,8 @@ public class QualifiedNameResolverImpl implements RootVisitor, QualifiedNameReso
     if (!myWithoutRoots) {
       addResultsFromRoots();
     }
     if (!myWithoutRoots) {
       addResultsFromRoots();
     }
-    else if (footholdFile != null){
-      addResultsFromSkeletons(footholdFile);
+    else if (footholdFile != null) {
+      addRelativeImportResultsFromSkeletons(footholdFile);
     }
 
     mySourceResults.addAll(myLibResults);
     }
 
     mySourceResults.addAll(myLibResults);
@@ -276,7 +276,7 @@ public class QualifiedNameResolverImpl implements RootVisitor, QualifiedNameReso
   /**
    * Resolve relative imports from sdk root to the skeleton dir
    */
   /**
    * Resolve relative imports from sdk root to the skeleton dir
    */
-  private void addResultsFromSkeletons(@NotNull final PsiFile foothold) {
+  private void addRelativeImportResultsFromSkeletons(@NotNull final PsiFile foothold) {
     final boolean inSource = FileIndexFacade.getInstance(foothold.getProject()).isInContent(foothold.getVirtualFile());
     if (inSource) return;
     PsiDirectory containingDirectory = foothold.getContainingDirectory();
     final boolean inSource = FileIndexFacade.getInstance(foothold.getProject()).isInContent(foothold.getVirtualFile());
     if (inSource) return;
     PsiDirectory containingDirectory = foothold.getContainingDirectory();
@@ -284,11 +284,11 @@ public class QualifiedNameResolverImpl implements RootVisitor, QualifiedNameReso
       containingDirectory = ResolveImportUtil.stepBackFrom(foothold, myRelativeLevel);
     }
     if (containingDirectory != null) {
       containingDirectory = ResolveImportUtil.stepBackFrom(foothold, myRelativeLevel);
     }
     if (containingDirectory != null) {
-      final QualifiedName containingPath = QualifiedNameFinder.findCanonicalImportPath(containingDirectory, null);
-      if (containingPath != null && containingPath.getComponentCount() > 0) {
-        final QualifiedName absolutePath = containingPath.append(myQualifiedName.toString());
+      final QualifiedName containingQName = QualifiedNameFinder.findCanonicalImportPath(containingDirectory, null);
+      if (containingQName != null && containingQName.getComponentCount() > 0) {
+        final QualifiedName absoluteQName = containingQName.append(myQualifiedName.toString());
         final QualifiedNameResolverImpl absoluteVisitor =
         final QualifiedNameResolverImpl absoluteVisitor =
-          (QualifiedNameResolverImpl)new QualifiedNameResolverImpl(absolutePath).fromElement(foothold);
+          (QualifiedNameResolverImpl)new QualifiedNameResolverImpl(absoluteQName).fromElement(foothold);
 
         final Sdk sdk = PythonSdkType.getSdk(foothold);
         if (sdk == null) return;
 
         final Sdk sdk = PythonSdkType.getSdk(foothold);
         if (sdk == null) return;