Commit Graph

11775 Commits

Author SHA1 Message Date
Alexander Udalov cc45cf2a4e Rename JavaSignatureResolver to TypeParameterResolver
Also rename 'parameterResolver' field to 'valueParameterResolver'
2013-09-04 21:55:02 +04:00
Alexander Udalov 944d1fc59e Refactor JavaSignatureResolver
Now it has the only method returning Initializer, an object which can be told
to initialize resolved descriptors later, or to obtain these descriptors.
Delete useless methods, combine the remaining ones
2013-09-04 21:55:02 +04:00
Alexander Udalov a1f3a56c25 Refactor TypeVariableResolver
Delete 'context' field which was used only for debugging
2013-09-04 21:55:02 +04:00
Alexander Udalov 04516376c0 Migrate SAMUtils from PSI to JavaElement
- create JavaTypeSubstitutor as a mirror for PsiSubstitutor
- copy-paste MethodSignatureUtil.areSignaturesErasureEqual() and migrate it to
  JavaTypeSubstitutor
- use a pair of method and substitutor instead of
  'MethodSignatureBackedByPsiMethod'
- add JavaClass.getDefaultType() which goes into JavaPsiFacade and creates an
  unsubstituted PsiClassType for the class
- green code

The only PSI usage left is TypeConversionUtil.erasure(), which needs to be
copied and migrated somehow
2013-09-04 21:55:02 +04:00
Alexander Udalov a3d9d4fe66 Move classes around in java-specific parts of compiler
- move JetClsMethod and JetJavaMirrorMarker to 'jetAsJava' package
- move JetClsMethodImpl out of 'wrappers' packages
- move TypeVariableResolver to 'resolver' package, make it package-local
- move MembersCache and NamedMembers to 'scope', make the former package-local
2013-09-04 21:55:02 +04:00
Alexander Udalov c18615f704 Rename JavaCompileTimeConstResolver to AnnotationArgumentResolver 2013-09-04 21:55:02 +04:00
Alexander Udalov f98a949fdd Migrate JavaAnnotationResolver from PSI to JavaElement
Create a bunch of annotation argument classes, which serve as wrappers over
PsiAnnotationMemberValue class, but also have a Name
2013-09-04 21:55:02 +04:00
Alexander Udalov 7b945c2313 Migrate JavaTypeTransformer from PsiType to JavaType
Add more wrapper methods to JavaClassifierType.

Inline the utility method adjustTypeUsageWithMutabilityAnnotations to the two
places where it was used. Also add JavaAnnotationOwner and change signature of
JavaAnnotationResolver to take JavaAnnotationOwner, not PSI
2013-09-04 21:55:01 +04:00
Alexander Udalov 732378d837 Rename JavaClassType to JavaClassifierType 2013-09-04 21:55:01 +04:00
Alexander Udalov c1d40f1e15 Introduce JavaClassifier
JavaClassifier is a common type for JavaClass and JavaTypeParameter. In almost
all of the places JavaClass remains to be JavaClass, except for the resolution
result of JavaClassType, which can be a type parameter. Add an assertion that
JavaClass is created only for a class and not for a type parameter. Delete
different creations of JavaClass in 'idea' (where there can be a type
parameter) by changing the interface of util functions.

Delete JavaModifierListOwnerImpl, extract its methods into JavaElementUtil and
use these implementations for every JavaModifierListOwner

Continue refactoring JavaTypeTransformer to work with JavaType, not PsiType
2013-09-04 21:55:01 +04:00
Alexander Udalov 787d8a5234 Refactor JavaTypeTransformer and ValueParameterResolver
Use an instanceof-chain on a JavaType instance instead of PsiTypeVisitor in
TypeTransformer. Add a special method to handle vararg types, use it in
ValueParameterResolver
2013-09-04 21:55:01 +04:00
Alexander Udalov f669771b7e Introduce JavaType and subclasses
Use JavaType instead of PsiType whenever possible.

