EDU-479 Renaming variable inside a file with the same name
authorLiana Bakradze <liana.bakradze@jetbrains.com>
Wed, 22 Jun 2016 11:47:39 +0000 (14:47 +0300)
committerLiana Bakradze <liana.bakradze@jetbrains.com>
Wed, 22 Jun 2016 11:50:57 +0000 (14:50 +0300)
python/educational-python/course-creator-python/resources/META-INF/plugin.xml
python/educational-python/course-creator-python/src/com/jetbrains/edu/coursecreator/PyCCReferenceResolveProvider.java [deleted file]
python/educational-python/src/com/jetbrains/python/edu/PyEduUtils.java [deleted file]
python/educational-python/student-python/resources/META-INF/plugin.xml
python/educational-python/student-python/src/com/jetbrains/edu/learning/PyStudyReferenceResolveProvider.java [deleted file]

index e8425b2205ff696ae1b3069f895c485967131102..d107f3ec81e9b29b7c6eef9e9fdbe12ec7c5445b 100644 (file)
     <CCLanguageManager implementationClass="com.jetbrains.edu.coursecreator.PyCCLanguageManager" language="Python"/>
   </extensions>
 
-  <extensions defaultExtensionNs="Pythonid">
-    <pyReferenceResolveProvider implementation="com.jetbrains.edu.coursecreator.PyCCReferenceResolveProvider"/>
-  </extensions>
-
   <actions>
     <action class="com.jetbrains.edu.coursecreator.PyCCCreateProjectFromArchive" id="PyCC.NewEdu" text="Create New Educational Project">
       <add-to-group group-id="CCFileGroup" anchor="last"/>
diff --git a/python/educational-python/course-creator-python/src/com/jetbrains/edu/coursecreator/PyCCReferenceResolveProvider.java b/python/educational-python/course-creator-python/src/com/jetbrains/edu/coursecreator/PyCCReferenceResolveProvider.java
deleted file mode 100644 (file)
index e1bb8ee..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-package com.jetbrains.edu.coursecreator;
-
-import com.intellij.openapi.project.Project;
-import com.jetbrains.python.edu.PyEduUtils;
-import com.jetbrains.python.psi.PyQualifiedExpression;
-import com.jetbrains.python.psi.resolve.PyReferenceResolveProvider;
-import com.jetbrains.python.psi.resolve.RatedResolveResult;
-import org.jetbrains.annotations.NotNull;
-
-import java.util.Collections;
-import java.util.List;
-
-public class PyCCReferenceResolveProvider implements PyReferenceResolveProvider {
-  @NotNull
-  @Override
-  public List<RatedResolveResult> resolveName(@NotNull final PyQualifiedExpression element) {
-    Project project = element.getProject();
-    if (!CCUtils.isCourseCreator(project)) {
-      return Collections.emptyList();
-    }
-    return PyEduUtils.getResolveResultFromContainingDirectory(element);
-  }
-}
diff --git a/python/educational-python/src/com/jetbrains/python/edu/PyEduUtils.java b/python/educational-python/src/com/jetbrains/python/edu/PyEduUtils.java
deleted file mode 100644 (file)
index 65dd88c..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-package com.jetbrains.python.edu;
-
-import com.intellij.psi.PsiDirectory;
-import com.intellij.psi.PsiFile;
-import com.jetbrains.python.psi.PyQualifiedExpression;
-import com.jetbrains.python.psi.resolve.ImportedResolveResult;
-import com.jetbrains.python.psi.resolve.RatedResolveResult;
-import org.jetbrains.annotations.NotNull;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class PyEduUtils {
-  private PyEduUtils() {
-  }
-
-  public static List<RatedResolveResult> getResolveResultFromContainingDirectory(@NotNull PyQualifiedExpression element) {
-    final List<RatedResolveResult> result = new ArrayList<RatedResolveResult>();
-    final PsiFile containingFile = element.getContainingFile();
-    if (containingFile == null) return result;
-    final PsiDirectory directory = containingFile.getContainingDirectory();
-    if (directory == null) return result;
-    final String elementName = element.getName();
-    final PsiFile file = directory.findFile(elementName + ".py");
-    if (file != null) {
-      result.add(new ImportedResolveResult(file, RatedResolveResult.RATE_NORMAL, null));
-    }
-    return result;
-  }
-}
index b34c15cfe87d42fbb9bf522d89337f24cc8ccdab..3703f3927b1cd07724405631a64c510e2cf63c41 100644 (file)
@@ -26,7 +26,6 @@
   </extensions>
   <extensions defaultExtensionNs="Pythonid">
     <inspectionExtension implementation="com.jetbrains.edu.learning.highlighting.PyStudyInspectionExtension"/>
-    <pyReferenceResolveProvider implementation="com.jetbrains.edu.learning.PyStudyReferenceResolveProvider"/>
     <importResolver implementation="com.jetbrains.edu.learning.PyStudyImportResolver"/>
   </extensions>
   <extensions defaultExtensionNs="Edu">
diff --git a/python/educational-python/student-python/src/com/jetbrains/edu/learning/PyStudyReferenceResolveProvider.java b/python/educational-python/student-python/src/com/jetbrains/edu/learning/PyStudyReferenceResolveProvider.java
deleted file mode 100644 (file)
index 5145ac5..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-package com.jetbrains.edu.learning;
-
-import com.jetbrains.python.edu.PyEduUtils;
-import com.jetbrains.python.psi.PyQualifiedExpression;
-import com.jetbrains.python.psi.resolve.PyReferenceResolveProvider;
-import com.jetbrains.python.psi.resolve.RatedResolveResult;
-import org.jetbrains.annotations.NotNull;
-
-import java.util.Collections;
-import java.util.List;
-
-public class PyStudyReferenceResolveProvider implements PyReferenceResolveProvider {
-  @NotNull
-  @Override
-  public List<RatedResolveResult> resolveName(@NotNull final PyQualifiedExpression element) {
-    if (StudyTaskManager.getInstance(element.getProject()).getCourse() == null) {
-      return Collections.emptyList();
-    }
-    return PyEduUtils.getResolveResultFromContainingDirectory(element);
-  }
-}