mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-18 20:41:22 +07:00
Refactored API for resolving Python qualified names in roots
Rewritten it in Kotlin and transformed mutable build-style API to a more functional immutable version. It should become easier to extend the PyQualifiedNameResolveContext and the PyResolveImportUtil.resolveQualfiedName() in order to add resolve to Python stub files by default.
This commit is contained in:
committed by
Andrey Vlasovskikh
parent
7a1b4d789c
commit
f0d6fdce64
@@ -21,7 +21,7 @@ import com.intellij.psi.PsiClass;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiPackage;
|
||||
import com.intellij.psi.util.QualifiedName;
|
||||
import com.jetbrains.python.psi.resolve.QualifiedNameResolveContext;
|
||||
import com.jetbrains.python.psi.resolve.PyQualifiedNameResolveContext;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
@@ -29,7 +29,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
*/
|
||||
public class PyJavaImportResolver implements PyImportResolver {
|
||||
@Nullable
|
||||
public PsiElement resolveImportReference(QualifiedName name, QualifiedNameResolveContext context, boolean withRoots) {
|
||||
public PsiElement resolveImportReference(QualifiedName name, PyQualifiedNameResolveContext context, boolean withRoots) {
|
||||
String fqn = name.toString();
|
||||
final JavaPsiFacade psiFacade = JavaPsiFacade.getInstance(context.getProject());
|
||||
final PsiPackage aPackage = psiFacade.findPackage(fqn);
|
||||
|
||||
Reference in New Issue
Block a user