Alexander Udalov
b01a3eb747
Drop JvmFileClassesProvider and inline implementations
...
Both of its implementations called the same static function; inline
those and move related utilities to JvmFileClassUtil
2017-09-13 15:46:36 +03:00
Vyacheslav Gerasimov
89257e6397
Implement light classes for Kotlin scripts
2017-09-12 13:10:38 +03:00
Nicolay Mitropolsky
be4b86e3d9
KtLightAnnotationForSourceEntry fix for smart-pointers creating
...
`LightElementValue` made PsiCompiledElement to make it properly anchorable when creating smartpointers, when still use `kotlinOrigin.containingFile` for it to be able to `registerProblem` on such elements. (refs KT-18054)
2017-09-04 15:20:20 +03:00
Dmitry Jemerov
f74416a151
Cache the result of hasTopLevelCallables() for a KtFile
...
#KT-19885 Fixed
2017-09-04 13:21:03 +02:00
Dmitry Jemerov
839f197a1e
KtFile: J2K and cleanup
2017-09-04 13:21:03 +02:00
Nicolay Mitropolsky
108a40261b
KtLightAnnotationForSourceEntry fix for reading unnamed java-annotation parameter
2017-08-29 17:32:07 +03:00
Nicolay Mitropolsky
6953ae79e2
Fix for KtLightParameter and KtLightParameterList equality
2017-08-28 15:57:44 +03:00
Pavel V. Talanov
7fecec1141
lightAnnotations: remove several brittle assertions
...
Add some test cases with "red" code
2017-08-23 17:12:56 +03:00
Nicolay Mitropolsky
a6b446cc4f
Correct 'asJava' view of annotations as annotation arguments
...
Fix light elements for nested arrays/annotations inside annotations
#KT-18378 Fixed
2017-08-23 17:12:55 +03:00
Vyacheslav Gerasimov
c549c63100
Light Classes: Correctly handle annotations for property parameters
...
When getting annotations for KtLightParameter which is property parameter we should return annotations for parameter instead of property
#KT-19671 Fixed
2017-08-21 15:01:51 +03:00
Mikhail Glukhikh
3623f581b8
Eliminate a set of warnings, mostly nullability ones
2017-08-18 15:10:27 +03:00
Alexey Sedunov
53d12e6cf7
Method Hierarchy: Refactoring
...
- Do not rely on light methods and Java method hierarchy
- Support val/var parameters
- Support built-in member functions
#KT-14346 Fixed
2017-08-02 13:08:06 +03:00
Alexey Sedunov
0c2ea5d799
Light Classes: Fix equivalence check
...
Do not consider PsiClass equiavent to KtLightClass
if it's not a light class as well
#KT-16180 Fixed
2017-08-02 13:08:06 +03:00
Alexander Udalov
41ea0e8ef8
Introduce AnnotationDescriptor.fqName
...
Could be used instead of ".annotationClass.fqName" to avoid the unneeded
resolution of the annotation class descriptor
2017-07-20 13:25:38 +03:00
Nikolay Krasko
dfef1f4921
Add reference equality shortcut for equals() in light members
2017-07-17 14:50:59 +03:00
Nikolay Krasko
44ed903303
Implement equivalence of light members by origin when possible
...
Previous implementation worked through equality that used equality
of method stubs (see LightMemberOriginForCompiledMethod). But method
stubs for compiled element can be recreated when caches are outdated,
including weak reference cleaning (see ClsJavaStubByVirtualFileCache).
This could cause misbehave of find usages when java reference has an
outdated version of light element in resolution cache.
2017-07-17 14:50:59 +03:00
Mikhail Glukhikh
dfe2c16bc7
More cleanup: lift return / assignment out
2017-07-10 12:59:58 +03:00
Alexey Sedunov
28c5978d81
Light Classes: Fix AIOOBE on KtParameter -> PsiParameter conversion
...
EA-88058 Fixed
2017-07-04 19:37:54 +03:00
Pavel V. Talanov
46512f34e4
Fix 'Find symbol' and 'Go to declaration' when jar is used in many libs
...
SourceNavigationHelper takes into account all the module infos
that given virtual file is a part of
#KT-15093 Fixed
2017-06-15 13:35:40 +03:00
Pavel V. Talanov
2b153d5c10
Improve search for facade light class by kotlin file
...
LightClassUtil#getWrappingClass works for clashing facade fq names
#KT-17855 Fixed
2017-06-07 11:19:23 +03:00
Pavel V. Talanov
19db4304bd
Use clsDelegate to calculate hasModifierProperty("final") for light psi
...
AllOpen plugin can make some changes and we don't have the tools to make
correct decision based on psi
#KT-17857 Fixed
2017-06-06 17:11:18 +03:00
Pavel V. Talanov
f3f2379e5a
KtLightMemberModifierList:hasExplicitModifier("default") returns false
...
#KT-18070 Fixed
2017-06-06 17:11:17 +03:00
Alexander Udalov
7febd846e8
Export 'intellij-core' in module 'frontend'
...
Remove intellij-core from dependencies of modules which already depend
on frontend or any module that exports frontend (such as frontend.java)
2017-06-06 14:29:26 +03:00
Pavel V. Talanov
798c80ed07
Use wrappers around java.util.* to emulate kotlin.collection.* behaviour
...
Backend: If kotlin class extends kotlin.collection.List
write it as it's super interface (light class mode only)
IDE: Provide wrapper classes to java resolve
that try to emulate backend behaviour
For example if kotlin class implements kotlin.collections.Map,
we provide a superinterface that has abstract 'getEntries' method
and 'entrySet' method that is considered default.
In reality all those methods are generated in the class itself.
In IDE supporting this case without hacks is not feasible performance-wise
since kotlin.collection.* may not be an immediate supertype and we need
to compute all supertypes just to calculate own methods of the class
2017-05-16 22:01:03 +03:00
Pavel V. Talanov
40561dabed
J2K JavaToKotlinClassMap
2017-05-16 22:00:58 +03:00
Pavel V. Talanov
6701eb70fb
Light classes, minor: introduce cannotModify() utility
2017-05-16 22:00:57 +03:00
Dmitry Jemerov
9c4f897d31
Index properties defined in primary constructor
...
#KT-15029 Fixed
2017-05-10 14:27:28 +02:00
Pavel V. Talanov
59012c0551
FakeFileForLightClass is not physical
...
Fix Spring tests
2017-05-03 21:38:49 +03:00
Pavel V. Talanov
9e25dfdd93
KtLightModifierList extends KtLightElementBase
...
Fix getContainingFile always returning null
2017-05-03 21:38:48 +03:00
Pavel V. Talanov
956ace3463
Light classes: modifierList#findAnnotation does not trigger exact resolve
2017-05-02 15:40:22 +03:00
Pavel V. Talanov
55a0e138fc
Refactor: extract AnnotationDescriptor.annotationClass utility
2017-05-02 15:40:20 +03:00
Pavel V. Talanov
0571c62943
KtLightElements: make light annotations lazier
...
Allow to get annotation list and to invoke `findAnnotation` without building delegate
Introduce KtLightNullabilityAnnotation which holds nullability information and is built
before delegate is built
2017-05-02 15:40:17 +03:00
Pavel V. Talanov
03b68666e4
KtLightClassForSourceDeclaration: use psi based resolve to speedup isInheritor checks
2017-05-02 15:40:17 +03:00
Pavel V. Talanov
bdc4014ded
Refactor: Introduce KtLightElementBase
2017-05-02 15:40:16 +03:00
Pavel V. Talanov
901aa9c18b
PsiBasedClassResolver: use ImpreciseResolveResult instead of Boolean?
2017-05-02 15:40:14 +03:00
Pavel V. Talanov
8f4c969933
KtLightElement is no longer PsiNamedElement
2017-05-02 15:40:14 +03:00
Dmitry Jemerov
49a211b3cd
Ensure that UElement.nameIdentifier.containingFile is a real file
...
This is needed to report inspection problems on UAST elements.
2017-04-20 11:02:56 +02:00
Pavel V. Talanov
bea1da5c7a
KtLazyLightClass: do not store references to LightClassDataHolder
...
Otherwise any cached reference to light class can lead to severe memory leaks in IDE
since LightClassBuiderResult holds GenerationState which holds ModuleDescriptor
2017-04-18 14:59:45 +03:00
Pavel V. Talanov
421b785697
Minor: fix erroneous refactoring
2017-04-18 14:59:37 +03:00
Pavel V. Talanov
69c250a1b7
Light class test: avoid checking method visibility when NoLaziness is not specified
...
Allows to avoid putting NoLaziness flag on every test that mentions 'override' modifier
2017-04-09 15:09:15 +03:00
Pavel V. Talanov
4f701285b1
Light class builder: do not generate methods delegating to DefaultImpls in kotlin classes
...
Class APIs from java point of view stays the same so we can avoid generating those methods
Otherwise we have to calculate all supertypes when getMethods() is called,
which imposes severe performance penalties
We have to pretend these methods are not 'abstract' (also we consider them 'default' for safety)
so java highlighting does not report "class should be abstract" for all inheritors
We have to manually report "class should be abstract" on some of the java inheritors,
specifically those that are implementing interfaces directly
as opposed to extending kotlin classes implementing those interfaces
2017-04-09 15:09:01 +03:00
Alexander Udalov
d440f07111
Use Java 7+ diamond operator in compiler modules
2017-04-03 14:51:15 +03:00
Alexander Udalov
5ebee6ceca
Use Java 8 lambdas instead of anonymous classes in compiler modules
2017-04-03 14:49:23 +03:00
Alexander Udalov
34f0576135
Invoke "remove unnecessary final" intention in compiler modules
2017-04-03 14:26:52 +03:00
Alexey Sedunov
72436c1738
Light Classes: Fix origin search for KtLightSuperTypeReference
...
Use analyzeFully() when resolving super type references
2017-03-31 18:24:06 +03:00
Pavel V. Talanov
df71116dc5
KtLightElements: fix KtLightMember not extending KtLightDeclaration
...
Fix problem introduced in 4b85fd9fbe
2017-03-28 19:47:13 +03:00
Pavel V. Talanov
2291d91109
KtLightMethod: isVarArgs() does not trigger exact delegate computation
2017-03-27 17:59:01 +03:00
Pavel V. Talanov
c4be805962
Light members: allow to get modifier list without computing delegate
2017-03-27 17:58:59 +03:00
Pavel V. Talanov
ec895f18f2
Light classes: refactor, move getOrigin to corresponding classes
2017-03-27 17:58:55 +03:00
Pavel V. Talanov
a2511232ab
Lazy light classes: fix visibility modifier in case of inherited protected visibility
2017-03-27 17:58:53 +03:00