Commit Graph

39019 Commits

Author SHA1 Message Date
Dmitry Jemerov f113a5ce99 Fix stdlib-jre7/8 configuration in new projects
#KT-17875 Fixed
 #KT-17876 Fixed
2017-05-16 11:45:35 +02:00
Denis Zharkov 57cb556efd Update rendered public API in coroutines package
- suspendCoroutine is not public anymore, since all of the
inline functions are generated as private
- `label` is public to allow update it from the named functions
2017-05-16 11:38:59 +03:00
Denis Zharkov 2c5baf6c08 Make companion object private to avoid its presence in public API 2017-05-16 11:38:59 +03:00
Denis Zharkov d24d3a73d7 Support open suspend members and super-calls
The problem was that the resume call (from doResume) for open members
was based on common INVOKEVIRTUAL to the original function
that lead to the invocation of the override when it was expected
to be the overridden (after super-call being suspended)

The solution is to generate method bodies for open members into
the special $suspendImpl synthetic function that may be called
from the doResume implementation

 #KT-17587 Fixed
2017-05-16 11:38:59 +03:00
Denis Zharkov e75b6c8404 Perform fix-stack transformation before method analysis
Otherwise it might fail on an "invalid" bytecode
2017-05-16 11:38:59 +03:00
Denis Zharkov dcaad530ce Make code generation in method transformer more stable
Do not mix references to label nodes and common ASM labels
as it may lead to different LabelNode instance (not defaultLabel)
being inserted into insns list

It's been working before because there was no `resetLabels` call
on insnList, and label/label nodes were bound to each other
2017-05-16 11:38:59 +03:00
Denis Zharkov 4033786902 Minor. Drop always-false parameter in fix-stack utils 2017-05-16 11:38:59 +03:00
Denis Zharkov d362fa6eea Minor. Use trailing lambda syntax in FixStackMethodTransformer 2017-05-16 11:38:59 +03:00
Dmitry Jemerov 675305fef3 Don't highlight 'this' references as deprecated
#KT-17613 Fixed
2017-05-15 14:57:52 +02:00
Yan Zhulanow 5d31e00d27 Allopen, Gradle: Fix JPS build on Windows (KT-17830)
Appears that plugin classpath can contain not only `File.separatorChar`, but also '/' on Windows. Without the proper handling of this case, Gradle importer may import the plugin JAR made for Gradle with shaded 'com.intellij' and cause an exception during the JPS build.
2017-05-15 14:42:01 +03:00
Sergey Mashkov fd0578b564 KT-10028 Support parallel builds in maven
Mark mojo's as thread safe as users confirmed that all related errors
seem to be fixed
2017-05-15 12:55:33 +03:00
Alexander Udalov 3f5b8b3f68 Refactor JvmDependenciesIndexImpl.search
- use nullable type "T?" instead of HandleResult consisting of the found
  value and the "should continue" flag
- inline all local functions because they don't add any value now
2017-05-15 12:17:46 +03:00
Alexander Udalov 939f969f12 Support .jar archives in friend paths (for internal visibility) 2017-05-15 12:17:45 +03:00
Mikhail Zarechenskiy ac8fbce249 Fix false "useless cast" when target type is flexible
#KT-17820 Fixed
2017-05-15 11:24:39 +03:00
Mikhail Zarechenskiy a8f1e32dec Refactoring: move utils related to casts to CastDiagnosticUtil 2017-05-15 11:24:37 +03:00
Mikhail Zarechenskiy b323d2b24a Refactoring: extract method to detect redundant is out 2017-05-15 11:24:36 +03:00
Dmitry Neverov cd24adac32 Detect redundant 'is' check
#KT-14187 Fixed
2017-05-15 11:24:35 +03:00
Mikhail Glukhikh 768e0fa738 Add forgotten KotlinAbstractUElement.hashCode() 2017-05-12 22:27:58 +03:00
Nikolay Krasko c5a8001aa4 Revert generated formatter tests 2017-05-12 20:16:22 +03:00
Simon Ogorodnik a0a6ef4f2e Use ModalityState.any() for J2K post processing
#KT-17870 fixed
2017-05-12 17:53:50 +03:00
Nikolay Krasko 861cac5b52 Better indent in multi-line strings (KT-17849)
Inspired by MultilineStringEnterHandler from https://github.com/JetBrains/intellij-scala
https://github.com/JetBrains/intellij-scala/blob/edb741f344afff063197b406ca0c7c266a26c436/src/org/jetbrains/plugins/scala/editor/enterHandler/MultilineStringEnterHandler.scala

 #KT-17849 Fixed
