Commit Graph

17315 Commits

Author SHA1 Message Date
Mikhail Glukhikh 8f0c53d0de If then to elvis: handle nullability even with implicit receiver
So #KT-22741 Fixed
2018-04-27 17:26:50 +03:00
Mikhail Glukhikh 49165bdbef Cleanup: better visibility 2018-04-27 17:26:37 +03:00
Mikhail Glukhikh 7601aaf89f Reformat IfThenToElvisIntention 2018-04-27 17:26:36 +03:00
Denis Zharkov b75024e3e0 Fix memory leak related to diagnostics computation within light classes
Before this change, when somebody has requested the exact light class
we also store LazyJvmDiagnostic for it in a map inside DiagnosticHolder.

The problem is that LazyJvmDiagnostic retains a lot of memory:
GenerationState, bindingContext, etc.

At the same time, it commonly happens that light classes are being computed from Java resolve and diagnostics are obviously
unnecessary there.

The solution has two parts:
1. We don't retain diagnostics until somebody explicitly requested them
2. We force computation of LazyJvmDiagnostic to avoid retaining
backend's parts

The solution has a kind of drawback: for an opened in editor Kotlin file,
we'll run back-end twice for contained classes (analysis parts should be reused, though)

 #KT-24048 Fixed
2018-04-27 16:13:59 +03:00
Natalia Selezneva 26f1d6ae7c Update Icon for .kts and .gradle.kts files
^KT-23431 Fixed
2018-04-27 13:52:31 +03:00
Natalia Selezneva 9107ef6490 New Script File Action
^KT-10935 Fixed
2018-04-27 13:52:26 +03:00
Natalia Selezneva 1d8d1e847a Minor: add debug name for ErrorGradleScriptDefinition 2018-04-27 13:52:22 +03:00
Natalia Selezneva ec63efec3c Debugger: refactor list of breakpoints for the line with lambdas.
^KT-24136 Fixed

Rename main line breakpoint to "Line"
Change icon for lambda-breakpoint
Move "all breakpoint" to the end of the breakpoints list
2018-04-27 13:52:06 +03:00
Nikolay Krasko 8bce29df3a Show plugin installation status in Kotlin Updates settings (KT-23980)
#KT-23980 Fixed
2018-04-27 13:08:28 +03:00
Nikolay Krasko bf82da7584 Perform auto-check initial and checks after switching channels (KT-23980)
#KT-23980 Fixed
2018-04-27 12:16:37 +03:00
Nikolay Krasko 64845ac3b7 Better UI for configure plugin updates (KT-23980)
- Control with Alt + Letter
 - Don't stretch channel combobox
 - Focus on label selection

 #KT-23980 Fixed
2018-04-27 12:16:37 +03:00
Nikolay Krasko 748e213598 Move Kotlin update channel setting to settings dialog (KT-23980)
#KT-23980 Fixed
2018-04-27 12:16:37 +03:00
Nikolay Krasko 144c41576e Refactoring: inline KotlinInternalMode.enabled 2018-04-27 12:16:37 +03:00
Nikolay Krasko 82a21b3955 Move Kotlin internal actions to Internal menu and unify modes (KT-23975)
#KT-23975 Fixed
2018-04-27 12:16:36 +03:00
Nicolay Mitropolsky 8e91f31182 UnimplementedKotlinInterfaceMemberAnnotator: use modifier list to be compatible with 172 2018-04-26 20:40:26 +03:00
Simon Ogorodnik 9e6cf5708e Fix J2K plain-text copy conversion test in 181 2018-04-26 17:37:29 +03:00
Mikhael Bogdanov ec0b9aa343 Skip @JvmDefault in UnimplementedKotlinInterfaceMemberAnnotator
#KT-23967 Fixed
2018-04-26 15:36:42 +02:00
Pavel V. Talanov a4e327c137 Mpp: KT-23457, fix importing common classes into common modules
Add test for KT-23457
NOTE: fixes 'importClassInCommon' test
Other test cases added to increase coverage

 #KT-23457 Fixed
