Commit Graph

443 Commits

Author SHA1 Message Date
Valentin Kipyatkov 830e3ba073 Better code in j2k 2015-05-14 01:00:29 +03:00
Dmitry Jemerov 25959fefdc J2K: generate 'interface' keyword instead of 'trait' 2015-05-12 11:49:37 +02:00
Denis Zharkov 9101505eca Rework deparenthesize-like methods
- Extract private `deparenthesizeOnce` and repeat it until get the same expression

- Drop redundant parameter `deparenthesizeRecursively`

- Drop some usages of `safeDeparenthesize` in `deparenthesize`
  because even if `deparenthesize` returns null (i.e. something was not parsed)
  there is no sense in working with such expressions

Note, that `deparenthesize` now unwraps nested labels' declaration (see changes in testData),
but it seems to be reasonable
2015-05-07 22:36:15 +03:00
Valentin Kipyatkov 7d6145e105 J2K converter applies IfNullToElvisIntention automatically 2015-05-02 14:03:25 +03:00
Denis Zharkov 02659ca22d Adjust project code to new labels syntax 2015-04-30 10:16:42 +03:00
Denis Zharkov 44a55e5bf6 Adjust testData to new labels syntax 2015-04-29 14:03:11 +03:00
Denis Zharkov 5977302465 Adjust J2K to new labels syntax 2015-04-29 14:03:11 +03:00
Natalia Ukhorskaya f575890732 Change J2K API for Web Demo 2015-04-22 10:35:17 +03:00
Denis Zharkov 036f31f36b j2k: Generate class literals in throws 2015-04-21 08:08:32 +03:00
Mikhail Glukhikh d5aed62410 Smart casts for local variables not captured in a closure and not changed in a loop, see #KT-3175.
isLocalVariable added. Assignment / initialization analysis.
Control whether a variable is changed in a loop at the beginning and at the end of the loop.
Control whether a variable is captured in a closure. #KT-3175  Fixed. #KT-2266  Fixed.
Tests for variable null safety and for variables is/as operations.
Loop / closure / variable property tests are included.
Old tests changed in accordance with KT-3175. In particular, all three of testSmartcastImpossible were fixed.
2015-04-16 20:10:58 +03:00
Valentin Kipyatkov bb808b5620 Created module idea-test-framework and moved classes needed for idea tests there
Moved tests for completion and their test data into module idea-completion
2015-04-14 18:53:01 +03:00
Valentin Kipyatkov 63825c45dd First step: moved classes of test framework to another package 2015-04-14 18:53:00 +03:00
Alexander Udalov 94df191f86 Regenerate tests 2015-04-10 20:26:34 +03:00
Valentin Kipyatkov a0d2b00287 Code corrections on code review 2015-04-09 19:09:09 +03:00
Valentin Kipyatkov ea7732883e Tests: use errors dump instead of ALLOW_UNRESOLVED_REFERENCE 2015-04-09 19:09:08 +03:00
Valentin Kipyatkov f6e363abb8 J2K: replace overloads with optional parameters not only for constructors but for methods too 2015-04-09 19:09:07 +03:00
Valentin Kipyatkov ff4ff78307 Use of Kotlin wrapper methods instead of Application.runReadAction/runWriteAction and CommandProcessor.executeCommand 2015-04-09 19:09:07 +03:00
Valentin Kipyatkov 2440371cd9 Refactored code 2015-04-09 19:09:07 +03:00
Valentin Kipyatkov 3efc6cd383 J2K: default parameter values generated for secondary constructors too 2015-04-09 19:09:07 +03:00
Valentin Kipyatkov 9b80d49bab Generated constructors with default parameter values are marked with kotlin.jvm.overloads annotation 2015-04-09 19:09:06 +03:00
Valentin Kipyatkov 1afbb961ee KT-7135 Java to Kotlin converter should update usages in Java and Koltin code in the rest of the project
#KT-7135 Fixed
2015-04-09 19:09:06 +03:00
Denis Zharkov f85e92a247 j2k: Adjust annotation converter to last changes
Only parameter named `value` can be marked vararg
2015-04-07 19:31:30 +03:00
Stanislav Erokhin b703f59e04 Migrate kotlin sources, maven projects and stdlib to new lambda syntax 2015-04-07 13:08:53 +03:00
Valentin Kipyatkov 8f01130e8e Minor code corrections after review 2015-04-07 00:00:29 +03:00
Valentin Kipyatkov bcbe10ad2a Removed unused method 2015-04-07 00:00:29 +03:00
Valentin Kipyatkov 506f84fb8a KT-5959 Imports should be inserted on paste from java with conversion to Kotlin
#KT-5959 Fixed
2015-04-07 00:00:29 +03:00
Valentin Kipyatkov d0637ccaf4 Conversion from Java on paste: post processing of code really works 2015-04-07 00:00:28 +03:00
Valentin Kipyatkov 0ed7d228f6 Got rid of conversionScope parameter for JavaToKotlinConverter 2015-04-07 00:00:28 +03:00
Valentin Kipyatkov 4b32db5c5e KT-5289 J2K: Should show progress when conversion takes time
#KT-5289 Fixed
2015-04-07 00:00:28 +03:00
Zalim Bashorov 79739b7090 Fix build. 2015-04-06 18:20:00 +03:00
Ilya Gorbunov 95c2a4fb29 Fix split method usage: split temporary replaced with splitBy. 2015-04-01 18:17:06 +03:00
Denis Zharkov a4018d9eae Run "Add 'init' keyword in whole project" quickfix 2015-03-31 20:20:23 +03:00
Denis Zharkov 717f850470 Setup spacing rules for primary ctor's parts 2015-03-31 20:20:22 +03:00
Valentin Kipyatkov 0b27d9181a Minor code corrections after review 2015-03-31 16:10:24 +03:00
Valentin Kipyatkov d5326031c4 J2k: for through range with != comparison is also recognized 2015-03-31 16:10:24 +03:00
Valentin Kipyatkov 11b4e66fd0 Better tests 2015-03-31 16:10:24 +03:00
Valentin Kipyatkov c66b20b204 KT-6795 J2K: When converting to type with projections, omit redundant use-site projections
#KT-6795 Fixed
2015-03-31 16:10:24 +03:00
Valentin Kipyatkov 7e50f72d5b J2K: no call to super constructor in the header of class when there is no primary constructor 2015-03-31 16:10:23 +03:00
Valentin Kipyatkov c57f2b10d6 J2K: use of emptyList, emptySet and emptyMap 2015-03-31 16:10:23 +03:00
Valentin Kipyatkov 1465418c2b KT-7151 Convert 'System.out.println()' to just 'println()'
#KT-7151 Fixed
2015-03-31 16:10:23 +03:00
Valentin Kipyatkov 39f94d7d45 KT-6044 J2K: Convert numeric float literals to 0.2f instead of 0.2.toFloat() + more fixes related to literals and type transformations
#KT-6044 Fixed
2015-03-31 16:10:23 +03:00
Valentin Kipyatkov 5454f7053f KT-6349 J2K: Static members of enums should be converted to class object members
#KT-6349 Fixed
2015-03-31 16:10:23 +03:00
Valentin Kipyatkov f19eb20803 KT-5287 J2K: Convert class with private constructor and static functions to "object" instead of class with "class object"
#KT-5287 Fixed
2015-03-31 16:10:23 +03:00
Valentin Kipyatkov 6dbb13c32d KT-6798 J2K: Needless use of run {} function after converting for-loop
#KT-6798 Fixed
2015-03-31 16:10:22 +03:00
Valentin Kipyatkov 46193f3ef7 KT-5692 Java to Kotlin conversion: convert int range loops in reverse order + a few more improvements
#KT-5692 Fixed
2015-03-31 16:10:22 +03:00
Valentin Kipyatkov 16295b875b Removed methods not need anymore 2015-03-31 16:10:22 +03:00
Valentin Kipyatkov fb4075cc2f J2K: inlining intermediate variable after removing type cast 2015-03-31 16:10:22 +03:00
Valentin Kipyatkov e31648a4b6 KT-6476 Kotlin J2K converter fails with for-loops with continues
#KT-6476 Fixed
2015-03-31 16:10:22 +03:00
Valentin Kipyatkov 2d4055e921 J2K: generating of elvis operators instead of if's 2015-03-31 16:10:22 +03:00
Valentin Kipyatkov 0932cb4606 J2K: auto-replacing of if's with safe access 2015-03-31 16:10:22 +03:00