The API replaces 'KotlinCompilerIde' in the IntelliJ IDEA plugin.
Code moved to Analysis API as its K2 implementation severely depends on
the internal compiler API (FIR).
The API is going to be used in the JVM debugger evaluator, and in
the Bytecode Tool Window.
In this commit, only ordinary Kotlin are supported.
In later commits, there will be also support for 'KtCodeFragment' files,
as well as some test coverage.
Modules are absent in the repository by default, but can be added from
the experimental repository. This a temporal solution for building
compatible compose with the Kotlin master.
KTI-1302
- As mentioned in KT-60570, memory consumption in cached symbol names
providers is caused partially by lots of instances of empty mutable
sets. This commit replaces such sets with the `emptySet()` singleton.
- This improvement also makes sense for callable names because the IDE
"package names with top-level callables" set currently contains all
package names in the project.
- In my local tests of the `setUp` Find Usages performance test, the
retained size of `FirDelegatingCachedSymbolNamesProvider` is cut down
from 208MB to 170MB by the empty class name set optimization, and from
170MB to 115MB by the empty callable name set optimization.
This commit prevents language version increase due to bootstrapping
problems. Compiler version X attempts to build the project with the
current version X+1 -> warning about progressive mode cannot be enabled ->
error due to -Werror -> build failure.
This commit explicitly sets LV 1.9 for all projects with disabled FIR
bootstrap, as well as for libraries, including Native stdlib.
Related to KT-59171
By ignoring type parameters. Since type parameters in annotations are a
very limited feature, their sole use is to be able to specify them as
KClass argument: annotation class Foo<T: Any>(val bar: KClass<T>).
Since we can encounter type param only as a KClass type argument (and
never as a property type), simple approach of ignoring them works fine.
In that case, since we simply copy property types to synthetic
implementation class, its properties in IR start look like this:
annotation class FooImpl(override val bar: KClass<T of Foo>). This IR
seems to be not completely correct, since FooImpl.bar type contains T of
Foo param, which is out of its scope. However, so far I didn't
encounter any problems with this during testing and after MR discussion
this approach has been considered possible.
#KT-59558 Fixed
#KT-59036 Fixed
They were needed as a temporary migration in scope of KT-58587
Now the bootstrap and IDE include KT-58587 patch, so @Suppress and
`final` are no longer needed
- make some utility functions and classes public
- split some classes into common and Kapt 3 - specific parts
- use Kapt 4-ready filtering of @Metadata annotations in tests
User scripts may apply KGP/Jvm plugin not immediately in 'plugins {}'
block. And a script may also already add some additional resources into
a java source set before plugin apply. On apply plugin has erased such
additionally configured resource dirs as it assumed only the default one
are set. Now it also syncs them.
^KT-60459 Fixed
Refactoring in 4986cb14 introduced an unintentional behavior change:
private symbols are now findable in symbol table with lookup by
signature.
Unfortunately, this is not correct - private symbol signature might not
be unique (or at least was sometimes not unique in older compiler
versions), which leads to crashes on deserializing corresponding klib.
This commit restores old behavior.
^KT-60616
This is an attempt to bring consistency to array constructors reified requirement.
Currently,
JVM - reified type in all three: arrayOfNulls, arrayOf, emptyArray
Native - reified in arrayOfNulls and arrayOf, but not in emptyArray
JS & Wasm - reified in arrayOfNulls, but not in arrayOf and emptyArray
Merge-request: KT-MR-11005
Merged-by: Abduqodiri Qurbonzoda <abduqodiri.qurbonzoda@jetbrains.com>