Commit Graph

1409 Commits

Author SHA1 Message Date
Alexander Udalov b0cb4c330f Don't try to read binary data from a non-class file
Fixes EA-59470, where a virtual file is checked to be a compiled Kotlin class
from the decompiler (which doesn't check its FileType)
2014-08-27 14:07:24 +04:00
Pavel V. Talanov b749beb5fa Fix AnalyzerFacadeForJvm reference in GenerateInjectors 2014-08-23 12:46:31 +04:00
Pavel V. Talanov 7a1d5d63dc Rename: AnalyzerFacadeForJvm(Js) -> TopDownAnalyzerFacadeForJvm(Js) 2014-08-22 23:16:55 +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
Evgeny Gerashchenko 6dd56a08bd Removed storing module ids in incremental caches. 2014-08-20 13:46:28 +04:00
Evgeny Gerashchenko e419c1a604 Moved incremental cache API to separate package. 2014-08-20 13:46:27 +04:00
Evgeny Gerashchenko 5fade9a5a6 Made incremental cache per-module.
Reused IDEA framework which manages per-module storage.
2014-08-20 13:46:26 +04:00
Pavel V. Talanov 09d3ddfcae Introduce VirtualFileFinderFactory
Allow creation of VirtualFileFinder with restricted scope
2014-08-15 15:22:19 +04:00
Pavel V. Talanov bc6c56080d Rewrite VirtualFileKotlinClassFinder to Kotlin 2014-08-15 15:22:16 +04:00
Pavel V. Talanov 15028b76ef Always provide not null project in scope for JavaClassFinderImpl 2014-08-15 15:22:14 +04:00
Pavel V. Talanov 6588310736 Add missing public modifiers in project code 2014-08-12 21:13:46 +04:00
zarechenskiy 34bf3d7f0e Supress warnings in injectors using "all" parameter, not "ALL"
This parameter value supports by IDEA and Eclipse
2014-08-12 13:11:21 +04:00
Pavel V. Talanov b02d4b0669 Utilities to resolve Java methods and fields 2014-08-08 19:50:56 +04:00
Pavel V. Talanov 8496c535aa Replace ModuleDescriptorImpl implementation
Change the way modules are configured:
Add dependencies on other modules instead of adding additional package fragment providers
Refactor related code
Drop DependencyKind
Hide common new module creation in CliLightClassGenerationSupport
2014-07-31 21:25:49 +04:00
Alexander Udalov de0f751207 Replace object$ -> OBJECT$, instance$ -> INSTANCE$ in the project 2014-07-26 00:21:05 +04:00
Evgeny Gerashchenko 7e6b05554e Always closing IncrementalCache after using. Fixed KannotatorJpsTest. 2014-07-22 21:18:16 +04:00
Alexander Udalov 540b87a1dc Support object array annotation arguments in deserialization 2014-07-19 02:13:26 +04:00
Alexander Udalov 65c21561a4 Fix super constructor calls of anonymous objects and local classes
If a class inherits from another class which captures something (outer class
instance, receiver parameter, local variables, etc.), the constructor of the
former class should contain all the parameters of the super constructor as its
own parameters, so that it could make a proper super call. All such parameters
are now replicated in the derived constructor with kind = SUPER_CALL_PARAM,
except an instance of the outer class (kind = OUTER), which can be taken from
the derived's own OUTER when it has one, to prevent multiple passing of the
same argument.

Previously it worked only when inheriting from inner classes via a special hack
(ConstructorFrameMap).

Also reuse recently introduced ArgumentGenerator to automatically take care of
default and vararg arguments of super constructor

 #KT-3581 Fixed
 #KT-5342 Fixed
 #KT-5343 Fixed
2014-07-18 16:26:46 +04:00
Alexander Udalov b85a672052 Minor, combine ENUM_NAME and ENUM_ORDINAL parameter kinds 2014-07-18 16:26:42 +04:00
Pavel V. Talanov 7269e383cf Rewrite JetPsiFactory to kotlin, make project a property
Instead of passing to every function
All static methods are now member functions
2014-07-15 16:41:12 +04:00
Pavel V. Talanov ab07aea82f Fix an NPE in VirtualFileKotlinClassFinder#findKotlinClass(JavaClass)
Happens for nonphysical PsiClass
2014-07-10 14:08:14 +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
Svetlana Isakova 02f5293b3d Added CallCompleter component
Regenerated injectors
2014-07-08 14:48:15 +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
Pavel V. Talanov 0f5de48157 Drop JetFilesProvider service 2014-07-03 20:46:51 +04:00
Pavel V. Talanov 0a43c38bae Change AnalyzerFacade#createSetup to accept a list of synthetic files and a scope for physical source files
Make DeclarationProviderFactory a project service
2014-07-03 20:46:50 +04:00
Pavel V. Talanov 9b5f349e61 Drop JetFilesProvider#allPackageFiles() and sampleToAllFilesInModule() 2014-07-03 20:46:47 +04:00
Pavel V. Talanov b2c3a7d501 Rename: DescriptorDeserializersStorage -> DescriptorLoadersStorage 2014-07-03 20:46:45 +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
Pavel V. Talanov 0c8956a36e Refactor: DescriptorFinder -> ClassDataFinder
Deserialization subsystem only need to know about the way to obtain class data, it can construct descriptors itself (no need to call DeserializedClassDescriptor constructor from other modules)
2014-07-03 20:46:41 +04:00
Pavel V. Talanov 245919d691 Use module to resolve annotation classes in AnnotationDescriptorLoader 2014-07-03 20:46:36 +04:00
Pavel V. Talanov 7ee7047753 Deserializer: use module to search for dependencies in TypeDeserializer 2014-07-03 20:46:33 +04:00
Nikolay Krasko 465dd45eae Merge remote-tracking branch 'origin/master' into idea14 2014-07-02 09:21:40 +04:00
Alexander Udalov a38a396a43 Remove default import "kotlin.reflect"
Basic reflection is usable without any imports (with :: literals)

This reverts commit 9503056dd5.
2014-07-02 01:55:53 +04:00
Alexander Udalov d32a02f21a Modify top-level/extension property hierarchy
- rename KTopLevelProperty to KTopLevelVariable
- create KTopLevelExtensionProperty, a subclass of KExtensionProperty
- create KTopLevelProperty, a superclass of KTopLevelVariable and
  KTopLevelExtensionProperty. (In the future, it will have a container of type
  KPackage.)
2014-07-02 01:55:53 +04:00
Alexander Udalov f73b8b9ff8 Extract KForeignMemberProperty out of KMemberPropertyImpl
KClassImpl is now able to create a property by the name, according to its
origin
2014-07-02 01:55:52 +04:00
Alexander Udalov c17f515d06 Construct reflection objects via static factory methods
JVM back-end now generates invocations of these methods instead of
KClass/K*Property/... constructors for two reasons:

1. It occupies less space in the bytecode
2. We can (to some degree) alter the implementation of the factory methods
   without changing the ABI compatibility version
2014-07-02 01:26:20 +04:00
Alexander Udalov 5ab83aad8a Support references to extension properties in JVM codegen
#KT-1183 In Progress
2014-07-02 01:26:19 +04:00
Alexander Udalov 461cce103b Support references to top level and member properties in JVM codegen
#KT-1183 In Progress
2014-07-02 01:26:19 +04:00
Alexander Udalov 59777e7df6 Generate "$kotlinClass"/"$kotlinPackage" reflection fields to every class
Some seemingly irrelevant tests were changed because now there's <clinit> in
almost every class and class initialization begins with executing it
2014-07-02 01:26:18 +04:00
Nikolay Krasko e7a1cba1eb Merge remote-tracking branch 'origin/master' into idea14
Conflicts:
	update_dependencies.xml
2014-06-27 14:44:05 +04:00
Alexander Udalov eb11a7dc88 Move utilities out of runtime modules
DescriptorUtils & DescriptorSubstitutor contained a lot of utilities that were
used only in compiler & IDE. Move them closer to their usages
2014-06-26 22:02:59 +04:00
Nikolay Krasko a0e45e9a12 Merge master into idea14
Conflicts:
	.idea/runConfigurations/All_Tests.xml
	idea/src/org/jetbrains/jet/plugin/conversion/copy/ConvertJavaCopyPastePostProcessor.kt
	idea/tests/org/jetbrains/jet/plugin/refactoring/introduce/introduceVariable/AbstractJetExtractionTest.kt
	idea/tests/org/jetbrains/jet/shortenRefs/AbstractShortenRefsTest.kt
2014-06-25 16:26:01 +04:00
zarechenskiy 0355b1bd53 Implement JavaTypeSubstitutor without PSI 2014-06-24 20:06:13 +04:00
Andrey Breslav cd28b216c1 Rename. INSTANCE -> DEFAULT in JetTypeChecker 2014-06-24 19:13:01 +04:00
Nikolay Krasko b09788c626 Idea 138: Avoid using auto-generated parameters names in Kotlin 2014-06-20 17:14:32 +04:00
Andrey Breslav f229301a0f More informative diagnostic messages for ACCIDENTAL_OVERRIDES and CONFLICTING_JVM_DECLARATIONS
#KT-1 In Progress
2014-06-19 22:10:55 +04:00
Andrey Breslav 27f76630e6 ACCIDENTAL_OVERRIDE diagnostics supported
#KT-1 In Progress
2014-06-19 22:10:55 +04:00