mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Don't resolve target expression to latest defs syntactically below it in the PSI (PY-7541)
Resolving to such elements may become a source of resolve loops.
This commit is contained in:
@@ -373,6 +373,11 @@ public class PyPsiUtils {
|
||||
return expression instanceof PyStringLiteralExpression ? ((PyStringLiteralExpression)expression).getStringValue() : null;
|
||||
}
|
||||
|
||||
public static boolean isBefore(@NotNull final PsiElement element, @NotNull final PsiElement element2) {
|
||||
// TODO: From RubyPsiUtil, should be moved to PsiTreeUtil
|
||||
return element.getTextOffset() <= element2.getTextOffset();
|
||||
}
|
||||
|
||||
private static abstract class TopLevelVisitor extends PyRecursiveElementVisitor {
|
||||
public void visitPyElement(final PyElement node) {
|
||||
super.visitPyElement(node);
|
||||
|
||||
Reference in New Issue
Block a user