2018-04-26 15:33:51 +02:00
Pavel V. Talanov 64a28dd542 QuickFixMultiModuleTest: fix test code
Adjust test data
2018-04-26 15:33:48 +02:00
Denis Zharkov 003f381fcd Replace default-type dependencies to :kotlin-stdlib with distJar
Use distJar configuration instead.
It's necessary because currently when using default-type, subproject
starts having a transitive dependency to :kotlin-stdlib-common
and that leads to exception from KT-20897 when building light classes

This change might be reverted once KT-23942 is fixed

 #KT-23942 Submitted
2018-04-26 16:11:27 +03:00
Nikolay Krasko ac97075020 Check only one class in JS decompiler tests to reuse test data
JVM tests check only single class result, in order to reuse test data
JS tests should do the same. CHECK_PACKAGE is introduced to override
this behaviour explicitly.
2018-04-24 18:51:27 +03:00
Toshiaki Kameyama e58d9c5507 Add intention for converting to block comment and vise versa
So #KT-23137 Fixed
2018-04-24 11:57:56 +03:00
Ilmir Usmanov f60787d57c Move coroutines to kotlin.coroutines package: tests
Introduce COMMON_COROUTINES_TEST directive.
Every test with this directive is run twice: one time with
language version 1.2 and kotlin.coroutines.experimental package
and the other time with language version 1.3 and kotlin.coroutines
package. Each run is a separate method: with suffixes _1_2 and _1_3
respectively.
However, since codegen of release coroutines is not supported in JS
backend, we generate only one method: with suffix _1_2.
 #KT-23362
2018-04-23 21:51:59 +03:00
Nicolay Mitropolsky ebdee1f24c 182: JvmDeclarationSearcher-implementation for Kotlin based on light-classes
#KT-23764
2018-04-23 21:37:58 +03:00
Pavel V. Talanov 7daf44a806 Fix bunch files after mpp changes 2018-04-23 18:56:36 +02:00
Alexander Udalov 965e3ebab2 Do not serialize SOURCE-retained annotations
Also, fix the value of "hasAnnotations" flag to reflect if there are any
_non-source_ annotations on a declaration.

Unfortunately, after this change
IncrementalJsCompilerRunnerTestGenerated$PureKotlin.testAnnotations
starts to fail because of the following problem. The problem is that
annotations on property accessors are not serialized yet on JS (see
KT-14529), yet property proto message has setterFlags field which has
the hasAnnotations flag. Upon the full rebuild of the code in that test,
we correctly write hasAnnotations = true, but annotations themselves are
not serialized. After an incremental build, we deserialize property
setter descriptor, observe its Annotations object which happens to be an
instance of NonEmptyDeserializedAnnotationsWithPossibleTargets. Now,
because annotations itself are not serialized, that Annotations object
has no annotations, yet its isEmpty always returns false (see the code).
Everything worked correctly before the change because in
DescriptorSerializer.hasAnnotations, we used Annotations.isEmpty and the
result was the same in the full rebuild and in the incremental scenario.
But now we're actually loading annotations, to determine their
retention, and that's why the setterFlags are becoming different here
and the test fails

 #KT-23360 Fixed
2018-04-23 18:42:33 +02:00
Alexander Udalov 361f686124 Move ModuleMapping and BinaryModuleData to metadata.jvm 2018-04-23 18:42:32 +02:00
Alexander Udalov d0544a148a Minimize dependencies of ModuleMapping
Prepare it to be moved to metadata.jvm
2018-04-23 18:42:32 +02:00
Nikolay Krasko 5817a7fdac Prevent endless processing of problem pending events
If some pending event processing caused exception in PerModulePackageCacheService,
log the problem and consider event processed. Otherwise it is going to
be stuck there forever.
2018-04-23 16:41:14 +03:00
Nikolay Krasko 00119c309c Don't call findChild on invalid file in ImplicitPackagePrefixCache 2018-04-23 16:41:14 +03:00
Nikolay Krasko 3f6022d74e Don't show several lambda return inlay hints for elvis (KT-22436)
Don't show inlay hints on binary expression operands

 #KT-22436
