* Code was moved to utils, but sources are included to the shared
until bootstrap advance.
* Fixed dependencies and set API & LV to 1.4 for the modules used with
Gradle.
Merge-request: KT-MR-9122
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
ABI is a special mode which is used only by the deprecated legacy
implementation of jvm-abi-gen. It is more reliable to use the standard
FULL mode to prevent divergence in behavior from normal compilation.
Creating a ZipFileSystem object is an expensive operation.
A cacheable ZIP file system accessor caches ZipFileSystem
objects and may improve the performance of the in place
metadata reading operations from klibs.
Related to KT-51712
- Instead of extending the API with `typeParameterNames`, this commit
creates a PSI-based Java type parameter symbol similarly to the
PSI-based Java class symbol. Because completion requires only the type
parameter name, this approach works fine, and without exposing an
optimization via the API.
- Instead of spreading `equals` and `hashCode` implementations over
`KtFirNamedClassOrObjectSymbol` and `KtFirPsiJavaClassSymbol`, this
commit introduces a shared base class.
- Some completion tests failed because the `hashCode` of
`KtFirNamedClassOrObjectSymbol` and `KtFirPsiJavaClassSymbol` was
different for symbols which should be equal. Both symbols now use the
`ClassId` hash code.
- `KtFirNamedClassOrObjectSymbol.equals` is now properly symmetric with
`KtFirPsiJavaClassSymbol`.
- `KtFirPsiJavaClassSymbol` now has a definite class ID, which
simplifies its implementation a little. `KtFirPsiJavaClassSymbol`
doesn't support local Java classes by design.
- Most Java classes aren't deprecated. To avoid building `firSymbol`
in such cases, this commit adds a simple heuristic which checks the
class's annotations for the presence of one of the deprecation
annotations recognized by the Kotlin compiler.
- Note that annotations are compared via simple names, so there is a
slight margin of error. However, comparing class IDs is more costly in
my tests, because getting an annotation's class ID is not as cheap as
getting its simple name.
- Completion accesses symbol type parameters to render their names.
Instead of building the whole list of type parameters, and
consequently the whole FIR class, completion can now access the type
parameter names directly.
- `KtFirVisibilityChecker` accessed `KtFirPsiJavaClassSymbol.firSymbol`
a significant number of times during completion, which led to many
instances of FIR class construction.
- This commit introduces a heuristic to `KtFirVisibilityChecker`
specifically for `KtFirPsiJavaClassSymbol` to bypass the compiler's
visibility checker. The fact that we're dealing with Java class
visibility from Kotlin makes this feasible without reimplementing the
full logic of `FirVisibilityChecker`.
- `FirJavaClass` gets all its annotations from the Java annotations, so
we can rely on `javaClass.annotations` to determine if any annotations
are present.
- Some completion performance tests (e.g. IntelliJ: "empty place typing
with library cache") spent a considerable amount of time in
`KtFirSymbolProviderByJavaPsi.getNamedClassSymbol`.
- This commit introduces `KtFirPsiJavaClassSymbol`, which implements
many `KtNamedClassOrObjectSymbol` properties with the `PsiClass`
instead of the FIR class. The `FirClassSymbol` is built only when
necessary. This improves performance when no "slow" properties need to
be computed for the symbol.
^KT-56617 fixed
Historically flag was enabled for Gradle projects, but we don't have fir-based JavaTracker for the K2 compiler for now, so we need to use a fallback strategy.
Note: it was disabled for tests with K2
Note2: after adding a fir-based java classes tracker this value should be set to true (KT-57147)
#KT-56886 Fixed
Merge-request: KT-MR-9053
Merged-by: Aleksei Cherepanov <aleksei.cherepanov@jetbrains.com>