Commit Graph

64611 Commits

Author SHA1 Message Date
Vladimir Dolzhenko fa2fb667e6 Kotlinify JvmPluginStartupComponent p.2
Relates to #KT-38407
2020-04-24 09:39:42 +00:00
Vladimir Dolzhenko fe3cf88e45 Kotlinify JvmPluginStartupComponent p.1
Relates to #KT-38407
2020-04-24 09:39:42 +00:00
Vladimir Dolzhenko d6b4836ae0 Convert KlibLoadingMetadataCache into an application service
Relates to #KT-38407
2020-04-24 09:39:41 +00:00
Vladimir Dolzhenko 4535584f16 Convert KotlinUpdatePluginComponent into a startup activity
Relates to #KT-38407
2020-04-24 09:39:40 +00:00
Dmitry Gridin 60dc2f9674 i18n, MoveKotlinNestedClassesToUpperLevelDialog: add missing bundles for 201
#KT-38527 Fixed
2020-04-24 16:14:51 +07:00
Dmitry Gridin 6524e2b764 i18n, debugger: add missing bundles for 201
#KT-38487 Fixed
2020-04-24 16:13:44 +07:00
Alexander Udalov 403cdedf2e Remove unnecessary dependencies of 'fir2ir:jvm-backend' 2020-04-23 23:16:30 +02:00
Alexander Udalov 2815bb88c2 Remove unnecessary dependency of 'fir2ir' on 'ir.backend.common'
Move some lookup utilities which are used in
`OperatorExpressionGenerator`, to 'ir.tree'.
2020-04-23 23:16:29 +02:00
Valentin Kipyatkov 0c3c8b64ce Optimization for faster search of references to top-level members 2020-04-23 22:12:26 +03:00
Valentin Kipyatkov ec057a6c00 Minor change after review 2020-04-23 22:12:26 +03:00
Valentin Kipyatkov 56b20b0f31 Data Flow from Here: do not include named argument references 2020-04-23 22:12:25 +03:00
Valentin Kipyatkov 7c81d93db0 Data Flow to Here: process data-class copy-method calls 2020-04-23 22:12:25 +03:00
Natalia Selezneva 7f8b3b6a79 Minor: rename function 2020-04-23 20:14:03 +03:00
Natalia Selezneva 574f57e604 Minor: extract class to separate file 2020-04-23 20:14:02 +03:00
Natalia Selezneva 25dc8b7766 Minor: rename files 2020-04-23 20:14:02 +03:00
Natalia Selezneva 294df3a7e9 201: Implement floating notification update 2020-04-23 20:14:02 +03:00
Natalia Selezneva 2fba813a53 Rework the notification for scripts out of project
Add an option to link external gradle project
remove an option to load configuration manually because it cannot be implemented properly: script configurations for those scripts shouldn't be loaded during import for Gradle 6.0

^KT-37178 Fixed
2020-04-23 20:14:02 +03:00
Natalia Selezneva 85141b753b Show notification that gradle project is needed to be imported to get code insight for kotlin scripts 2020-04-23 20:14:01 +03:00
Natalia Selezneva 69d86a2972 Fix getting default sdk for scripts after refactoring 2020-04-23 20:14:01 +03:00
Sergey Rostov 73760effee Refactor GradleScriptingSupport to support multiple gradle projects linked to one idea project
For each externalGradleProject separate GradleScriptingSupport is created.
This allows to save script configurations by gradle projects

^KT-37806 Obsolete
^KT-35151 Fixed
2020-04-23 20:14:01 +03:00
Natalia Selezneva 34df3066b3 Fix messages for script configuration loading
Remove word "dependencies" from UI, use "configuration" instead
2020-04-23 20:14:01 +03:00
Natalia Selezneva f3687dcd00 Extract utils methods for getting gradle project settings 2020-04-23 20:14:01 +03:00
Natalia Selezneva f5f69ccc1b Fix getting gradle version for new project 2020-04-23 20:14:01 +03:00
Natalia Selezneva 3904e0f97c Fix indexing for force load configuration action 2020-04-23 20:14:00 +03:00
Natalia Selezneva c52e5d180a Fix compilation for AS35 2020-04-23 20:14:00 +03:00
Natalia Selezneva b472e915e6 Minor: rename files 2020-04-23 20:14:00 +03:00
Natalia Selezneva 217696fad5 Minor: rename class 2020-04-23 20:14:00 +03:00
Natalia Selezneva 3008010d73 Minor: extract class 2020-04-23 20:13:59 +03:00
Natalia Selezneva 59bdf67aa2 Refactoring: extract separate manager to update script configurations of gradle scripts
The main goal is to extract logic that is related to Gradle scripts only to separate place.
Configurations for gradle scripts are updated during import simultaneously, there is no need to manage script configuration update for one file
Note that for Gradle less than 6.0 The DefaultScriptingSupport is used
2020-04-23 20:13:59 +03:00
Natalia Selezneva c6609e9a97 Temporary remove flacky assert from GradleKtsImportTest 2020-04-23 20:13:59 +03:00
Natalia Selezneva da76fff83c Remove unused parts 2020-04-23 20:13:59 +03:00
Natalia Selezneva 7ecaf35647 Fix javaHome storing KotlinDslScriptModels 2020-04-23 20:13:58 +03:00
Natalia Selezneva a35523b6d0 Implement global notification for configurations update of gradle scripts
For 193: it will be a simple notification at the bottom of the IDEA window
For 201: a floating notification in the editor is implemented near "Load Gradle Changes" icon
^KT-34443 Fixed
2020-04-23 20:13:58 +03:00
Natalia Selezneva e300b30de1 Do not use hard coded string literals in UI 2020-04-23 20:13:58 +03:00
Natalia Selezneva 1b7f72020e GradleScriptListener should be applicable for all gradle scripts
Not only for those that are in project
Otherwise changes in those unrelated to gradle project script will affect up to date of other scripts
2020-04-23 20:13:58 +03:00
Natalia Selezneva 426c0c9ff0 201: Run partial import in IDEA 2020.1 to get script configurations
It only requests for KotlinDslScriptsModel
^KT-34481 Fixed
2020-04-23 20:13:58 +03:00
Natalia Selezneva 10aeead925 Run gradle import instead of usage of scripting API during configurations update
For Gradle 6.0 or higher
^KT-34481
2020-04-23 20:13:57 +03:00
Natalia Selezneva 97e5ff858d Add ability to postpone script configuration loading
Show notification for scripts with out of date configurations

