Commit Graph

115 Commits

Author SHA1 Message Date
Dmitriy Novozhilov 704e2ef5c5 Suppress K2 specific warnings in the codebase
^KT-62472
2023-10-18 07:59:27 +00:00
Nikolay Lunyak ec9cb8beb6 [FIR] Rename JvmNames -> JvmStandardClassIds
This is more consistent with the code of
the common compiler checkers.

It would be nice to refactor the contents
of this object further, but it's out
of scope of the current branch.

^KT-54596
2023-09-19 22:14:09 +00:00
Vladimir Dolzhenko d8c80b0270 Fix parameters matching for suspend functions
#KT-61894 Fixed
2023-09-13 11:59:02 +00:00
Alexander.Likhachev 6eaccc997f [Build] Fix the typo junit jupyter -> jupiter 2023-09-06 22:47:34 +00:00
Alexander.Likhachev 53fde520d5 [Build] Add jUnit dependencies in testApiJUnit5 to the implementation configuration
Adding these dependencies to the `api` configuration pollutes classpath for each dependant modules even if it doesn't need them. Instead, the dependencies should be declared more granularly if they're required
#KTI-1349 In Progress
2023-09-06 22:47:34 +00:00
Dmitrii Gridin bd10ee10fe [psi] avoid usage of SAFE_IDENTIFIER_FOR_NO_NAME
This name leads to inconsistency between FqName from stub and
FqName from ClassId.
The first one is `no_name_in_PSI_3d19d79d_1ba9_4cd0_b7f5_b46aa3cd5d40`
but the second one is `<no name provided>`.
We can't just replace SAFE_IDENTIFIER_FOR_NO_NAME to NO_NAME_PROVIDED
due to many places with unsafe logic inside type mapping.

^KTIJ-26848 Fixed
2023-09-05 12:58:50 +00:00
Pavel Kirpichenkov cf98fb5612 [Tests] Add .knm stub consistency test
The test compares stub trees built from .knm files directly and from
the decompiled text. Test data for .class decompiler is reused,
JVM-specific cases are ignored

KT-61354
2023-09-05 09:36:25 +00:00
Ilya Kirillov 103ebb0ab4 [kotlin] fix AssertionError: Alien file! in IJ test
We should not cache `VirtualFile` per-application
2023-08-31 08:55:17 +00:00
Ilya Kirillov 714cb67254 [decompiler] add tests for generated psi text by builtin decompiler 2023-08-30 14:45:15 +00:00
Ilya Kirillov 9ea344fe76 [decompiler] fix ambiguities to builtin members resolve in K2 IDE
If a user has multiple kotlin-stdlib libraries in a project, all those stdlib libraries will contain builtins
which will result in resolution ambiguities.

To prevent such kind of ambiguities inside LLFirDependenciesSymbolProvider,
callables are grouped by facade class name.
Only matching callables from the first facade are used.

Facade is a Kotlin/JVM-term so right now it works only for JVM targets.
Builtins are also used in JVM, so the current solution is to have a Facade name also for builtins.

^KTIJ-26760
2023-08-30 14:45:14 +00:00
Ilya Kirillov e8db349f24 [decompiler] extract builtin VirtualFile creation to a separate service for further reuse
^KTIJ-26760
2023-08-30 14:45:14 +00:00
Pavel Kirpichenkov dc3641f79d Limit visibility of internal K/N decompiler classes
KTIJ-26526
2023-08-23 07:46:29 +00:00
Pavel Kirpichenkov af94b241ec Extract K/N decompiler related files into a separate module
KTIJ-26526
2023-08-23 07:46:29 +00:00
Pavel Kirpichenkov d7356afe1e Move K/N decompilers and stub builders to kotlin.git
KTIJ-26526
2023-08-23 07:46:29 +00:00
Dmitrii Gridin e05cb49671 [SLC] invalidate local class members cache on any file changes
We should track the containing file modifications to avoid PIEAE by
changes in members