2017-05-12 17:34:05 +03:00
Nikolay Krasko 30639b0a5e Allow injection in strings with interpolation (KT-6610)
#KT-6610 In Progress
2017-05-12 17:33:37 +03:00
Dmitry Jemerov f53b9aa419 Improve diagnostics for EA-100849
KNPE: DeserializerForClassfileDecompilerKt.DeserializerForClassfileDecompiler
2017-05-12 12:34:54 +02:00
Dmitry Jemerov db1f8c7541 EA-100074 - SOE: ExpressionsOfTypeProcessor.containsTypeOrDerivedInside 2017-05-12 12:33:46 +02:00
Dmitry Jemerov ddcde3f688 EA-101095 NSEE: KotlinUsageToPsiElementProvider.getAppropriateParentFrom) 2017-05-12 12:33:45 +02:00
Dmitry Jemerov 4e58319d1b Revert "Deprecated setting was used for import optimization on the fly. (#1049)"
This reverts commit 75d231cc37.
The added API is available only in IDEA 2017.1.1, not in the original 2017.1 build.
2017-05-12 12:33:45 +02:00
Anton Bannykh e098de5e33 JS: fix char boxing in elvis expressions (#KT-17700 fixed) 2017-05-11 21:31:38 +03:00
Mikhail Glukhikh a1e00ed9f1 Don't suggest "if to ?." without else when used in expression position 2017-05-11 20:47:16 +03:00
Mikhail Glukhikh 326d850760 Use "if-then to" even for 'if (arg != null) arg' removing 'if' 2017-05-11 20:47:10 +03:00
Mikhail Glukhikh 977d8e1cd7 If to safe access: fix message when no dot calls are available
Now "Replace 'if' with safe cast" is suggested
2017-05-11 20:47:04 +03:00
Mikhail Glukhikh a77390ccd6 Change both IfThenTo... inspections highlight level
Retain WEAK WARNING for null checks, one-liners,
and is checks without dot calls in main branch.
Set INFORMATION (no highlighting, just fix) for other cases.

Switch off both bound intentions.
So #KT-15076 Fixed
2017-05-11 20:46:51 +03:00
Mikhail Glukhikh 2d9a5afb15 Refactoring: convert problemHighlightType to function with parameter 2017-05-11 20:46:37 +03:00
Mikhail Glukhikh d9a33af61e Reduce range of IfThenTo... inspections to just 'if' 2017-05-11 20:46:31 +03:00
Mikhail Glukhikh 781a45c747 Minor refactoring: IfThenToSelectData.clausesReplaceableByElvis 2017-05-11 20:46:24 +03:00
Mikhail Glukhikh f3ee5ea45f IfThenToDoubleBang: fix AWT from writeAction problem 2017-05-11 20:46:17 +03:00
Mikhail Glukhikh 66c5717adc Refactoring of IfThen: ToDoubleBang / ToElvis / ToSafeAccess
Some common actions were extracted to IfThenUtils.kt
Use consistent logic in all three intentions
Also fixes potential PSI consistency problems in conversions dot->safe calls
2017-05-11 20:46:11 +03:00
Dmitry Neverov fd6d1520c7 Convert 'if' with 'is' check to 'as?' with safe call #KT-17054 Fixed 2017-05-11 20:46:05 +03:00
Mikhail Glukhikh 0361ed8c68 Refactoring: SelfTargetingIntention / IntentionBasedInspection
Remove complex logic which disables intention when bound inspection on
Add much simpler logic in SelfTargetingIntention.equals
2017-05-11 20:45:59 +03:00
Alexey Andreev 1900b20e6e Implement inlining of Array constructor in JS BE
See KT-15456
2017-05-11 17:10:45 +03:00
Mikhail Glukhikh 6523f237a6 Test fix (I hope so) from parameter info group 2017-05-11 16:38:51 +03:00
Mikhael Bogdanov 97bcf9f538 Add default lambda inlining prototype 2017-05-11 11:06:47 +02:00
Mikhael Bogdanov b7af4ac882 Add SKIP_INLINE_CHECK_IN directive to inline test framework 2017-05-11 11:06:47 +02:00
Mikhael Bogdanov daf6768181 Add proper DefaultLambda initialization,
patch lambda related instructions in default method

Remove default lambda linked instructions from default method
2017-05-11 11:06:46 +02:00
Mikhael Bogdanov ec066a06d8 Clean code after convertion to Kotlin 2017-05-11 11:06:45 +02:00
Mikhael Bogdanov 1e9ffe42b1 Convert MethodInliner.java to Kotlin 2017-05-11 11:06:44 +02:00
Mikhael Bogdanov e34f934aba Rename MethodInliner.java to MethodInliner.kt 2017-05-11 11:06:44 +02:00
Mikhael Bogdanov f915192827 Minor. Clean and refactoring after convertion 2017-05-11 11:06:43 +02:00
Mikhael Bogdanov 3fe152aad3 Convert AnonymousObjectTransformer.java to Kotlin 2017-05-11 11:06:42 +02:00
Mikhael Bogdanov 36c43b630e Rename AnonymousObjectTransformer.java to AnonymousObjectTransformer.kt 2017-05-11 11:06:41 +02:00
Mikhael Bogdanov 980414674a Add default lambda parsing 2017-05-11 11:06:40 +02:00