^KT-35573
2020-04-23 20:13:57 +03:00
Natalia Selezneva 7f5715f5da 201: KotlinDslScriptsModel: use ProjectModelContributor to process models
Instead of populateProjectExtraModels in Resolver
2020-04-23 20:13:57 +03:00
Ilya Goncharov 9e4c1ee4e8 [Gradle, JS] Add explanation comment on compiler type in KotlinJsCompilerTypeHolder 2020-04-23 18:43:19 +03:00
Georgy Bronnikov 565874b3a0 Pass along type in IfNullExpressionFusionLowering 2020-04-23 18:18:34 +03:00
Ilya Goncharov f95ff049c6 [Gradle, JS] Test check several ways to configure compiler type
#KT-38519 fixed
2020-04-23 18:09:59 +03:00
Ilya Goncharov 9a3bf54d9d [Gradle, JS] Add compiler type values on extension type
#KT-38519 fixed
2020-04-23 18:09:49 +03:00
Alexander Udalov 025d1ca64d psi2ir: rework representation of bound adapted function references
This fixes the problem in JVM IR backend which didn't pass bound
receiver value of an adapted function reference to the superclass
(kotlin/jvm/internal/AdaptedFunctionReference), which caused equals to
work incorrectly on such references (see changes in box tests).

Previously, bound adapted function reference was represented as
IrFunctionExpression to an adapter function which calls the callee. The
value of the bound receiver in that case could only be found in the body
of that adapter function. This is not very convenient, so this change
makes psi2ir produce a block of the adapter function + reference to it.
The bound receiver value is then found in the reference. This is
basically similar to what ProvisionalFunctionExpressionLowering is doing
for all function expressions. And since this IR structure is already
supported in FunctionReferenceLowering, the problem in the JVM IR is
fixed without any additional modifications.

However, inliners do not support this IR structure yet, see KT-38535 and
KT-38536.
2020-04-23 16:47:23 +02:00
Alexander Udalov 22bf23025a Minor, workaround IDE exception KT-38521 2020-04-23 16:46:32 +02:00
Konstantin Tskhovrebov 73a6dc6d1e Fix dependency for idea-fir module on 191 IDEA. 2020-04-23 17:22:59 +03:00
Ilya Goncharov f87f32c5a8 [Gradle, JS] root package json must run after simple package jsons
KT-34832
2020-04-23 17:21:17 +03:00
Jinseong Jeon 39e1635c41 [FIR2IR] Pre-cache original function type parameters for fake overrides 2020-04-23 17:19:44 +03:00
Martin Petrov bc96e42585 Produce deterministic klib files.
Build systems like bazel rely on the output of a compilation being
deterministic. File checksums determine when an artifact is safe to
cache across builds. One can produce a klib deterministically by using a
fixed timestamp during klib compression.

Before this change:

```
$ kotlinc-native  -produce library -output /tmp/first/color.klib Color.kt
$ kotlinc-native  -produce library -output /tmp/second/color.klib Color.kt
$ shasum  /tmp/first/color.klib /tmp/second/color.klib
bc3f73678ff025cfbec9009f9a851a8ca74e1037  /tmp/first/color.klib
65aa37886fbd53285f2e449a4dab6a2ad02732e6  /tmp/second/color.klib
```

After this change:

```
$ kotlinc-native  -produce library -output /tmp/first/color.klib Color.kt
$ kotlinc-native  -produce library -output /tmp/second/color.klib Color.kt
$ shasum  /tmp/first/color.klib /tmp/second/color.klib
fcba304493916ae34d372188991f87b60a113cf3  /tmp/first/color.klib
fcba304493916ae34d372188991f87b60a113cf3  /tmp/second/color.klib
```
2020-04-23 15:53:45 +03:00
Ilya Goncharov 923986d6a0 [Gradle, JS] Replace close on prepare
#KT-34832 fixed
2020-04-23 15:49:35 +03:00