com.intellij.psi.PsiElementcom.jetbrains.python.psi.resolve.RatedResolveResult



Project JetBrains/intellij-community in file ...on.inspections.PyCallingNonCallableInspection.java (2011-05-23)
@@ -2,7 +2,6 @@ package com.jetbrains.python.inspections;
 
 import com.intellij.codeInspection.LocalInspectionToolSession;
 import com.intellij.codeInspection.ProblemsHolder;
-import com.intellij.psi.PsiElement;
 import com.intellij.psi.PsiElementVisitor;
 import com.jetbrains.python.psi.AccessDirection;
 import com.jetbrains.python.psi.PyCallExpression;
@@ -10,6 +9,7 @@ import com.jetbrains.python.psi.PyClass;
 import com.jetbrains.python.psi.PyExpression;
 import com.jetbrains.python.psi.impl.PyBuiltinCache;
 import com.jetbrains.python.psi.resolve.PyResolveContext;
+import com.jetbrains.python.psi.resolve.RatedResolveResult;
 import com.jetbrains.python.psi.types.PyClassType;
 import com.jetbrains.python.psi.types.PyType;
 import org.jetbrains.annotations.Nls;
@@ -51,8 +51,8 @@ public class PyCallingNonCallableInspection extends PyInspection {
             return;
           }
           if (!classType.isDefinition()) {
-            final List<? extends PsiElement> calls = classType.resolveMember("__call__", null, AccessDirection.READ,
-                                                                             PyResolveContext.defaultContext().withTypeEvalContext(myTypeEvalContext));
+            final List<? extends RatedResolveResult> calls = classType.resolveMember("__call__", null, AccessDirection.READ,
+                                                                                     PyResolveContext.defaultContext().withTypeEvalContext(myTypeEvalContext));
             if (calls == null || calls.size() == 0) {
               PyClass pyClass = classType.getPyClass();
               if (pyClass != null) {
Project JetBrains/intellij-community in file ...src.com.jetbrains.python.psi.types.PyNoneType.java (2011-05-23)
@@ -1,11 +1,11 @@
 package com.jetbrains.python.psi.types;
 
-import com.intellij.psi.PsiElement;
 import com.intellij.util.ArrayUtil;
 import com.intellij.util.ProcessingContext;
 import com.jetbrains.python.psi.AccessDirection;
 import com.jetbrains.python.psi.PyExpression;
 import com.jetbrains.python.psi.resolve.PyResolveContext;
+import com.jetbrains.python.psi.resolve.RatedResolveResult;
 import org.jetbrains.annotations.Nullable;
 
 import java.util.List;
@@ -20,10 +20,10 @@ public class PyNoneType implements PyType { // TODO must extend ClassType. It's
   }
 
   @Nullable
-  public List<? extends PsiElement> resolveMember(final String name,
-                                                  PyExpression location,
-                                                  AccessDirection direction,
-                                                  PyResolveContext resolveContext) {
+  public List<? extends RatedResolveResult> resolveMember(final String name,
+                                                          PyExpression location,
+                                                          AccessDirection direction,
+                                                          PyResolveContext resolveContext) {
     return null;
   }
 
Project JetBrains/intellij-community in file ...hon.src.com.jetbrains.python.psi.types.PyType.java (2011-05-23)
@@ -1,11 +1,11 @@
 package com.jetbrains.python.psi.types;
 
 import com.intellij.openapi.util.Key;
-import com.intellij.psi.PsiElement;
 import com.intellij.util.ProcessingContext;
 import com.jetbrains.python.psi.AccessDirection;
 import com.jetbrains.python.psi.PyExpression;
 import com.jetbrains.python.psi.resolve.PyResolveContext;
+import com.jetbrains.python.psi.resolve.RatedResolveResult;
 import org.jetbrains.annotations.Nullable;
 
 import java.util.List;
@@ -24,20 +24,21 @@ public interface PyType {
    *
    * @param name      attribute name
    * @param location  the expression of type qualifierType on which the member is being resolved (optional)
-    *@param direction
-   * @param resolveContext   @return null if name definitely cannot be found (e.g. in a qualified reference),
+   * @param direction
+   * @param resolveContext
+   * @return null if name definitely cannot be found (e.g. in a qualified reference),
    *         or an empty list if name is not found but other contexts are worth looking at,
    *         or a list of elements that define the name, a la multiResolve().
    */
   @Nullable
-  List<? extends PsiElement> resolveMember(final String name, @Nullable PyExpression location, AccessDirection direction,
-                                           PyResolveContext resolveContext);
+  List<? extends RatedResolveResult> resolveMember(final String name, @Nullable PyExpression location, AccessDirection direction,
+                                                   PyResolveContext resolveContext);
 
   /**
    * Proposes completion variants from type's attributes.
    *
-   * @param referenceExpression which is to be completed
-   * @param context             to share state between nested invocations
+   * @param location   the reference on which the completion was invoked
+   * @param context    to share state between nested invocations
    * @return completion variants good for {@link com.intellij.psi.PsiReference#getVariants} return value.
    */
   Object[] getCompletionVariants(String completionPrefix, PyExpression location, ProcessingContext context);
Project JetBrains/intellij-community in file ...etbrains.python.psi.types.PyTypeReferenceImpl.java (2011-05-23)
@@ -1,11 +1,11 @@
 package com.jetbrains.python.psi.types;
 
-import com.intellij.psi.PsiElement;
 import com.intellij.util.ArrayUtil;
 import com.intellij.util.ProcessingContext;
 import com.jetbrains.python.psi.AccessDirection;
 import com.jetbrains.python.psi.PyExpression;
 import com.jetbrains.python.psi.resolve.PyResolveContext;
+import com.jetbrains.python.psi.resolve.RatedResolveResult;
 import org.jetbrains.annotations.NotNull;
 
 import java.util.Collections;
@@ -16,10 +16,10 @@ import java.util.List;
  */
 public abstract class PyTypeReferenceImpl implements PyTypeReference {
   @NotNull
-  public List<? extends PsiElement> resolveMember(String name,
-                                                  PyExpression location,
-                                                  AccessDirection direction,
-                                                  PyResolveContext resolveContext) {
+  public List<? extends RatedResolveResult> resolveMember(String name,
+                                                          PyExpression location,
+                                                          AccessDirection direction,
+                                                          PyResolveContext resolveContext) {
     return Collections.emptyList();
   }
 
Project JetBrains/intellij-community in file ...rc.com.jetbrains.python.psi.types.PyUnionType.java (2011-05-23)
@@ -1,13 +1,13 @@
 package com.jetbrains.python.psi.types;
 
 import com.intellij.openapi.util.text.StringUtil;
-import com.intellij.psi.PsiElement;
 import com.intellij.util.NullableFunction;
 import com.intellij.util.ProcessingContext;
 import com.intellij.util.SmartList;
 import com.jetbrains.python.psi.AccessDirection;
 import com.jetbrains.python.psi.PyExpression;
 import com.jetbrains.python.psi.resolve.PyResolveContext;
+import com.jetbrains.python.psi.resolve.RatedResolveResult;
 import org.jetbrains.annotations.Nullable;
 
 import java.util.*;
@@ -23,15 +23,15 @@ public class PyUnionType implements PyType {
   }
 
   @Nullable
-  public List<? extends PsiElement> resolveMember(String name,
-                                                  PyExpression location,
-                                                  AccessDirection direction,
-                                                  PyResolveContext resolveContext) {
-    SmartList<PsiElement> ret = new SmartList<PsiElement>();
+  public List<? extends RatedResolveResult> resolveMember(String name,
+                                                          PyExpression location,
+                                                          AccessDirection direction,
+                                                          PyResolveContext resolveContext) {
+    SmartList<RatedResolveResult> ret = new SmartList<RatedResolveResult>();
     boolean all_nulls = true;
     for (PyType member : myMembers) {
       if (member != null) {
-        List<? extends PsiElement> result = member.resolveMember(name, null, direction, resolveContext);
+        List<? extends RatedResolveResult> result = member.resolveMember(name, null, direction, resolveContext);
         if (result != null) {
           all_nulls = false;
           ret.addAll(result);