Commit Graph

152 Commits

Author SHA1 Message Date
Pavel Kirpichenkov c0dd731818 Load JVM built-ins in IDE from module dependencies
Fix built-ins for JVM platform and make them consistent
with module's dependency on standard library. Changes
don't affect non-JVM platforms.

Previously all built-ins in IDE were loaded from classloader
and were based on the same pre-serialized .kotlin_builtins files.
This approach is generally not correct as built-in declarations
differ for different platforms, but it had been working for a while
without immediately observalble effects (see KT-33233 for more info).
After changes in standard library JvmBuiltins started producing
false errors (see KT-39728).

To fix this, JVM built-ins in IDE now utilize the same technique as
applied in CLI: using dependency on standard library as a module
for built-ins instead of artificial module that considers only
.kotlin_builtins.

Change summary:
- Provide JvmBuiltins with kind FROM_DEPENDENCIES
  for all modules with stdlib dependency in IDE
- Add JvmBuiltinsPackageFragmentProvider to JVM-ish module resolvers
  (JVM and Composite with JVM platform) to support their use as
  built-ins module
- Create KotlinBuiltInsMetadataIndex file index for tracking libraries
  containing .kotlin_builtins to support JvmBuiltinsPackageFragmentProvider
- Create KotlinStdlibIndex file index for tracking kotlin-stdlib(-common),
  which looks for "Kotlin-Runtime-Component" manifest attribute
- Add caching service to track LibraryInfo for kotlin-stdlib(-common)
- Put LibraryInfo for kotlin-stdlib(-common) alongside SDKs
  due to the need to resolve that modules in BuiltInsCache
- Update BuiltInsCache to separate JvmBuiltins by module's dependency
  on stdlib and JDK
- Make platform of KotlinSDK common instead of JVM
- Set built-ins module lazily in IDE

^KT-33233 Verification Pending
2021-01-14 17:28:15 +03:00
Dmitriy Novozhilov 7f4a925b85 [FE] Drop isReleaseCoroutines flag from LanguageSettingsProvider 2021-01-12 16:47:50 +03:00
Denis.Zharkov 7b9f6c1560 Fix exceptions caused by cyclic dependency between ModuleDescriptor and JvmBuiltIns
^KT-39105 Fixed
^KT-42001 Fixed

See also EA-216604 and EA-211562
2020-12-24 14:06:20 +03:00
Andrei Klunnyi 3af0257b38 KTIJ-664 [SealedClassInheritorsProvider]: IDE-specific implementation 2020-12-15 18:43:00 +01:00
Kirill Shmakov 8ede19811d Make mpp tests gutters aware of different platforms run
Behaviour is similar to the test suite gutters:
- simple triangle when there is no history
- triangle + red circle if some runs failed
- triangle + green circle if all runs passed

^KMM-100 Fixed.
2020-11-19 17:20:06 +03:00
Vyacheslav Gerasimov 3feff16a77 Cleanup 193 compatibility fixes 2020-11-11 14:28:54 +03:00
Dmitriy Dolovov 3495ec198d Minor. Small clean-up in KLIB decompiler 2020-10-12 10:24:18 +03:00
Dmitriy Novozhilov 3a48265077 Move ModuleDescriptor.Capability to :core:descriptors.common module 2020-08-25 10:31:37 +03:00
Yunir Salimzyanov 70cda1b113 Refactor and fix files previously affected by 192 patchset (KTI-315) 2020-08-19 19:40:02 +03:00
Dmitry Savvinov 5c88b1e80a Allow depending on Native stdlib even if platforms do not match under HMPP
^KT-40102
2020-07-14 12:49:59 +07:00
Yunir Salimzyanov 3b9000cc0c Cleanup 191 extension files (KTI-240) 2020-06-01 18:43:10 +03:00
Nikita Bobko aa5a5c954f Refactoring: change "// BUNCH: xxx" format
It wasn't obvious how to use this comment properly.
Now it should be clear
2020-05-29 20:31:12 +03:00
Vladimir Dolzhenko f4b6e1bff6 Reworked deprecated fileTypeFactory EP usage
Relates to #KT-38571
2020-04-27 14:08:17 +00:00
Dmitriy Dolovov c35420eaf6 Minor. Add comments 2020-04-14 21:07:59 +07:00
Dmitriy Dolovov 757d77600a HMPP: Evaluate exact TargetPlatform for each K/N KLIB library 2020-04-14 21:07:38 +07:00
Dmitriy Dolovov 90398fd087 Minor. Specify explicit property types 2020-04-14 21:07:33 +07:00
Dmitriy Dolovov 8d2e999776 HMPP: Parameterize NativePlatform with KonanTarget 2020-04-14 21:06:48 +07:00
Konstantin Tskhovrebov b815cb7e4a Lift up module platform check and add bunch for 191.
191 bunch uses directly PsiTreeUtil instead kotlin extension
because without it class loader's loads different classes in runtime
and ClassCastException happens.

