mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fix possible SOE in multi-ile resolve
This commit is contained in:
@@ -101,6 +101,7 @@ public class PyResolveUtil {
|
||||
|
||||
@Nullable
|
||||
public static PsiElement getPrevNodeOf(PsiElement elt, PsiScopeProcessor proc) {
|
||||
if (elt instanceof PsiFile) return null; // no sense to get the previous node of a file
|
||||
if (proc instanceof PyClassScopeProcessor) {
|
||||
return getPrevNodeOf(elt, ((PyClassScopeProcessor)proc).getPossibleTargets());
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
from tornado.options import define
|
||||
|
||||
define()
|
||||
# <ref>
|
||||
@@ -134,6 +134,10 @@ public class PyMultiFileResolveTest extends PyLightFixtureTestCase {
|
||||
assertEquals("Context", ((PyClass) element).getName());
|
||||
}
|
||||
|
||||
public void testStackOverflowOnEmptyFile() throws Exception {
|
||||
assertNull(doResolve()); // make sure we don't have a SOE here
|
||||
}
|
||||
|
||||
private PsiFile prepareFile() throws Exception {
|
||||
String testName = getTestName(true);
|
||||
String fileName = getTestName(false) + ".py";
|
||||
|
||||
Reference in New Issue
Block a user