Place light classes finder before standard PsiElementFinderImpl

Source elements should have priority over libraries.

Original commit: 3c7e7ffda6
This commit is contained in:
Nikolay Krasko
2015-05-08 16:22:27 +03:00
parent 1937ee3986
commit 395e5446fb
9 changed files with 95 additions and 0 deletions
@@ -431,6 +431,20 @@ public class KotlinJpsBuildTest extends AbstractKotlinJpsBuildTestCase {
result.assertSuccessful();
}
public void testDependencyToOldKotlinLib() throws IOException {
initProject();
File libraryJar = MockLibraryUtil.compileLibraryToJar(
workDir.getAbsolutePath() + File.separator + "oldModuleLib/src", "module-lib", false);
addDependency(JpsJavaDependencyScope.COMPILE, Lists.newArrayList(findModule("module")), false, "module-lib", libraryJar);
addKotlinRuntimeDependency();
BuildResult result = makeAll();
result.assertSuccessful();
}
private void createKotlinJavaScriptLibraryArchive() {
File jarFile = new File(workDir, KOTLIN_JS_LIBRARY_JAR);
try {
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<option name="DEFAULT_COMPILER" value="Javac" />
<resourceExtensions />
<annotationProcessing>
<profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" />
</profile>
</annotationProcessing>
</component>
<component name="CopyrightManager" default="">
<module2copyright />
</component>
<component name="DependencyValidationManager">
<option name="SKIP_IMPORT_STATEMENTS" value="false" />
</component>
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/module/module.iml" filepath="$PROJECT_DIR$/module/module.iml" />
</modules>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="IDEA_JDK" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="" />
</component>
</project>
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="xUTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="jdk" jdkName="IDEA_JDK" jdkType="JavaSDK" />
<orderEntry type="module" module-name="module2" />
</component>
</module>
@@ -0,0 +1,6 @@
package module
public trait A {
fun oldFun(): Int = 1
fun newFun(): Int = 42
}
@@ -0,0 +1,9 @@
package module
public class B(private val c: C) {
fun foo() {
val a = c.getA()
a.oldFun()
a.newFun()
}
}
@@ -0,0 +1,5 @@
package module;
public interface C {
A getA();
}
@@ -0,0 +1,5 @@
package module
public trait A {
fun oldFun(): Int = 1
}
@@ -0,0 +1,8 @@
package module
public class B(private val c: C) {
fun foo() {
val a = c.getA()
a.oldFun()
}
}
@@ -0,0 +1,5 @@
package module;
public interface C {
A getA();
}