Commit Graph

71 Commits

Author SHA1 Message Date
Roman Golyshev ca72790962 [FIR IDE] Hack checkIsInheritor until KT-51240 is fixed
We do not know for sure if there is any dependency between the
two classes passed to `checkIsInheritor`. To avoid the problem described
in KT-51240, we try to analyse them both and hope that the dependency
in some direction exists.

`NoCacheForModuleException` is introduced to signal about this
particular problem and avoid catching just any `NoSuchElementException`.

This hack is mainly done to fix very annoying KT-51240 for the time
being.

^KTIJ-20852 Fixed
2022-02-10 16:24:44 +03:00
Jinseong Jeon a986aff429 AA: refactor service registrations
such that AA standalone mode doesn't need to unregister services that
were already registered by pre-analysis handlers
2022-02-09 23:11:44 +01:00
Roman Golyshev 7e1a9e2b9a KTIJ-20637 Group files by module in getFacadeClassesInPackage also
Fixup for 35e2561dab, since these changes
were overlooked in the initial commit.

^KTIJ-20637 Fixed
2022-02-02 19:02:23 +03:00
Roman Golyshev 35e2561dab KTIJ-20637 Group files by module and create facade class for each one
Before all files were going to `getOrCreateSymbolLightFacade`. If there
were both compiled and source files, it caused exceptions later
(see `SymbolLightClassFacadeCache.getOrCreateFirLightFacadeNoCache`).

When grouped by the `KtModule`, each file group should contain either
only sources or only compiled classes.

^KTIJ-20637 Fixed
2022-02-01 22:00:51 +03:00
Ilya Kirillov caddbda01b Analysis API FIR: introduce library resolve tests 2022-01-31 21:11:56 +01:00
Ilya Muradyan 9637b6b848 REPL: Fix REPL scripts metadata to be correctly recognized by class file decompiler 2022-01-27 02:23:27 +03:00
Jinseong Jeon 7ff468d9e3 FIR LC: populate only const property on multi-file facade 2022-01-11 21:30:54 +03:00
Jinseong Jeon 62fb8446dc FIR LC: remove unnecessary type parameter shift for inner class
U/LC don't do anything like that, and it rather skips necessary type
paraemters to render.
2022-01-10 12:00:10 +03:00
Ilya Kirillov e6fc434489 Analysis LC: fix isSubClass check for local LC 2022-01-02 21:56:53 +03:00
Ilya Kirillov 1d6d67d0a1 FIR IDE: regenerate tests 2022-01-02 21:56:51 +03:00
Ilya Kirillov b916c5116a Analysis LC: add missing text range for LC 2022-01-02 21:56:50 +03:00
Jinseong Jeon a153a1fefb FIR LC: create inline methods
unless the functions (or accessors) have reified type parameters
or inline-only annotations
2021-12-30 10:47:32 +03:00
Ilya Kirillov 2c80a53a73 Analysis: generate symbol LC tests 2021-12-27 16:23:18 +03:00
Ilya Kirillov 40fdb26569 Analysis LC: introduce Symbol LC tests 2021-12-27 16:23:18 +03:00
Jinseong Jeon 09f5ec7bd3 FIR LC: add supports for decompiled declarations 2021-12-27 16:23:16 +03:00
Vyacheslav Gerasimov f7a9065b75 Build: Use intellij maven repo instead of downloaded IDEA
#KTI-82
2021-12-16 21:48:23 +03:00
Jinseong Jeon 7757fd312b FIR LC: make fields in objects static 2021-12-15 08:20:03 +03:00
Jinseong Jeon 82c2f0c6fd FIR LC: use unified annotations' ClassId or FqName 2021-12-15 08:20:02 +03:00
Jinseong Jeon 9a669092e3 FIR LC: backward compatible visibility of enum entry ctor 2021-12-14 18:26:26 +03:00
Jinseong Jeon f8a6ab9536 FIR LC: populate DefaultImpls if an interface has default implementations 2021-12-09 11:04:25 +01:00
Jinseong Jeon b9a56f4888 FIR LC: add static modifier to non-inner nested interfaces 2021-12-08 15:28:33 +01:00
Ilya Kirillov dc9c2aa39d Analysis API: add KDoc, small cosmetic improvements 2021-12-02 20:09:19 +01:00
Ilya Kirillov 673459580c Analysis API: introduce annotation value for KClass 2021-12-02 20:09:16 +01:00
Ilya Kirillov f722a54c78 Analysis API: separate constant values from annotation values 2021-12-02 20:09:16 +01:00
Ilya Kirillov 47c1da2845 FIR IDE: separate KtAnnotationApplication and KtAnnotationApplicationValue 2021-12-02 20:09:16 +01:00
Ilya Kirillov b1c8a9e886 Analysis API: rename KtConstantValue -> KtAnnotationValue as it is annotation specific 2021-12-02 20:09:14 +01:00
Jinseong Jeon edc17a9d5f FIR LC: populate no-arg constructor if needed 2021-11-25 12:53:54 +01:00
Ilya Kirillov 1d1f5ace8f Analysis API: rename KtCallableSymbol.type -> returnType 2021-11-22 22:47:01 +01:00
Ilya Kirillov ba918d45a2 Analysis API: introduce KtInitializerValue for initializer of KtPropertySymbol 2021-11-22 22:46:59 +01:00
Ilya Kirillov a5a5ff39d6 Analysis API: get rid of KtTypeAndAnnotations & add annotations for every type 2021-11-22 22:46:53 +01:00
Jinseong Jeon 3ccbd25856 FIR LC: populate inner classes in interfaces 2021-11-20 21:34:48 +01:00
Roman Golyshev 3091269035 [FIR IDE] Create generated members for data classes more accurately in FIR Light Classes
`equals`/`hashCode`/`toString` don't necessarily come from `Any` - they
might be overridden in the abstract class like this:

