Commit Graph

2758 Commits

Author SHA1 Message Date
Andrey Breslav e53d1773ae Support navigation to get/set methods of a property delegate, if they are in the source code 2013-08-28 13:49:52 +04:00
Andrey Breslav ff13ba87ac Code simplified 2013-08-28 13:49:52 +04:00
Andrey Breslav 3002ac96f0 Supported converting member properties to extensions
Additionally, we now generate <selection>throw UnsupportedOperationException()</selection> when a missing body is added
2013-08-27 15:03:27 +04:00
Andrey Breslav c02f0a7d04 Intention to convert a member to an extension 2013-08-27 15:03:27 +04:00
Pavel V. Talanov e0c9328969 Remove unused DependencyClassByQualifiedNameResolver#resolveNamespace 2013-08-26 22:15:08 +04:00
Pavel V. Talanov dd0408d488 Add isCompiled property to JetFile 2013-08-26 16:00:14 +04:00
Pavel V. Talanov 0f8d50b44f Fix default visibility for class object in eager and lazy resolve 2013-08-26 16:00:13 +04:00
Alexander Udalov 85e7b87ccd Move java visibilities to JavaVisibilities class
Move related utilities to where they're used
2013-08-26 16:00:06 +04:00
Alexander Udalov 763572663e Delete almost all code related to signature writing
Delete org.jetbrains.jet.rt.signature and jet.typeinfo packages from runtime,
refactor BothSignatureWriter so that it now writes only java generic signature
and saves parameter types and kinds
2013-08-26 15:59:54 +04:00
Alexander Udalov 49604f6298 Minor, move anonymous class to private inner 2013-08-23 17:39:26 +04:00
Alexander Udalov eff99e563b Write ProtoBuf.Package to .kotlin_package
Instead of a delimited list of callables. Also some minor refactorings
2013-08-23 17:39:26 +04:00
Alexander Udalov 196b829002 Serialize packages via descriptors in codegen
Disable KotlinPackage annotation for scripts, otherwise script analyzer tries
to add descriptors to a locked scope
2013-08-23 17:39:25 +04:00
Alexander Udalov 8cbdb2924a Minor, make callback method empty, not abstract 2013-08-23 17:39:24 +04:00
Alexander Udalov 132f77d3c4 Minor, delete SerializerProvider 2013-08-23 17:39:24 +04:00
Alexander Udalov 2e3005e431 Minor, deserialized package scope is now not abstract 2013-08-23 17:39:24 +04:00
Alexander Udalov b602db03f2 DescriptorFinder now can find class names in a package
This helps to get rid of "repeated class_name" field in Package protobuf
message. DescriptorFinder in resolve.java uses PSI to find all classes in a
package, and the finder for built-ins just reads .kotlin_class_names file
2013-08-23 17:39:24 +04:00
Alexander Udalov 047ed18901 Change .kotlin_class_names format a little
Before writing a list of indexes of built-in classes' names, write the length
of such a list. It helps to read this list normally (not until an exception
happens)
2013-08-23 17:39:23 +04:00
Alexander Udalov 87d4e35388 Deserialize annotations on class properties w/o fields
Annotations on properties without backing fields are stored on a special
synthesized method inside the class
2013-08-23 17:39:21 +04:00
Alexander Udalov 453b0e8f10 Write java signature of serialized descriptors efficiently
Instead of storing a string with the signature, write the name, return type and
parameter types separately, reusing the name table. Refactor the name table to
allow it to store not only names of Kotlin entities, but also arbitrary names
and fq-names
2013-08-23 17:39:21 +04:00
Alexander Udalov cc4fd008ad Minor, rename method
'resolveAnnotations' gives a false impression that this method will resolve
annotations with their arguments, which it does not
2013-08-23 17:39:20 +04:00
Alexander Udalov b44bc620e0 Implement getNamespace() for deserialized scope
DescriptorFinder now can find packages, pull the method up from
AbstractDescriptorFinder class
2013-08-23 17:39:19 +04:00
Alexander Udalov d90b764534 Fix getting built-in classes in frontend.java
getKotlinBuiltinClassDescriptor() worked only for classes in jet.* package and
was failing for classes like jet.Map.Entry, jet.MutableMap.MutableEntry
2013-08-23 17:39:19 +04:00
Alexander Udalov 93d200be82 Minor, move byte arrays logic to ClassData/PackageData 2013-08-23 17:39:19 +04:00
Alexander Udalov e63cef0848 Deserialize annotations on package members 2013-08-23 17:39:19 +04:00
Alexander Udalov 67ca7b78c4 Deserialize annotations on class members
Make 'Callable' message of descriptors.proto extensible, extend it in
java_descriptors.proto with a JVM signature of the member. This is needed in
order for annotation deserializer to find out which member in the compiled
bytecode corresponds to which descriptor in the hierarchy.

