do not use old service
[idea/community.git] / python / educational-python / course-creator-python / src / com / jetbrains / edu / coursecreator / PyCCReferenceResolveProvider.java
1 package com.jetbrains.edu.coursecreator;
2
3 import com.intellij.openapi.project.Project;
4 import com.jetbrains.python.edu.PyEduUtils;
5 import com.jetbrains.python.psi.PyQualifiedExpression;
6 import com.jetbrains.python.psi.resolve.PyReferenceResolveProvider;
7 import com.jetbrains.python.psi.resolve.RatedResolveResult;
8 import org.jetbrains.annotations.NotNull;
9
10 import java.util.Collections;
11 import java.util.List;
12
13 public class PyCCReferenceResolveProvider implements PyReferenceResolveProvider {
14   @NotNull
15   @Override
16   public List<RatedResolveResult> resolveName(@NotNull final PyQualifiedExpression element) {
17     Project project = element.getProject();
18     if (!CCUtils.isCourseCreator(project)) {
19       return Collections.emptyList();
20     }
21     return PyEduUtils.getResolveResultFromContainingDirectory(element);
22   }
23 }