^KTIJ-26661 Fixed
2023-08-16 10:22:13 +00:00
Anna Kozlova b725cd3e6c [light classes] match property with getter or setter only
^ KTIJ-26536
2023-08-09 07:09:35 +00:00
Dmitriy Novozhilov cc2bc5e8b1 [FIR2IR] Reuse IR fake overrides for FIR fake overrides for all MPP modules
^KT-58229 Fixed
2023-08-03 10:02:57 +00:00
Ilya Kirillov 62e856956c [stub builder] generate K2 test output for the testsuite where classfiles are generated by the K2 compiler
The result of k1/k2 should be similar here, the differences should be fixed by KT-60764
2023-07-31 15:38:07 +00:00
Ilya Kirillov ce990853da [stub builder] generate tests for the testsuite where the classfiles generated by the K2 compiler
The result of k1/k2 should be similar here, the differences should be fixed by KT-60764
2023-07-31 15:38:07 +00:00
Ilya Kirillov 419c0c83e3 [stub builder] introduce a separate testsuite where classfiles generated by the K2 compiler
The result of k1/k2 should be similar here, the differences should be fixed by KT-60764
2023-07-31 15:38:07 +00:00
Mikhail Zarechenskiy 3cdb28e95f Remove last usage of ModelBranch API
It was decided to remove ModelBranch completely from Intellij API, see IDEA-309887
2023-07-17 13:52:53 +00:00
Vladimir Dolzhenko c1b70a7303 Move under debug log message when nested class is not found
To avoid freezes and useless reporting calculations

#KTIJ-25465 Fixed


Merge-request: KT-MR-10996
Merged-by: Vladimir Dolzhenko <Vladimir.Dolzhenko@jetbrains.com>
2023-07-08 07:18:09 +00:00
Vladimir Dolzhenko 3c8c20f8d2 Do not do unnecessary writeBooleanAttribute
Merge-request: KT-MR-10945
Merged-by: Vladimir Dolzhenko <Vladimir.Dolzhenko@jetbrains.com>
2023-07-05 09:27:04 +00:00
Yan Zhulanow df28bd1d79 [Stubs] Pass proper container source to stub-based FIR declarations
Backend, which is used by the expression evaluator, relies on the class
name in 'FacadeClassSource'. To pass the correct JVM class name,
stubs for top-level functions and properties got the 'origin'.
2023-07-04 11:17:39 +00:00
Ilya Kirillov 0a1f27e43a [LC] remove duplicating checkIsMangled function 2023-06-30 13:43:30 +00:00
Anna Kozlova 137f8b7c70 [decompiler] ensure names starting with numbers are escaped
^ KTIJ-25985
2023-06-23 11:17:46 +00:00
Anna Kozlova 3fc334d2eb [decompiler] additional logging for ByDescriptorIndexer 2023-06-15 15:47:17 +00:00
Ilya Kirillov 78f09409b7 [Analysis API] move ClsKotlinBinaryClassCache/FileAttributeService service registration to StandaloneProjectFactory 2023-06-02 09:16:47 +00:00
Anna Kozlova b8e868caf6 [decompiler] navigate to containing class for fake object descriptors
^ KTIJ-25661
2023-05-30 17:23:54 +00:00
Kirill Rakhman 8f447e5b78 Revert "[AA] Deserialize reference to typealias from stubs as fully expanded"
This reverts commit 3c22b1ce53.

#KT-58335
#KT-58786
2023-05-19 11:50:40 +00:00
Kirill Rakhman 3c22b1ce53 [AA] Deserialize reference to typealias from stubs as fully expanded
#KT-58335
2023-05-16 09:20:57 +00:00
Anna Kozlova 799210262d [decompiler] skip return type check for src functions without return type 2023-05-04 21:31:43 +00:00
Anna Kozlova 8106505166 [decompiler] get rid of indexers in decompiled text 2023-05-02 10:30:35 +00:00
Anna Kozlova 956294821b [psi] don't load text for compiled code
use stubs when possible, when stub doesn't contain anything,
decompiled text won't contain it either,
no sense to load
2023-05-02 10:30:34 +00:00
Anna Kozlova dead2c8be8 [LL] stubBased provider: deserialize fir from stubs build from decompiled text
if the compiled code is opened in the editor,
1. it's decompiled
2. stub is build over decompiled text
3. this stub replaces the stub built from classes.

