Do not build light classes for decompiled enum entries
This commit is contained in:
+4
-1
@@ -223,6 +223,9 @@ public class IDELightClassGenerationSupport extends LightClassGenerationSupport
|
||||
|
||||
@Nullable
|
||||
private static PsiClass getLightClassForDecompiledClassOrObject(@NotNull JetClassOrObject decompiledClassOrObject) {
|
||||
if (decompiledClassOrObject instanceof JetEnumEntry) {
|
||||
return null;
|
||||
}
|
||||
JetFile containingJetFile = decompiledClassOrObject.getContainingJetFile();
|
||||
if (!containingJetFile.isCompiled()) {
|
||||
return null;
|
||||
@@ -248,7 +251,7 @@ public class IDELightClassGenerationSupport extends LightClassGenerationSupport
|
||||
while (iterator.hasNext()) {
|
||||
Name name = iterator.next();
|
||||
PsiClass innerClass = current.findInnerClassByName(name.asString(), false);
|
||||
assert innerClass != null : "Could not find corresponding inner/nested class " + relativeFqName + "in class " + decompiledClassOrObject.getName() + "\n" +
|
||||
assert innerClass != null : "Could not find corresponding inner/nested class " + relativeFqName + " in class " + decompiledClassOrObject.getFqName() + "\n" +
|
||||
"File: " + decompiledClassOrObject.getContainingJetFile().getVirtualFile().getName();
|
||||
current = innerClass;
|
||||
}
|
||||
|
||||
@@ -69,4 +69,9 @@ fun test() {
|
||||
}
|
||||
|
||||
LocalClass(localClassProperty = 1).localClassProperty
|
||||
}
|
||||
|
||||
enum class E {
|
||||
ONE,
|
||||
TWO
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// PSI_ELEMENT: org.jetbrains.kotlin.psi.JetEnumEntry
|
||||
// FIND_BY_REF
|
||||
|
||||
package usages
|
||||
|
||||
import library.E
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
E.<caret>ONE
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
Value read (9: 7) E.ONE
|
||||
+6
@@ -100,6 +100,12 @@ public class KotlinFindUsagesWithLibraryTestGenerated extends AbstractKotlinFind
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("LibraryEnumEntryUsages.0.kt")
|
||||
public void testLibraryEnumEntryUsages() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/findUsages/libraryUsages/kotlinLibrary/LibraryEnumEntryUsages.0.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("LibraryFunctionUsages.0.kt")
|
||||
public void testLibraryFunctionUsages() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/findUsages/libraryUsages/kotlinLibrary/LibraryFunctionUsages.0.kt");
|
||||
|
||||
Reference in New Issue
Block a user