mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-11 15:53:46 +00:00
Implement modules in IDE
IDE: Rewrite AnalyzerFacade and implementations for JS and JVM to support creating separate analyzers for each module Introduce ModuleInfo which is an intermediate entity between configuration (tests or idea modules) and ModuleDescriptor Implement IdeaModuleInfos which represent IDEA modules, sdks and libraries Add (somewhat thin) test checking their behaviour Implement getModuleInfo() - utility to obtain IdeaModuleInfo for PsiElement Drop Project.getLazyResolveSession() - not possible to obtain resolve session for the whole project any more Adjust JavaResolveExtension accordingly KotlinSignature Intention/Marker - make sure that analyzed element is cls element (he's not in resolve scope otherwise) LightClasses: Create separate package light classes for each module Java code can only reference light class from the first module among it's dependencies Duplicate jvm signature is only reported on package declarations inside one module Injectors: Receive GlobalSearchScope as paramer for VirtualFileFinder and JavaClassFinder which allows to narrow analyzer scope JDR: Introduce ModuleClassResolver resolves java classes in correct java descriptor resolver (corresponding ModuleDescriptor) Add test checking that java classes belong to correct module Debugger: Provide context to analyze files created by debugger in Converter: Postprocessor now needs a context to analyze resulting code in JetPsiFactory: Add verification that files created by psi factory are not analyzed without context (that is almost never a good idea) Other: Use new API in various tests, utilities, run configuration producers and builtin serializers Various "TODO: (module refactoring)" which mark the unfinished parts
This commit is contained in:
11
compiler/testData/multiModule/java/custom/a/a.kt
Normal file
11
compiler/testData/multiModule/java/custom/a/a.kt
Normal file
@@ -0,0 +1,11 @@
|
||||
package test
|
||||
|
||||
import custom.*
|
||||
|
||||
public class KotlinA: AClass() {
|
||||
fun returnA(): AClass {}
|
||||
|
||||
fun paramA(p: AClass) {}
|
||||
|
||||
AAnnotation fun annoA() {}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package custom;
|
||||
|
||||
public @interface AAnnotation {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package custom;
|
||||
|
||||
public class AClass {
|
||||
public AClass returnA() {}
|
||||
public void paramA(AClass a) {}
|
||||
@AAnnotation
|
||||
public void annoA() {}
|
||||
}
|
||||
17
compiler/testData/multiModule/java/custom/b/b.kt
Normal file
17
compiler/testData/multiModule/java/custom/b/b.kt
Normal file
@@ -0,0 +1,17 @@
|
||||
package test
|
||||
|
||||
import custom.*
|
||||
|
||||
public class KotlinB: AClass() {
|
||||
public fun returnA(): AClass {}
|
||||
|
||||
public fun paramA(a: AClass) {}
|
||||
|
||||
public fun paramB(b: BClass) {}
|
||||
|
||||
public fun returnB(): BClass { }
|
||||
|
||||
AAnnotation fun annoA() {}
|
||||
|
||||
BAnnotation fun annoB() {}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package custom;
|
||||
|
||||
public @interface BAnnotation {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package custom;
|
||||
|
||||
public class BClass extends AClass {
|
||||
public AClass returnA() {}
|
||||
public void paramA(AClass a) {}
|
||||
@AAnnotation
|
||||
public void annoA() {}
|
||||
public BClass returnB() {}
|
||||
public void paramB(BClass b) {}
|
||||
@BAnnotation
|
||||
public void annoB() {}
|
||||
}
|
||||
17
compiler/testData/multiModule/java/custom/c/c.kt
Normal file
17
compiler/testData/multiModule/java/custom/c/c.kt
Normal file
@@ -0,0 +1,17 @@
|
||||
package test
|
||||
|
||||
import custom.*
|
||||
|
||||
public class KotlinC: AClass() {
|
||||
public fun returnA(): AClass {}
|
||||
|
||||
public fun paramA(a: AClass) {}
|
||||
|
||||
public fun paramB(b: BClass) {}
|
||||
|
||||
public fun returnB(): BClass { }
|
||||
|
||||
AAnnotation fun annoA() {}
|
||||
|
||||
BAnnotation fun annoB() {}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package custom;
|
||||
|
||||
public class CClass extends BClass {
|
||||
public AClass returnA() {}
|
||||
public void paramA(AClass a) {}
|
||||
@AAnnotation
|
||||
public void annoA() {}
|
||||
public BClass returnB() {}
|
||||
public void paramB(BClass b) {}
|
||||
@BAnnotation
|
||||
public void annoB() {}
|
||||
}
|
||||
Reference in New Issue
Block a user