In this commit the logic of checking whether a loaded parameter is a vararg
changed: instead of checking if the corresponding PsiType is PsiEllipsisType we
now check if the containing method has the ACC_VARARG modifier
2013-09-04 21:55:01 +04:00
Alexander Udalov 998e598846 Refactor JavaConstructorResolver
Extract methods, fix warnings, use JavaClass/JavaMethod instead of Psi
2013-09-04 21:55:01 +04:00
Alexander Udalov 62868421cf Minor, green code & move type transformer to "resolver/" 2013-09-04 21:55:01 +04:00
Alexander Udalov 78f9cb7203 Get rid of PsiMemberWrapper
Continue migration, use the new Java* classes instead everywhere
2013-09-04 21:55:01 +04:00
Alexander Udalov 245b9d1ab1 Minor, change method parameter from String to JvmClassName 2013-09-04 21:55:00 +04:00
Alexander Udalov 55af245867 Migrate JavaClassResolver from PSI to JavaClass
Several places are still left and need special handling.  The overall behavior
of the resolver should not change in this commit (except for maybe different
small operations like creating names, fq-names, ...)
2013-09-04 21:55:00 +04:00
Alexander Udalov de54f7d732 JavaClass, JavaPackage, JavaAnnotation
Create dumb wrappers over PSI elements, will be used for loading descriptors
from JVM reflection later (instead of PSI)
2013-09-04 21:55:00 +04:00
Alexander Udalov eaacff4566 Remove RuntimeHandleClassesMode
There were two usages of RuntimeHandleClassesMode.REPORT_ERROR: first in tests,
where it never occurred, second in JavaClassResolver, where it's now inlined
2013-09-04 21:55:00 +04:00
Alexander Udalov 4eb9f28312 Remove useless PsiClass parameter
It was used only for a debug message and an assertion that never happened
2013-09-04 21:55:00 +04:00
Alexander Udalov cc81d12b55 Remove useless methods from PsiClassFinder
Their only implementations called methods on a parameter + a utility. Move the
utility to DescriptorResolverUtils
2013-09-04 21:55:00 +04:00
Alexander Udalov 175a598e6d Delete JavaBaseScope.getPsiElement() 2013-09-04 21:55:00 +04:00
Nikolay Krasko d399465bf3 Override omitting parentheses on tab char if they are already placed 2013-09-04 20:45:18 +04:00
Nikolay Krasko cb10c53040 Sample testing in kotlin
CompletionHandlerTest.java -> CompletionHandlerTest.kt
2013-09-04 20:45:17 +04:00
Nikolay Krasko ba0c9892d6 Rewrite JetFunctionInsertHandler at kotlin
JetFunctionInsertHandler.kt is a replacement for
JetFunctionInsertHandler.java
2013-09-04 20:45:17 +04:00
Nikolay Krasko b958963cbc Remove file for getting compiler for bootstrap 2013-09-04 16:27:30 +04:00
Nikolay Krasko b819c2c342 Remove outdated groovy formatting options 2013-09-04 16:27:15 +04:00
Andrey Breslav db2b19c50f Support filtering diagnostics in tests 2013-09-04 13:07:25 +04:00
Nikolay Krasko f89841a4ef Merge pull request #302 from sayon/indents
Better autoformatting
2013-09-03 23:58:18 -07:00
Alexander Udalov 723d5ef564 Fix default argument method calls
In some cases, calls of methods with default arguments were invoked via the
actual generated method, not via the "...$default" accessor
2013-09-03 22:26:05 +04:00
Svetlana Isakova 329d724c1e fixed compilation 2013-09-03 21:33:42 +04:00
sayon a3bfd25825 Formatter: now always adds space between reference expression and function literal. Test is included.
#KT-3932 fixed
2013-09-03 21:06:22 +04:00
sayon a0500f56d2 New setting and test: space before lambda arrow
#KT-3932 fixed
2013-09-03 21:05:17 +04:00
sayon 523a5bf6a9 New setting and test: space around arrow in function types 2013-09-03 21:04:22 +04:00
sayon 965265b8b8 Formatting: omit blank lines between 'when' and left brace. Test is included. 2013-09-03 21:03:17 +04:00
sayon f8b280ba57 New setting and test: space around arrow inside 'when' 2013-09-03 20:59:56 +04:00
sayon ec31808dcd A bigger code example for codestyle provider 2013-09-03 20:58:58 +04:00
Svetlana Isakova a53eae79b5 bug fixed: analyze arguments in FREE expression position 2013-09-03 19:56:20 +04:00
Svetlana Isakova b5e6568726 bug fixed: do not substitute type parameters twice
through final argument check
2013-09-03 19:50:00 +04:00
Svetlana Isakova a49dcc0dd4 analyze when entry in independent context 2013-09-03 17:05:21 +04:00
Alexey Sedunov 7357add55c Implement search of derived Kotlin classes/traits and Java classes/interfaces 2013-09-03 14:26:34 +04:00
Alexey Sedunov a7e46a4ba7 Implement search of class members usages 2013-09-03 14:26:33 +04:00
Alexey Sedunov b2d1f8d323 Add separate search of constructor usages 2013-09-03 14:26:32 +04:00
Alexey Sedunov 78189e883d Add "Find usage with options" dialog for Kotlin classes 2013-09-03 14:26:31 +04:00
Alexey Sedunov 07cc295747 Extract renameCheckbox method 2013-09-03 14:26:30 +04:00
Svetlana Isakova 7fabfd8771 test data fixed
temporary
when ambiguity inner calls are not completed
2013-09-03 13:09:18 +04:00
Svetlana Isakova 79c18f1c56 test data fixed
temporary
2013-09-03 13:09:17 +04:00
Svetlana Isakova efda014109 test data fixed
ignore error types in resolving constraints for generic functions
'if' is resolved as special function
2013-09-03 13:09:17 +04:00
Svetlana Isakova 335e0d7d1b test data fixed
can't implicitly convert to Unit any more in 'if'
as 'if' is resolved as special function call 'fun IF<T>(T, T)'
2013-09-03 13:09:17 +04:00
Svetlana Isakova 01826af806 rename: deparenthesizeWithNoTypeResolution -> deparenthesize 2013-09-03 13:09:16 +04:00