Commit Graph

428 Commits

Author SHA1 Message Date
Alexander Udalov 7595e32bb6 Use ClassId instead of JvmClassName in KotlinJvmBinaryClass
ClassId contains exact information about origin of the class (e.g. if '$' in
the class name denotes nested classes separator or just a character in the
name)
2014-09-15 19:30:51 +04:00
Alexander Udalov e3b01f073f Replace FqName by ClassId where possible in Java resolver 2014-09-15 19:30:51 +04:00
Alexander Udalov a8c5f1bb3a Drop KotlinClassFinder#findKotlinClass(FqName)
findKotlinClass(ClassId) should be used instead
2014-09-15 19:30:50 +04:00
Alexander Udalov 422e922c36 Make JavaClassFinder accept ClassId rather than FqName
ClassId has more information about the name which will be very useful when
implementing JavaClassFinder in reflection
2014-09-15 19:30:50 +04:00
Alexander Udalov e9ae06a53e Straighten out MemberIndex calculation in LazyJavaStaticScope
Also delete confusing "inn" function
2014-09-15 19:30:50 +04:00
Alexander Udalov 0cb7c08a7a Minor, delete unneeded underscores from parameter names 2014-09-15 19:30:50 +04:00
Alexander Udalov bc1d59a538 Add KotlinClassFinder#findKotlinClass(ClassId)
Will be used to load nested classes correctly at runtime
2014-09-15 19:30:50 +04:00
Alexander Udalov c854b1d713 Unextend JavaAnnotationArgumentImpl from JavaElementImpl 2014-09-15 19:30:49 +04:00
Alexander Udalov 4c51368244 Rewrite JavaAnnotationArgument interfaces and implementations to Kotlin 2014-09-15 19:30:49 +04:00
Alexander Udalov ec02382976 Assert that reference annotation argument is always an enum value
Rename JavaReferenceAnnotationArgument on that occasion to
JavaEnumValueAnnotationArgument. Also add a test on a nested enum annotation
argument
2014-09-15 19:30:49 +04:00
Alexander Udalov 2f12875515 Extract "values" and "valueOf" names as static constants 2014-09-09 20:42:38 +04:00
Alexander Udalov 4bd603818a Drop LazyJavaDescriptor, JavaPackageFragmentDescriptor 2014-09-09 20:42:38 +04:00
Alexander Udalov 148d583212 Drop JavaPackageFragmentProvider 2014-09-09 20:42:38 +04:00
Alexander Udalov b52f337f7f Drop enum class object hack
Place valueOf() and values() into the static scope of the corresponding enum
class

 #KT-5580 Fixed
 #KT-2410 Fixed
2014-09-09 20:42:37 +04:00
Alexander Udalov 8ccca1781d Support static class scope in frontend, JVM codegen and IDE 2014-09-09 20:42:36 +04:00
Alexander Udalov 76986f850f Drop outdated code in JDR related to static class members 2014-09-09 20:42:36 +04:00
Alexander Udalov bcfb5f3b09 Rewrite Java resolve to use static class scope instead of synthesized packages
#KT-4149 Fixed
 #KT-4839 Fixed
2014-09-09 20:42:36 +04:00
Alexander Udalov 75df4a9ad8 Introduce ClassDescriptor#getStaticScope()
Will be used to exterminate hacks related to static Java methods in our
codebase: synthetic class object for enum, synthetic package for static members
of Java classes, etc.
2014-09-09 20:42:35 +04:00
Pavel V. Talanov 5dc5862134 Add missing public to ModuleClassResolver 2014-08-23 12:52:27 +04:00
Pavel V. Talanov 46f1873dc8 JDR: drop various code that is marked as temporary
Remove additional logic for comparing files in JavaClassFinderImpl
Drop redundant check for builtins in findClassInJava(FqName)
Drop resolve cache query in LazyJavaClassMemberScope and LazyJavaPackageFragmentScope
2014-08-22 22:59:07 +04:00
Pavel V. Talanov db5303c019 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
2014-08-22 22:58:54 +04:00
Pavel V. Talanov 92b29a8fe7 Rewrite KotlinClassFinder to Kotlin 2014-08-15 15:22:15 +04:00
Alexander Udalov 4ff6a627d0 Get rid of isConstructorOfStaticNestedClass()
This value can always be computed in ConstructorDescriptorImpl#initialize
2014-08-13 15:13:23 +04:00
Pavel V. Talanov 6588310736 Add missing public modifiers in project code 2014-08-12 21:13:46 +04:00
Pavel V. Talanov a5a493d145 Minor: remove obsolete JAVA_ROOT 2014-08-08 19:50:58 +04:00
Pavel V. Talanov b02d4b0669 Utilities to resolve Java methods and fields 2014-08-08 19:50:56 +04:00
Pavel V. Talanov 1488584acf Rewrite JavaDescriptorResolver to Kotlin 2014-08-08 19:50:55 +04:00
Andrey Breslav 1de3ba9265 Minor. JavaDescriptorResolver renamed to .kt to preserve history 2014-08-08 19:50:53 +04:00
Alexey Sedunov 311166737f Associate synthetic component function descriptors with corresponding
constructor parameters
2014-08-08 18:59:45 +04:00
Alexander Udalov de0f751207 Replace object$ -> OBJECT$, instance$ -> INSTANCE$ in the project 2014-07-26 00:21:05 +04:00
Alexander Udalov 93fa7cb330 Increase ABI version
Related changes include:
- kotlin.Unit is now a named object
- "instance$" was renamed to "INSTANCE$"
- "object$" was renamed to "OBJECT$"
- Intrinsics#stupidSync() was dropped
2014-07-25 21:34:12 +04:00
Alexander Udalov fb958897a9 Introduce kotlin.Cloneable
- Cloneable is a trait with a single protected member 'clone', which is mapped
  to java.lang.Cloneable on JVM
