Move descriptorToDeclaration utilities family to a separate util class DescriptorToSourceUtils

This commit is contained in:
Pavel V. Talanov
2014-07-09 19:07:26 +04:00
parent 8523e18afc
commit 16aefae602
64 changed files with 250 additions and 208 deletions
@@ -117,7 +117,7 @@ public final class AnalyzerWithCompilerReport {
if (!descriptorsWithErrors.isEmpty()) {
StringBuilder message = new StringBuilder("The following Java entities have annotations with wrong Kotlin signatures:\n");
for (DeclarationDescriptor descriptor : descriptorsWithErrors) {
PsiElement declaration = BindingContextUtils.descriptorToDeclaration(descriptor);
PsiElement declaration = DescriptorToSourceUtils.descriptorToDeclaration(descriptor);
assert declaration instanceof PsiModifierListOwner;
List<String> errors = bc.get(JavaBindingContext.LOAD_FROM_JAVA_SIGNATURE_ERRORS, descriptor);
@@ -38,10 +38,7 @@ import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor;
import org.jetbrains.jet.lang.descriptors.PackageViewDescriptor;
import org.jetbrains.jet.lang.descriptors.impl.ModuleDescriptorImpl;
import org.jetbrains.jet.lang.psi.*;
import org.jetbrains.jet.lang.resolve.BindingContext;
import org.jetbrains.jet.lang.resolve.BindingContextUtils;
import org.jetbrains.jet.lang.resolve.BindingTrace;
import org.jetbrains.jet.lang.resolve.BindingTraceContext;
import org.jetbrains.jet.lang.resolve.*;
import org.jetbrains.jet.lang.resolve.java.AnalyzerFacadeForJVM;
import org.jetbrains.jet.lang.resolve.java.JvmAbi;
import org.jetbrains.jet.lang.resolve.name.FqName;
@@ -125,7 +122,7 @@ public class CliLightClassGenerationSupport extends LightClassGenerationSupport
public Collection<JetClassOrObject> findClassOrObjectDeclarations(@NotNull FqName fqName, @NotNull GlobalSearchScope searchScope) {
ClassDescriptor classDescriptor = getTrace().get(BindingContext.FQNAME_TO_CLASS_DESCRIPTOR, fqName.toUnsafe());
if (classDescriptor != null) {
PsiElement element = BindingContextUtils.classDescriptorToDeclaration(classDescriptor);
PsiElement element = DescriptorToSourceUtils.classDescriptorToDeclaration(classDescriptor);
if (element != null && PsiSearchScopeUtil.isInScope(searchScope, element)) {
return Collections.singletonList((JetClassOrObject) element);
}