Create a new module 'serialization.java' containing everything related to
Java-specific serialization of descriptors.

Add an extension point to DescriptorSerializer, allowing to perform
platform-specific serialization on a callable
2013-08-23 17:39:18 +04:00
Alexander Udalov 548a2853aa Create an extension point to DescriptorSerializer
Extract the existing predicate logic into it
2013-08-23 17:39:18 +04:00
Alexander Udalov 4aeeafdff0 Deserialize annotations on classes
First version, not all kinds of value arguments of annotations are supported
2013-08-23 17:39:18 +04:00
Pavel V. Talanov 9a33567287 Read KotlinInfo annotations for packages
JavaNamespaceDescriptor creates DeserializedPackageMemberScope in case there is *Package class present for a particular package (other cases work as before)
2013-08-23 17:39:17 +04:00
Alexander Udalov 011f733aad Serialize properties for objects
A new special CallableKind for properties created for objects --
OBJECT_PROPERTY.
Also fix PropertyPsiData.isFinal() in case of properties backed by fields
2013-08-23 17:39:17 +04:00
Pavel V. Talanov a57f74c278 Introduce VariableDescriptorForObject interface
Add implementations
Use this interface instead of CLASS_OBJECT_DECLARATION key in BindingContext
2013-08-23 17:39:16 +04:00
Alexander Udalov dc5bc1488c Serialize package members and class names
Write KotlinInfo annotation to the facade package class
2013-08-23 17:39:16 +04:00
Pavel V. Talanov d6d83e9bc2 Change signature of AbstractDescriptorFinder#getPackage method 2013-08-23 17:39:15 +04:00
Pavel V. Talanov c08f067df2 Straightforward logic for deserialization descriptors in DeserializedDescriptorResolver 2013-08-23 17:39:15 +04:00
Pavel V. Talanov 0aa4ba3fe6 Minor
Remove unused method
2013-08-23 17:39:15 +04:00
Pavel V. Talanov c3b1716e29 Rename ClassResolver -> DescriptorFinder
Avoid clash with JavaDescriptorResolver naming conventions
2013-08-23 17:39:15 +04:00
Pavel V. Talanov c3a44e37ba Remove various getClassId methods 2013-08-23 17:39:14 +04:00
Pavel V. Talanov fa93ee7ff2 Remove NestedClassResolver class 2013-08-23 17:39:14 +04:00
Alexander Udalov f9ad6827d4 Simplify class object naming madness
- get rid of DescriptorNamer, always use descriptor.getName() instead
- delete AbstractClassResolver.getClassObjectName(), always use
  "<class-object-for-...>", except for the case of built-ins serialization
  (class object names should be replaced by "object" when writing files with
  serialized data for built-ins)
- delete NestedClassResolver.resolveClassObject(), always use the other method
  of this class instead
2013-08-23 17:39:14 +04:00
Alexander Udalov 5db2ecd1fc Regenerate built-ins serialized data
After changes to protobuf binary format
2013-08-23 17:39:14 +04:00
Alexander Udalov 034a13350d Create enum entries for deserialized enum classes 2013-08-23 17:39:13 +04:00
Pavel V. Talanov 934be3bef5 Fix serialization of root namespace 2013-08-23 17:39:13 +04:00
Alexander Udalov c69a5aba25 Serialize/deserialize enum entries in enum classes 2013-08-23 17:39:13 +04:00
Pavel V. Talanov 04e9e953c3 Initial version of deserialization of compiled kotlin classes
Annotations are not supported
2013-08-23 17:39:12 +04:00
Alexander Udalov 83501c3722 KotlinInfo now has only one parameter data
Name table is now also stored in data, before the serialized class.
ClassData is now public, since it's used in plenty of places as a holder of
deserialized protobuf classes.
2013-08-23 17:39:12 +04:00
Alexander Udalov 4e0516472d Minor, reuse existing namer for built-ins 2013-08-23 17:39:12 +04:00
Alexander Udalov 007f3325fb Serialize property setter parameter names 2013-08-23 17:39:12 +04:00
Alexander Udalov b4ac02b175 Adapt to protobuf style guide
Identifiers consisting of multiple words should be separated by an underscore,
repeated field names should be singular
2013-08-23 17:39:11 +04:00
Alexander Udalov bdb7c1eb45 Fix property setters serialization, hasGetter->hasSetter 2013-08-23 17:39:11 +04:00
Alexander Udalov 2841238567 Don't serialize non-serializable types
If there's a private property in a class which has a type of some local
class/object, write its type as jet.Any (otherwise there's no obvious way to
construct a FQ name of such type)
2013-08-23 17:39:11 +04:00
Alexander Udalov 1acc1564d9 Add KotlinInfo annotation, serialize classes to bytecode 2013-08-23 17:39:11 +04:00