Remove warning and add tests when this warning had been reproducible
This commit is contained in:
+2
-8
@@ -66,14 +66,8 @@ public final class DecompiledNavigationUtils {
|
||||
if (!(psiFile instanceof JetClsFile)) {
|
||||
return null;
|
||||
}
|
||||
JetDeclaration jetDeclaration = ((JetClsFile) psiFile).getDeclarationForDescriptor(effectiveReferencedDescriptor);
|
||||
if (jetDeclaration != null) {
|
||||
return jetDeclaration;
|
||||
}
|
||||
else {
|
||||
LOG.warn("Could not find an element to navigate to for descriptor " + getFqName(effectiveReferencedDescriptor));
|
||||
}
|
||||
return null;
|
||||
|
||||
return ((JetClsFile) psiFile).getDeclarationForDescriptor(effectiveReferencedDescriptor);
|
||||
}
|
||||
|
||||
//TODO: should be done via some generic mechanism
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package inlibrary.test
|
||||
|
||||
public class FunParameter {
|
||||
fun test(p: Int) {
|
||||
val a = p
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package inlibrary.test
|
||||
|
||||
public fun topLevel(): Int {
|
||||
fun local(): Int {
|
||||
return 1
|
||||
}
|
||||
|
||||
return local()
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import inlibrary.test.*
|
||||
|
||||
val a: <caret>FunParameter? = null
|
||||
|
||||
// CONTEXT: val a = <ref-caret>p
|
||||
// WITH_LIBRARY: /resolve/referenceInLib/inLibrarySource
|
||||
|
||||
// REF: p
|
||||
@@ -0,0 +1,8 @@
|
||||
import inlibrary.test.*
|
||||
|
||||
val tl = <caret>topLevel()
|
||||
|
||||
// CONTEXT: return <ref-caret>local()
|
||||
// WITH_LIBRARY: /resolve/referenceInLib/inLibrarySource
|
||||
|
||||
// REF: .local()
|
||||
+12
@@ -47,4 +47,16 @@ public class ReferenceResolveInLibrarySourcesTestGenerated extends AbstractRefer
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/resolve/referenceInLib/inLibrarySource.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("toFunParameter.kt")
|
||||
public void testToFunParameter() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/resolve/referenceInLib/toFunParameter.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("toLocalFun.kt")
|
||||
public void testToLocalFun() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/resolve/referenceInLib/toLocalFun.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user