2018-04-23 16:41:14 +03:00
Nikolay Krasko 2a7f195bbc Fix FoldingAfterOptimizeImportsTest for case-sensitive file systems
Broken in b6699d7522
2018-04-23 16:41:13 +03:00
Nikolay Krasko d085f3e474 Don't call elementAtCaret for file usage test (fix for 181)
Fix testPropertyFileUsages test in 181.

Starting from 181, call `elementAtCaret` with zero offset returns
null element, when file starts with comment. Test fails because
of that.

https://github.com/JetBrains/intellij-community/commit/fdebc4084b9067ec19933d45a1ef2e04861206c3
2018-04-23 16:41:13 +03:00
Nikolay Krasko ffca06d8a8 Drop specific behaviour in AbstractFindUsagesTest.kt for 172
It's OK to run find usages test under progress manager.
2018-04-23 16:41:13 +03:00
Nikolay Krasko c6f8c868ce Minor: remove unused FIND_FILE_USAGES directive 2018-04-23 16:41:13 +03:00
Nicolay Mitropolsky 06e65e5f48 182: removing Spring from Kotlin-Ultimate
because all necessary functionality is already in IDEA-Ultimate
2018-04-21 11:25:49 +03:00
Pavel V. Talanov 521357a22d Add tests for KT-20824, KT-23745, KT-23124, KT-20605, KT-23760
#KT-20824 Fixed
 #KT-23745 Fixed
 #KT-23124 Fixed
 #KT-20605 Fixed
 #KT-23760 Fixed
2018-04-20 20:00:12 +02:00
Pavel V. Talanov 94fe170b7b MPP: analyze platform sources with expectedBy common sources
This allows to emulate current compiler behaviour

Introduce CombinedModuleInfo which is a combination of several other modules intended to be analyzed together
2018-04-20 20:00:11 +02:00
Pavel V. Talanov 94dfcba5c5 Minor: adjust quick fix test data to avoid "conflicting overloads" 2018-04-20 20:00:07 +02:00
Pavel V. Talanov 3949fc70c9 Adjust test data for previously ignored tests 2018-04-20 20:00:05 +02:00
Pavel V. Talanov 5ddb7c71d1 Mpp resolve: fix actual/expect declaration lookup
Previously we would look fo expect declaration in common dependencies
    as opposed to looking inside the module exclusively
2018-04-20 20:00:04 +02:00
Pavel V. Talanov cdb49511e6 Mpp highlighting test: make generated, adjust test data
Note: this spawns new test cases which were ignored previously
2018-04-20 20:00:02 +02:00
Pavel V. Talanov 5a85f2437d Mpp test utils: allow to setup dependencies on stdlib and fulljdk
Allow to specify jjvm8 as platform
2018-04-20 20:00:00 +02:00
Mikhail Glukhikh c69dd98c86 Build fix: quick-fix tests (forgotten actions) 2018-04-20 20:55:27 +03:00
Alexey Sedunov 36975786e8 Gradle: Import project dependency with non-default configuration by its artifacts 2018-04-20 16:57:43 +03:00
Dmitry Jemerov 2a684684a5 Pass canChangeWhitespaceOnly flag in reformat inspection
Otherwise IDEA will run preformat and postformat processors, which don't
expect to run outside of EDT (IDEA-185991)
2018-04-20 15:38:35 +02:00
Alexey Sedunov 38808118b1 Misc: Update test data for MavenUpdateConfigurationQuickFixTest (181/182) 2018-04-20 16:19:25 +03:00
Nikolay Krasko c86e157a48 Fix KotlinFileStructureTestGenerated in 181
Use common code for 173 and 181.
2018-04-20 14:37:02 +03:00
Nikolay Krasko b6699d7522 Postpone analyze and remove direct working with BindingContext in folding
#KT-5206 Fixed
2018-04-20 14:37:01 +03:00
Aaron Nwabuoku 3a83983bfc Support code folding for standard library collection factory functions (KT-5206)
#KT-5206 Fixed
2018-04-20 14:37:01 +03:00