mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
don't resolve script methods in classes defined in the same file.
This commit is contained in:
@@ -124,7 +124,9 @@ public class GroovyFileImpl extends GroovyFileBaseImpl implements GroovyFile {
|
||||
|
||||
PsiClass scriptClass = getScriptClass();
|
||||
if (scriptClass != null) {
|
||||
if (!scriptClass.processDeclarations(processor, state, lastParent, place)) return false;
|
||||
if (!(lastParent instanceof GrTypeDefinition)) {
|
||||
if (!scriptClass.processDeclarations(processor, state, lastParent, place)) return false;
|
||||
}
|
||||
if (!ResolveUtil.processElement(processor, scriptClass, state)) return false;
|
||||
}
|
||||
|
||||
|
||||
+13
@@ -825,4 +825,17 @@ def test() {
|
||||
assertTrue parameters.length == 1
|
||||
assertEquals "java.lang.Object", parameters[0].type.canonicalText
|
||||
}
|
||||
|
||||
public void testScriptMethodsInClass() {
|
||||
def ref = configureByText('''
|
||||
class X {
|
||||
def foo() {
|
||||
scriptMetho<caret>d('1')
|
||||
}
|
||||
}
|
||||
def scriptMethod(String s){}
|
||||
''')
|
||||
|
||||
assertNull(ref.resolve())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user