mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-112560 process only applicable mixins to a ref
This commit is contained in:
@@ -55,6 +55,7 @@ import org.jetbrains.plugins.groovy.lang.psi.impl.statements.expressions.GrRefer
|
||||
import org.jetbrains.plugins.groovy.lang.psi.impl.statements.expressions.TypesUtil;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.impl.synthetic.GrGdkMethodImpl;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.impl.synthetic.GrLightMethodBuilder;
|
||||
import org.jetbrains.plugins.groovy.lang.resolve.ResolveUtil;
|
||||
import org.jetbrains.plugins.groovy.lang.resolve.noncode.MixinMemberContributor;
|
||||
import org.jetbrains.plugins.groovy.lang.resolve.processors.ClassHint;
|
||||
import org.jetbrains.plugins.groovy.lang.resolve.processors.ResolverProcessor;
|
||||
@@ -226,7 +227,7 @@ public class GdkMethodUtil {
|
||||
|
||||
final DelegatingScopeProcessor delegate = new MixinMemberContributor.MixinProcessor(processor, subjectType, qualifier);
|
||||
for (GrMethod method : methods) {
|
||||
delegate.execute(method, ResolveState.initial());
|
||||
ResolveUtil.processElement(delegate, method, state);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -95,7 +95,7 @@ public abstract class GroovyResolveTestCase extends LightGroovyTestCase {
|
||||
final ref = configureByText(text)
|
||||
assertNotNull(ref)
|
||||
final resolved = ref.resolve()
|
||||
assertInstanceOf(resolved, type)
|
||||
if (type != null) assertInstanceOf(resolved, type)
|
||||
return resolved
|
||||
}
|
||||
|
||||
|
||||
+24
@@ -1431,6 +1431,30 @@ class _a {
|
||||
''', PsiMethod)
|
||||
}
|
||||
|
||||
void testRuntimeMixin22() {
|
||||
assertNull resolveByText('''\
|
||||
class ReentrantLock {}
|
||||
|
||||
ReentrantLock.metaClass.withLock = { nestedCode -> }
|
||||
|
||||
new ReentrantLock().withLock {
|
||||
fo<caret>o(3)
|
||||
}
|
||||
''')
|
||||
}
|
||||
|
||||
void testRuntimeMixin23() {
|
||||
assertNotNull resolveByText('''\
|
||||
class ReentrantLock {}
|
||||
|
||||
ReentrantLock.metaClass.withLock = { nestedCode -> }
|
||||
|
||||
new ReentrantLock().withLock {
|
||||
withL<caret>ock(2)
|
||||
}
|
||||
''')
|
||||
}
|
||||
|
||||
void testRunnableVsCallable() {
|
||||
final PsiMethod method = resolveByText('''\
|
||||
import java.util.concurrent.Callable
|
||||
|
||||
Reference in New Issue
Block a user