```kt
abstract class Base {
  // reinforces overriding in inheritors
  abstract override equals(a: Any?): Boolean

  // implementation will be replaced by the generated for data class
  override hashCode(): Int = 0

  // implementation is final, compiler will not replace it
  final override toString(): String = ""
}
```
2021-11-15 14:36:26 +03:00
Jinseong Jeon 4eec381d1b FIR IDE/LC: introduce/use KtTypeMappingMode 2021-11-08 20:12:17 +01:00
Jinseong Jeon 0da9ef873a FIR LC: use optimal type mapping mode for return type 2021-11-08 20:12:17 +01:00
Jinseong Jeon d3c34fa200 FIR LC: use optimal type mapping mode for value parameter 2021-11-08 20:12:17 +01:00
Jinseong Jeon d029e84b96 FIR LC: use proper use-site target for accessor's JVM name 2021-11-08 20:12:16 +01:00
Ilya Kirillov 6453f2bdbf Analysis API: simplify scope hierarchy 2021-11-05 15:46:09 +01:00
Ilya Kirillov 0dca176e28 FIR LC: make fir LC utils internal 2021-11-05 15:46:09 +01:00
Ilya Kirillov dd9a96a12f FIR LC: fix light facade caching 2021-11-05 15:46:07 +01:00
Ilya Kirillov 79f30755a5 FIR LC: do not create light classes for non-source declarations 2021-11-04 12:05:03 +01:00
Jinseong Jeon 5aa8e2d0d1 FIR LC: fix nullable annotation on return type of suspend function 2021-11-01 19:19:39 +01:00
Jinseong Jeon 5880d80d26 FIR LC: add support for inline class 2021-11-01 19:17:26 +01:00
Jinseong Jeon 0e7d1b3945 FIR LC: refactor creation of property accessors 2021-11-01 19:17:26 +01:00
Jinseong Jeon 3f2c86afb8 FIR IDE/LC: introduce/use delegated member scope 2021-10-27 17:06:32 +02:00
Jinseong Jeon 907d2e9ed4 FIR LC: populate delegates to interface methods 2021-10-27 17:06:31 +02:00
Jinseong Jeon 693564084a FIR LC: populate delegate fields 2021-10-27 17:06:31 +02:00
Jinseong Jeon 96fbbb6f69 FIR LC: reorder fields (to be backward-compatible) 2021-10-27 17:06:30 +02:00
Jinseong Jeon d8df177b83 FIR LC: fix return type of suspend function 2021-10-26 14:12:29 +02:00
Jinseong Jeon 5ed9cac0cc FIR LC: populate continuation parameter for suspend function 2021-10-26 14:12:28 +02:00
Jinseong Jeon c669749915 FIR LC: adapt to split of property annotations during FIR building
As of 7243d308, property annotations are split according to use-site,
and thus, for property accessors and setter parameter, FIR LC needs
to look up accessors and setter parameter with the target use-site.
2021-10-15 13:50:32 +02:00