Fixed failed assertions on navigating to 'Assertions' class of Kotlin runtime
This commit is contained in:
@@ -336,7 +336,11 @@ public class DescriptorRenderer implements Renderer<DeclarationDescriptor> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void renderVisibility(Visibility visibility, StringBuilder builder) {
|
private void renderVisibility(Visibility visibility, StringBuilder builder) {
|
||||||
builder.append(renderKeyword(visibility.toString())).append(" ");
|
if ("package".equals(visibility.toString())) {
|
||||||
|
builder.append("public/*package*/ ");
|
||||||
|
} else {
|
||||||
|
builder.append(renderKeyword(visibility.toString())).append(" ");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void renderModality(Modality modality, StringBuilder builder) {
|
private void renderModality(Modality modality, StringBuilder builder) {
|
||||||
|
|||||||
@@ -21,10 +21,7 @@ import com.intellij.psi.PsiElement;
|
|||||||
import com.intellij.psi.impl.compiled.*;
|
import com.intellij.psi.impl.compiled.*;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
import org.jetbrains.jet.lang.psi.JetClass;
|
import org.jetbrains.jet.lang.psi.*;
|
||||||
import org.jetbrains.jet.lang.psi.JetDeclaration;
|
|
||||||
import org.jetbrains.jet.lang.psi.JetFunction;
|
|
||||||
import org.jetbrains.jet.lang.psi.JetProperty;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Evgeny Gerashchenko
|
* @author Evgeny Gerashchenko
|
||||||
@@ -39,7 +36,7 @@ public class JetClsNavigationPolicy implements ClsCustomNavigationPolicy {
|
|||||||
}
|
}
|
||||||
JetClass jetClass = (JetClass) getJetDeclarationByClsElement(clsClass);
|
JetClass jetClass = (JetClass) getJetDeclarationByClsElement(clsClass);
|
||||||
if (jetClass != null) {
|
if (jetClass != null) {
|
||||||
JetClass sourceClass = JetSourceNavigationHelper.getSourceClass(jetClass);
|
JetClassOrObject sourceClass = JetSourceNavigationHelper.getSourceClass(jetClass);
|
||||||
if (sourceClass != null) {
|
if (sourceClass != null) {
|
||||||
return sourceClass;
|
return sourceClass;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ public class JetSourceNavigationHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public static JetClass getSourceClass(@NotNull JetClass decompiledClass) {
|
public static JetClassOrObject getSourceClass(@NotNull JetClass decompiledClass) {
|
||||||
Tuple2<BindingContext, ClassDescriptor> bindingContextAndClassDescriptor = getBindingContextAndClassDescriptor(decompiledClass);
|
Tuple2<BindingContext, ClassDescriptor> bindingContextAndClassDescriptor = getBindingContextAndClassDescriptor(decompiledClass);
|
||||||
if (bindingContextAndClassDescriptor == null) return null;
|
if (bindingContextAndClassDescriptor == null) return null;
|
||||||
PsiElement declaration = BindingContextUtils.classDescriptorToDeclaration(
|
PsiElement declaration = BindingContextUtils.classDescriptorToDeclaration(
|
||||||
@@ -101,7 +101,7 @@ public class JetSourceNavigationHelper {
|
|||||||
if (declaration == null) {
|
if (declaration == null) {
|
||||||
throw new IllegalStateException("class not found by " + bindingContextAndClassDescriptor._2);
|
throw new IllegalStateException("class not found by " + bindingContextAndClassDescriptor._2);
|
||||||
}
|
}
|
||||||
return (JetClass) declaration;
|
return (JetClassOrObject) declaration;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|||||||
Reference in New Issue
Block a user