Commit Graph

9020 Commits

Author SHA1 Message Date
Roman Golyshev 8020424b93 FIR IDE: Remove fake root prefix even when the element is not shortened 2021-02-12 10:53:17 +00:00
Roman Golyshev ee98a76600 FIR IDE: Implement simple importing of the functions
This is not a complete algorithm, but it already works in many cases

Disable some tests that not yet work
2021-02-12 10:53:16 +00:00
Roman Golyshev 51c59e5634 FIR IDE: Check function call before trying to drop the receiver 2021-02-12 10:53:14 +00:00
Roman Golyshev d88fd5bd73 FIR IDE: More strictly navigate to parent KtDotQualifiedExpression 2021-02-12 10:53:14 +00:00
Roman Golyshev e265a78a33 FIR IDE: Implement shortening and import for type qualifiers 2021-02-12 10:53:13 +00:00
Roman Golyshev 0e271b72c7 FIR IDE: Do not try to shorten type without qualifier 2021-02-12 10:53:12 +00:00
Roman Golyshev 534f4a66ad FIR IDE: Add simple shortening for qualified calls and properties 2021-02-12 10:53:12 +00:00
Roman Golyshev f03ca5ea57 FIR IDE: Add import in case when conflicting class comes from * import 2021-02-12 10:53:11 +00:00
Roman Golyshev 0b48416a1e FIR IDE: Unwrap nullable types 2021-02-12 10:53:10 +00:00
Roman Golyshev 08e271411f FIR IDE: Create fake scopes to avoid import duplicates 2021-02-12 10:53:09 +00:00
Roman Golyshev e34370554d FIR IDE: Add simple types importing
Some tests are not passing
2021-02-12 10:53:09 +00:00
Roman Golyshev 8575ce32d4 FIR IDE: Add more tests for type conflicts 2021-02-12 10:53:07 +00:00
Roman Golyshev e744084c15 FIR IDE: Enable types shortening for nested classes and nested types 2021-02-12 10:53:07 +00:00
Roman Golyshev b9d074051f FIR IDE: Add separate tests for FIR reference shortening 2021-02-12 10:53:06 +00:00
Roman Golyshev 108395fcfe FIR: Fix bug with incorrect source element for qualifiers 2021-02-12 10:53:04 +00:00
Dmitriy Novozhilov f3a8fcaea6 [FE] Make constructors of sealed classes protected instead of internal 2021-02-12 13:36:38 +03:00
Mark Punzalan 7962224804 FIR IDE: Add quickfix for VAR_OVERRIDDEN_BY_VAL. 2021-02-11 11:11:00 +01:00
Ilya Kirillov 91e135888d FIR IDE: introduce HLSpecifyExplicitTypeForCallableDeclarationIntention and HLRedundantUnitReturnTypeInspection 2021-02-09 17:15:41 +01:00
Ilya Kirillov e269b1d19d FIR IDE: temporary mute failing tests 2021-02-09 17:15:32 +01:00
Ilya Kirillov d72a2d39da FIR IDE: ignore not passing quickfixes tests 2021-02-09 17:15:31 +01:00
Andrei Klunnyi e3c1aa599d KT-44487 [Sealed Interfaces]: sealed-inheritors-provider for MPP 2021-02-09 12:54:51 +00:00
Igor Yakovlev 04017b00a1 [FIR IDE] Fix TypeRef resolve to error type caused by invalid number of arguments 2021-02-08 11:57:39 +03:00
Pavel Kirpichenkov 9f7d7e55da Consider platform compatibility in library usage index
Logic of module dependencies is enhanced to filter out incompatible
common -> platform dependencies. However the reversed index for getting
all modules that use libraries doesn't take this filtering into
account and returns all modules based exclusively on order entries.
This leads to incorrect library dependency calculation.

^KT-44638 Verification pending
2021-02-05 16:36:59 +03:00
Andrei Klunnyi 690fb47cbb KT-44079 [Sealed Interfaces]: move refactoring update
The idea behind this commit is that Move Refactoring should warn
developers in case their intention potentially breaks sealed
hierarchies (members must share the same module and package).

