Refactor: Remove context parameter from BindingContextUtils.descriptorToDeclaration utilities family

This commit is contained in:
Pavel V. Talanov
2014-07-08 18:17:04 +04:00
parent 723b3d75c9
commit d988256831
87 changed files with 225 additions and 310 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(bc, descriptor);
PsiElement declaration = BindingContextUtils.descriptorToDeclaration(descriptor);
assert declaration instanceof PsiModifierListOwner;
List<String> errors = bc.get(JavaBindingContext.LOAD_FROM_JAVA_SIGNATURE_ERRORS, descriptor);
@@ -125,7 +125,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(trace.getBindingContext(), classDescriptor);
PsiElement element = BindingContextUtils.classDescriptorToDeclaration(classDescriptor);
if (element != null && PsiSearchScopeUtil.isInScope(searchScope, element)) {
return Collections.singletonList((JetClassOrObject) element);
}