This process leads to missed information in resulted FIR, e.g. half correct classId.
On the other side, this FIR is used only for this opened editor.
2023-04-27 11:37:29 +00:00
Anna Kozlova a41f7dc25d [cls] save parameter name for functional types in stub
to make it available for deserialized Fir
2023-04-27 11:37:28 +00:00
Anna Kozlova d59d66e876 [AA, LL] use stubs to build deserialized Fir elements in IDE
^KTIJ-24638

Notice on `DebugSymbolRenderer`:
stub based deserializer sets source directly,
but it's available in IDE mode only.
Thus, standalone and IDE tests have different results.
In order to avoid this, sources for compiled code are explicitly ignored

Notice on distinct callables:
for a file which belong to multiple libraries, decompiled code would be build per library.
In order to avoid ambiguity errors for members in that file,
we need to distinct provided elements by origins
failed test from IJ repo:
 FirReferenceResolveWithCrossLibTestGenerated#testSetWithTypeParameters
2023-04-27 11:37:28 +00:00
Anna Kozlova 96c15f6c71 [cls] include generated equals/hashCode/toString method in stubs
to avoid heavy computation of super functions
2023-04-27 11:37:27 +00:00
Anna Kozlova 7ee648a4f5 [cls] include annotation arguments in cls stubs
^ KTIJ-24666
this would allow to build fir based on stubs,
do not keep ProtoBuf in memory and
search in decompiled code by stubs
2023-04-26 21:43:15 +02:00
Anna Kozlova f0af7c4228 [cls] include property constant initializer in stubs
^KTIJ-24667
this would allow building FirElements from stubs
2023-04-26 21:43:15 +02:00
Anna Kozlova b558d5fc9c [cls] include default parameter value in stubs
this stub would allow building FirElement from stubs,
as well as search signatures in compiled code without loading decompiled text
2023-04-26 21:43:14 +02:00
Anna Kozlova 7021c079c6 [cls] include property accessors in cls stubs 2023-04-26 21:43:14 +02:00
Anna Kozlova 4fe239375f [cls] write contracts information to cls stubs
^ KTIJ-24665
this information would be used to create resolved FirElements from stubs,
so no ProtoBuf would be kept in memory
2023-04-25 08:34:18 +00:00
Egor Kulikov c46c922841 [ClsStubs] Add context receivers on function types 2023-04-20 18:57:51 +00:00
Anna Kozlova f810d435f4 [cls] write flexible type information to cls
^KTIJ-25172
this information would be used to create resolved FirElements from stubs,
so no ProtoBuf would be kept in memory
2023-04-14 18:12:48 +00:00
Jinseong Jeon 0ac3fae9ab LC: commonize facade for multi-file class 2023-03-29 18:51:03 +02:00
Dmitrii Gridin 7af78db2e1 [DLC] drop hard references to member declarations to reduce memory consumption
^KT-56613
2023-03-01 10:43:02 +00:00
Dmitrii Gridin 847b29ac15 [DLC] add missing identity checks to 'equals'
^KT-56613
2023-03-01 10:43:01 +00:00
Dmitrii Gridin 95455c9870 [DLC] add missing visitor methods
Some of our light classes have no correct parent (KT-56882),
so I temporarily disabled
AbstractSymbolLightClassesParentingTestBase for such cases
(previously decompiled light classes were not tested at all)

^KT-56613
^KT-56882
2023-03-01 10:43:01 +00:00
Dmitrii Gridin 5e18ebcd7e [DLC] cleanup code and drop some redundant constructions
^KT-56613
2023-03-01 10:42:58 +00:00