Commit Graph

2877 Commits

Author SHA1 Message Date
Pavel V. Talanov 881a633ba0 Get rid of DescriptorSearchRule.ERROR_IF_FOUND_IN_KOTLIN
Rename other constants in DescriptorSearchRule
Inline methods with default values for DescriptorSearchRule
2013-08-26 22:07:36 +04:00
Pavel V. Talanov b634792356 Use VirtualFileFinder in AnnotationDescriptorDeserializer 2013-08-26 17:58:50 +04:00
Pavel V. Talanov 7d50a8c6ea Use VirtualFileFinder in JavaNamespaceResolver 2013-08-26 17:58:49 +04:00
Pavel V. Talanov e4988f9dba Use VirtualFileFinder in JavaClassResolver
HACK: determine whether fqname is a name for class contained in class or namespace based on virtual file name
This commit introduces code duplication which is hard to avoid without major refactoring
2013-08-26 17:58:48 +04:00
Pavel V. Talanov 52de4215b5 Introduce VirtualFileFinder interface
Provide different implementations in Cli and Ide
2013-08-26 17:58:47 +04:00
Pavel V. Talanov 4e29aad1c1 Rework invalid abi version reporting
KotlinClassFileHeader is aware of older annotations
Psi is not used to report invalid Abi version in CLI
2013-08-26 17:58:44 +04:00
Pavel V. Talanov e0e2d50143 KotlinClassFileHeader now saves JvmClassName for processed class
Add utility methods
Refactor static method to member methods
2013-08-26 16:00:15 +04:00
Alexander Udalov fb07a4c1ab Move SAM utils from MembersCache to SAMUtils 2013-08-26 16:00:09 +04:00
Alexander Udalov c5e37cc3de Move classes around in frontend.java
Move Java<->Kotlin class mapping to 'mapping' package, move method mapping to
'kotlinSignature' (and make it package local), delete unused methods
2013-08-26 16:00:08 +04:00
Alexander Udalov ea7036d808 Minor, move utilities to where they are used 2013-08-26 16:00:07 +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 e1a10eb419 Delete JavaInnerClassResolver
Move its two methods to the place where they are used
2013-08-26 16:00:05 +04:00
Alexander Udalov 86013aacde Delete PsiDeclarationProvider
And its two subclasses. Replace it by package-local MembersProvider, which is
used only in java scopes, and two factory methods (for package & for class)
2013-08-26 16:00:03 +04:00
Alexander Udalov e2d6234c9c Simplify PsiDeclarationProvider
- simplify hierarchy, now there's only two kinds of providers: for packages and
  for classes
- remove getters from providers and thus almost get rid of dependencies on them
  from the outside resolver (the only usages left are those that call
  getMembersCache)
2013-08-26 16:00:02 +04:00
Alexander Udalov d708dc6ed4 Delete JavaSemanticServices
Almost in all places only JavaDescriptorResolver was needed. The only exception
is JavaPackageScope which needs PsiClassFinder, that is now passed as a
constructor argument.

Also merge JavaPackageScopeWithoutMembers into its superclass JavaPackageScope
2013-08-26 16:00:01 +04:00
Alexander Udalov a0cbe80aca Delete JavaSemanticServices.getTypeTransformer()
Two clients can depend on JavaTypeTransformer directly instead of
JavaSemanticServices
2013-08-26 16:00:00 +04:00
Alexander Udalov dbf324667f Delete PsiDeclarationProviderFactory 2013-08-26 15:59:58 +04:00
Alexander Udalov 2d7a5ebf36 Simplify injectors for frontend.java
- delete InjectorForJavaSemanticServices, replace its usages with
  InjectorForJavaDescriptorResolver