- 'clone' is non-abstract to be able to call 'super.clone()' in the
  implementations. Also if you need your class to be Cloneable, most of the
  time inheriting from Cloneable and calling 'super.clone()' will work
- hack 'super.clone()' in JVM intrinsics and TImpl delegation generation
- make arrays Cloneable, handle 'clone()' calls in the intrinsic

 #KT-4890 Fixed
2014-07-25 21:19:39 +04:00
Alexander Udalov a79398fa00 Don't load Object as a supertype for Java classes
#KT-4890 In Progress
 #KT-5002 Fixed
2014-07-25 21:19:37 +04:00
Alexander Udalov 485f63e1cd Rename object$ -> OBJECT$, instance$ -> INSTANCE$
According to Java code conventions, public static final constants should be
named with all capital letters
2014-07-25 21:15:13 +04:00
Zalim Bashorov a811de9bbd Minor: Unit.VALUE -> Unit in Java code. 2014-07-25 21:03:10 +04:00
Alexander Udalov 540b87a1dc Support object array annotation arguments in deserialization 2014-07-19 02:13:26 +04:00
Denis Zharkov d604b5de79 Added wrappers classes names to JvmPrimitiveType 2014-07-15 21:23:51 +04:00
Pavel V. Talanov 8523e18afc Set source elements for java annotation parameters 2014-07-09 18:19:40 +04:00
Pavel V. Talanov 930ea88e25 Set source elements for java enum entries
#KT-4277 Fixed
2014-07-09 18:19:39 +04:00
Pavel V. Talanov 4188bbe53c Set source elements for java parameters 2014-07-09 18:19:38 +04:00
Pavel V. Talanov 8b91855fac Drop SynthesizedCallableMemberDescriptor 2014-07-09 18:19:37 +04:00
Pavel V. Talanov 59e43020c3 Initial version of storing SourceElements in descriptors
Introduce SourceElement, JavaSourceElementFactory, DeclarationDescriptorWithSource
Implement getSource() for eager, lazy and java descriptors
2014-07-09 18:19:34 +04:00
Andrey Breslav e3b1639edf KT-5425 Kotlin plugin crashes when project uses RxJava 17.0 or older
#KT-5425 Fixed
2014-07-09 16:10:41 +04:00
Alexander Udalov b9fd52739f Move around some descriptor implementations
- mutable class, mutable package fragment and their dependencies go to module
  'frontend'
- ModuleDescriptorImpl and PackageFragmentDescriptorImpl are moved to the
  package "impl" in their module
2014-07-07 18:15:31 +04:00
Alexander Udalov de21f76e10 Introduce EnumClassObjectDescriptor
Extract the duplicate logic in deserialization and descriptor.loader.java
2014-07-07 18:15:27 +04:00
Evgeny Gerashchenko 6501066274 Added hacky checks for accessing compiled functions from our module via package part instead of facade.
#KT-4590 fixed
2014-07-07 17:41:34 +04:00
Pavel V. Talanov b2c3a7d501 Rename: DescriptorDeserializersStorage -> DescriptorLoadersStorage 2014-07-03 20:46:45 +04:00
Pavel V. Talanov b08cda8dd6 Avoid recomputing ClassData in DeserializedDescriptorResolver 2014-07-03 20:46:44 +04:00
Pavel V. Talanov e7d6ea6be5 Remove hack in JavaClassDataFinder 2014-07-03 20:46:43 +04:00
Pavel V. Talanov 123523d1dc Drop ClassDataFinder#getClassNames() 2014-07-03 20:46:42 +04:00