Fix #KT-38149
2020-04-10 14:47:28 +03:00
Alexey Tsvetkov 1c38466a22 Pass LookupTracker to deserialized scopes in JS KLIB compiler
Before this change, deserialized scopes were not tracking lookups properly,
because lookup tracker was not passed from compiler configuration correctly.
Because of that, lookups from dependencies were not tracked,
so multi-module IC was not working (chages were passed between modules,
but affected source files were not invalidated).
2020-04-10 05:35:45 +03:00
Konstantin Tskhovrebov 2f6099feb9 Add KotlinNativeRunConfigurationProducer. 2020-04-07 16:09:02 +03:00
Dmitriy Dolovov 5e1e9876fd IDE: Don't use direct refs on IdePlatformKindResolution EP instances 2020-04-01 23:10:55 +07:00
Dmitriy Dolovov 132464fa4f Minor. Rename KotlinLibrary.readSafe() -> KotlinLibrary.safeRead() 2020-04-01 23:10:37 +07:00
Dmitriy Dolovov 31a1f8ff4b Include :native:kotlin-native-utils into kotlin-compiler.jar 2020-04-01 11:46:55 +07:00
Dmitriy Dolovov 9bbfe9c1ac Rename: KonanPlatform, KonanPlatforms -> NativePlatform, NativePlatforms 2020-03-29 23:20:52 +07:00
Dmitriy Dolovov cc6e4e5cfb IDE, Native: Don't produce CompositePackageFragmentProvider when unnecessary 2020-03-29 23:20:35 +07:00
Dmitriy Dolovov c23a11a6fc Refactoring: Clean-up usage of KlibMetadataFactories 2020-03-27 13:12:01 +07:00
Dmitry Gridin 84c9929935 i18n: NativeDefinitions: remove redundant bundle
#KT-37483
2020-03-24 16:18:05 +07:00
Dmitry Gridin afb8ff1dd5 i18n: NativeDefinitions: add getter to property
#KT-37483
2020-03-24 15:25:53 +07:00
Dmitriy Dolovov 01558f48ae KLIB: Clean-up AbstractKlibLibraryInfo API 2020-03-24 13:37:51 +07:00
Dmitriy Dolovov f46fc7d848 IDE: Fix i18n for KlibMetaFileType 2020-03-23 15:39:33 +07:00
Dmitriy Dolovov f4aa0fad44 IDE: Unify creation of KLIB package fragment providers (common, native) 2020-03-23 15:39:27 +07:00
Dmitriy Dolovov bf4a153c0c IDE: Use CachingIdeKlibMetadataLoader in Native & Common KLIB analysis 2020-03-23 15:39:21 +07:00
Dmitriy Dolovov c8a9b88504 IDE: Refactor NativePlatformKindResolution & NativeResolverForModuleFactory 2020-03-23 15:39:05 +07:00
Dmitriy Dolovov 98877eb87e IDE: Rename NativeLibraryInfo to NativeKlibLibraryInfo 2020-03-23 15:38:59 +07:00
Dmitriy Dolovov 816db96113 IDE: Drop NativeLibraryInfo.NATIVE_LIBRARY_CAPABILITY 2020-03-23 15:38:53 +07:00
Dmitriy Dolovov 5f7a6d55a8 KLIB: Fix compilation 2020-03-23 15:38:46 +07:00
Dmitry Savvinov 26ab9b4fc9 Move Klib-related logic from idea-native module 2020-03-23 15:38:40 +07:00
Dmitry Savvinov 417554dca0 Move .klib files from KotlinNativeFileTypeFactory to Kotlin-wide one 2020-03-23 15:38:32 +07:00
Dmitry Savvinov 987e1019a8 Rename everything non-Native specific to Klib 2020-03-23 15:38:26 +07:00
Dmitry Savvinov b6d811c69c Extract common logic of detecting klibs and creating LibraryInfo by klib 2020-03-23 15:38:19 +07:00
Dmitry Savvinov 6ccb8cd0a3 Properly check platform of klib by reading manifest 2020-03-23 15:38:11 +07:00
Zalim Bashorov eaac5bdac4 [IDE KN] Treat klib as Kotlin/Native library iff manifest contains builtins_platform==NATIVE 2020-03-20 01:27:41 +03:00
Dmitriy Dolovov 94df78aea0 K/N in IDE: Drop support of "konan.native" package 2020-03-16 19:52:28 +07:00
Dmitry Gridin 7507d62ec3 i18n: replace KotlinBundleBase with AbstractKotlinBundle 2020-03-16 18:40:49 +07:00
Roman Golyshev c3cbcc0842 i18n: move all kotlin bundles to resources/messages directories 2020-03-16 18:40:47 +07:00
Yan Zhulanow f1d21b02e9 i18n: Add bundle for idea-native 2020-03-16 18:40:42 +07:00
Roman Artemev 25a91a217e [KLIB] Fix package for NullFlexibleTypeDeserializer 2020-02-26 14:55:53 +03:00
Dmitriy Dolovov acc3395ca5 IDE: Don't analyze incompatible KLIBs with components
Issue #KT-36213
2020-02-01 17:07:13 +07:00
Dmitriy Dolovov 4336096775 Use "tooling" KLIB resolve strategy in IDE and commonizer
Issue #KT-36213
2020-02-01 17:07:02 +07:00
Dmitriy Dolovov 9594b8db42 Rename Kotlin/Native modules for uniformity 2020-01-29 20:30:46 +07:00