Provided algorithm has two goals:
- prevent destruction of correct hierarchies
- help in fixing broken ones
2021-02-03 10:04:26 +00:00
Igor Yakovlev 18cebe5131 [FIR IDE] Codereview minor refactoring
https://jetbrains.team/p/kt/review/2069/
https://jetbrains.team/p/kt/review/2070/
2021-02-01 21:21:03 +03:00
Igor Yakovlev 5d4606daaa [FIR IDE] Remove LightClassProvider 2021-02-01 21:21:02 +03:00
Igor Yakovlev c1cdf273a6 [FIR IDE] Fix test data fir parameters highlighting test 2021-02-01 21:21:02 +03:00
Igor Yakovlev 9f282e0ddc [FIR] Do not erase type arguments for unresolved method calls 2021-02-01 21:21:02 +03:00
Igor Yakovlev 659d2c13b4 [FIR IDE] Fix annotation value parameter and ctor resolve 2021-02-01 21:21:01 +03:00
Igor Yakovlev 019635189a [FIR IDE] Fix annotation call reference resolve to ctor 2021-02-01 21:21:01 +03:00
Vladimir Dolzhenko 913c298be8 Kotlin highlight passes are reworked
#KT-37702 Fixed
2021-02-01 13:18:38 +00:00
Alexander Udalov d022bb0248 Switch default JVM target to 1.8
#KT-29405 Fixed
2021-02-01 11:54:04 +01:00
Dmitriy Novozhilov 17230397e6 [Test] Update or drop some IDE tests about experimental coroutines 2021-01-28 13:19:34 +03:00
Dmitriy Novozhilov 4f8b12c96f [Test] Fix various tests according to switching to kotlin 1.5 2021-01-28 13:19:30 +03:00
Dmitriy Novozhilov ee1aff1012 [Test] Update different testdata according to changes in sealed classes 2021-01-28 13:19:29 +03:00
Dmitriy Novozhilov a6600cef47 [Test] Remove some outdated tests from LocalInspectionTestGenerated
Those tests are referring to outdated language features which are
  meaningless for language version 1.5
2021-01-28 13:19:29 +03:00
Dmitriy Novozhilov a9ef8bb32f [IDE] Update SuperClassNotInitialized to relaxed restrictions on sealed classes 2021-01-28 13:19:28 +03:00
Dmitriy Novozhilov 16e0c0b820 [Test] Update testdata of quickfix tests related to sealed classes 2021-01-28 13:19:28 +03:00
Ilya Kirillov 7284acc9f9 FIR IDE: use FirCaches in JavaSymbolProvider 2021-01-27 21:26:58 +01:00
Mikhail Zarechenskiy a33877a9b9 Fix add import quick fix for unresolved conventional invoke operator
After adding extension invoke on DeepRecursiveFunction in 1.4,
 the compiler start reporting another error and now it doesn't write
 info about callable descriptor. Therefore it's needed to use another
 source of info for expression type

 ^KT-40926 Fixed
2021-01-22 13:57:47 +03:00
Igor Yakovlev 243f85a4d6 [FIR IDE] Add base support for FIR incomplete types resolve 2021-01-21 15:20:30 +03:00
Ilya Kirillov 2a9779cd89 FIR IDE: resolve reference to intersection override member to overridden members 2021-01-15 17:23:09 +01:00
Ilya Kirillov e060778528 FIR IDE: implement assignment statement references 2021-01-15 17:23:07 +01:00
Ilya Kirillov 14d2b1be49 FIR IDE: resolve by-name-parameter call 2021-01-15 17:23:07 +01:00
Ilya Kirillov 861c9b8e45 FIR IDE: unmute passing tests
fix unmute passing
2021-01-15 17:23:04 +01:00
Ilya Kirillov c97c4fa99c FIR IDE: fix finding fir in container which have conflicting duplicate by name 2021-01-15 17:23:03 +01:00
Dmitry Savvinov 09286504b7 Add a bunch of tests on corner-cases in Gradle MPP Import
For most of those the behaviour isn't set in stone, though at the moment
of making that commit we're more or less sure that it's reasonable.

Behaviour in some cases might be more strictly enforces (as much as you
can enforce something in esoteric cases with misconfigured project
sturcture). Those are marked with comments with '!'.
2021-01-15 11:12:45 +03:00
Dmitry Savvinov 69261ca1e6 Add tests on precise platforms importing
Note the behaviour in 'precisePlatformsWithUnrelatedModuleHmpp': it is
incorrect, as set of platforms still contains unrelated platforms.

This is because in the current solution, some source-sets
(commonMain/commonTest) always receive COMMON platform and then it gets
coerced to set of targets actually seen in the project.This helps if
projects uses as much targets as current module (like in
precisePlatformsHmpp), but fails if it uses more targets than the
current module (like in precisePlatformsWithUnrelatedModuleHmppp)

The upcoming commits will fix that issue
2021-01-15 11:12:45 +03:00
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
Pavel Kirpichenkov 2df4d26b37 Built-ins in IDE: update tests
KT-33233
2021-01-14 17:28:14 +03:00