- delete unneeded fields and parameters of InjectorForJavaDescriptorResolver
2013-08-26 15:59:57 +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 5d647cac94 Delete ScopeUtils, move its only method 2013-08-26 15:59:52 +04:00
Alexander Udalov 78bd6faffc Minor, refactor JetFilesProvider 2013-08-26 15:59:51 +04:00
Alexander Udalov 155f3b3b96 Simplify TypeVariableResolver 2013-08-26 15:59:50 +04:00
Alexander Udalov cbdc157743 Delete PsiAnnotationWrapper
Merge its logic into KotlinSignatureAnnotation, move the latter to
resolve/java/kotlinSignature, delete resolve/java/kt package
2013-08-26 15:59:49 +04:00
Alexander Udalov bd54e070bb Get rid of dependency on PsiClass from deserialized resolver 2013-08-26 15:59:48 +04:00
Alexander Udalov 8746ee2895 Report ABI errors without PsiClass 2013-08-26 15:59:46 +04:00
Alexander Udalov 19299daacd Deserialize annotations on class object properties
Class object properties' backing fields are generated into static fields of the
containing class, not into fields of class object. For fields we now store the
flag which, if set, tells that this field should be looked for in the
containing class
2013-08-26 15:59:45 +04:00
Alexander Udalov 32c5624531 Convert between byte[] and String[] efficiently 2013-08-26 15:59:44 +04:00
Pavel V. Talanov 5ea38437c2 KotlinClassFileHeader determines what kind of annotation it contains
Add some stronger assertions about class file format
2013-08-26 15:59:42 +04:00
Pavel V. Talanov a131592c70 Refactor: Extract utilities related to reading KotlinClass and KotlinPackage annotations to a separate class KotlinClassFileHeader 2013-08-26 15:59:40 +04:00
Pavel V. Talanov f77dd0bad6 Remove JetTypeJetSignatureReader 2013-08-26 15:59:37 +04:00
Pavel V. Talanov a9b57a5535 Rearrange JvmStdlibNames, delete old annotations
Delete unused constants
Move constants related to abi to JvmAbi class
Constants related to annotation names are now in JvmAnnotationNames
Remove old annotation classes
Deprecate JetClass and JetPackageClass name constants
2013-08-26 15:59:36 +04:00
Pavel V. Talanov 01735a0412 Do not write old annotations (JetClass and others) 2013-08-26 15:59:33 +04:00
Pavel V. Talanov 4fe78e4e7b Move utilities using annotations to determine whether PsiClass is kotlin class or package class to DescriptorResolverUtils
Fix some of the usages
PackageClassUtils uses more precise method name
2013-08-26 15:59:32 +04:00
Pavel V. Talanov 7c49374dab Minor: remove unused field 2013-08-26 15:59:31 +04:00
Pavel V. Talanov 9be16bf94c Remove logic in JavaPropertyResolver related to kotlin properties
Make logic in MembersCache clearer
Remove useless helper classes
2013-08-26 15:59:29 +04:00
Pavel V. Talanov f5c4075837 Remove PsiClassWrapper class 2013-08-26 15:59:28 +04:00
Pavel V. Talanov 6c02f6aba8 Remove PsiParameterWrapper class 2013-08-26 15:59:27 +04:00
Pavel V. Talanov 9a76cd8472 Remove unused classes and methods in org.jetbrains.lang.resolve.java.kt package 2013-08-26 15:59:26 +04:00
Pavel V. Talanov 33d40f8a50 Use new annotations throughout JetFromJavaDescriptorHelper
Remove rest of JetClass annotation uses
2013-08-26 15:58:07 +04:00
Pavel V. Talanov ba8732d10f Remove JvmParameterMeaning abstraction
Some code enhancements included
2013-08-23 17:39:27 +04:00
Pavel V. Talanov 1843b7bbbe Don't use DeclarationOrigin 2013-08-23 17:39:27 +04:00
Pavel V. Talanov 69295290eb Remove big chunk of code related to using old annotations 2013-08-23 17:39:27 +04:00
Alexander Udalov 3123e57aa2 Calculate annotations once for each VirtualFile 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 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 cfe9d78015 Deserialize annotations from package$src files if needed
For top-level members, we now write a FQ name of the package$src class which
has the member's annotations, and read the correct file in deserialization
2013-08-23 17:39:23 +04:00
Pavel V. Talanov 977cd7608a Split KotlinInfo annotation into two: KotlinClass and KotlinPackage
Two annotations are needed to properly distinguish package classes
2013-08-23 17:39:23 +04:00
Pavel V. Talanov 8a508fe938 Refactor: use constants instead of string literals 2013-08-23 17:39:22 +04:00
Alexander Udalov 6035d89c33 Extract field signature out of Java property signature 2013-08-23 17:39:22 +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