Commit Graph

55 Commits

Author SHA1 Message Date
Mikhail Glukhikh 121f0ec810 KT-14032 related: if expression to elvis now handles also is and !is checks 2016-10-11 16:13:06 +03:00
Valentin Kipyatkov c06e2d994e KT-13884 Exception "Invalid root block PSI element" on replacing trivial when-expression to if
#KT-13884 Fixed
2016-10-10 14:48:15 +03:00
Valentin Kipyatkov 21c2268f70 Protection against "<caret>" missing in test data
Many incorrect tests fixed
2016-09-27 18:05:26 +03:00
Kirill 1926825019 Make folding if to return/assignment work with if-else if-else #KT-13452 Fixed 2016-08-17 17:51:08 +03:00
Mikhail Glukhikh 3fe114fc24 When to if now add braces for if branches inside #KT-12942 Fixed
(cherry picked from commit 29a7bfe)
2016-07-12 17:27:03 +03:00
Mikhail Glukhikh 9470308fe7 If to when: more accurate comment handling #KT-12649 Fixed 2016-06-09 20:00:14 +03:00
Valentin Kipyatkov c45bee5327 KT-12040 "Replace when with if" produce invalid code for first entry which has comment
#KT-12040 Fixed
2016-05-04 18:25:26 +03:00
Mikhail Glukhikh 6b945ba103 Regular checkType() is now called during condition analysis, TYPE_MISMATCH_IN_CONDITION removed #KT-11998 Fixed 2016-04-27 18:12:28 +03:00
Alexander Udalov 8316953259 Fix double quotes in diagnostic messages
For diagnostics without any parameters, the given text is simply rendered as a
String, so no symbols should be escaped.

For diagnostics with parameters, the format in java.text.MessageFormat is used,
so one single quote is erased and two single quotes become one single quote in
the rendered text.
2016-03-30 21:41:43 +03:00
Mikhail Glukhikh fa069214fd if to when intention now detects effectively else branches in subsequent code + performs more accurate comment handling #KT-10750 Fixed
Also #KT-11424 Fixed
2016-03-18 18:47:32 +03:00
Pavel V. Talanov a4c005fefd Update existing test data depending on diagnostic parameter rendering 2016-02-26 14:45:11 +03:00
Valentin Kipyatkov c9f26de9f5 Introduce/eliminate when subject intentions to keep line breaks and comments 2016-02-13 10:20:19 +03:00
Valentin Kipyatkov ce54a2d4bd If to when conversion preserves comments too 2016-02-13 10:20:19 +03:00
Valentin Kipyatkov 0ed8eb0512 KT-5717 "Replace 'when' with 'if'" loses a comment
#KT-5717 Fixed
2016-02-13 10:20:19 +03:00
Natalia Ukhorskaya abd7ed5c70 Fix intention for when: insert '||' instead of ',' 2015-12-17 11:11:24 +03:00
Natalia Ukhorskaya 6a3ac66208 Intention tests: add runtime where necessary 2015-12-17 11:11:23 +03:00
Dmitry Petrov 0fe74a8b43 COMMA_IN_WHEN_CONDITION_WITHOUT_ARGUMENT is an ERROR now.
Migrated code.
Updated test data in IDE tests.
Dropped whenWithRangeTestsAndMultiConditions.kt:
"Introduce subject" is not applicable to 'when' with ||-ed conditions.
2015-12-11 10:43:16 +03:00
Yan Zhulanow 9d1af5a17e Fix tests: "infix modifier required" and "operator modifier required" errors 2015-11-27 15:51:11 +03:00
Yan Zhulanow a3ff3ffc45 Fix tests: "Placing function type parameters after the function name" error 2015-11-27 15:51:11 +03:00
Nikolay Krasko 911432c99c Use default render to check are all errors mentioned in tests. It's far more easier to read. 2015-10-28 13:39:46 +03:00
Denis Zharkov f0e3fd617d Adjust testData to CharSequence.length transformation 2015-10-14 20:39:35 +03:00
Valentin Kipyatkov db144a6121 Suggestions from expression itself to have higher priority + fixed incorect upper case naming 2015-06-29 19:36:49 +03:00
Valentin Kipyatkov 5a737b8973 Correctness check in JetPsiFactory.createExpression 2015-05-27 16:15:44 +03:00
Valentin Kipyatkov 38ac420057 Fixed bug in MergeWhenIntention 2015-05-14 01:10:10 +03:00
Valentin Kipyatkov 102aa661ee Moved intention based inspection classes to their intention classes + some renames 2015-05-14 01:10:08 +03:00
Valentin Kipyatkov b9486846e1 ElvisToIfThenIntention - smaller range + minor code improvements 2015-05-14 01:09:48 +03:00
Valentin Kipyatkov ada11ca5e9 Use of expressions instead of plain text when converting when's 2015-05-14 01:00:28 +03:00
Valentin Kipyatkov 76fc0c1418 FlattenWhenIntention - smaller range and refactoring 2015-05-14 01:00:28 +03:00
Valentin Kipyatkov 186dd5454d Added inspection based on IfNullToElvisIntention + moved intention based inspections into one file 2015-05-02 14:03:24 +03:00
Alexander Udalov c82308d3be Rename jet -> kotlin in idea 2015-01-13 01:15:14 +03:00
Alexander Udalov fe544eaf71 Rename jet -> kotlin in idea: intentions
org.jetbrains.jet.plugin.intentions -> org.jetbrains.kotlin.idea.intentions
2015-01-13 01:14:37 +03:00
Denis Zharkov 654411a0b0 Refactored tests using Array constructor:
Some moved to tests with stdlib
Some changed to use arrayOfNulls
2014-12-11 16:04:03 +03:00
Alexander Udalov a7b88e9485 Make CharSequence.length a function instead of property
And String.length as well.

This is done for JVM interoperability: java.lang.CharSequence is an open class
and has a function 'length()' which should be implemented in subclasses
somehow.

A minor unexpected effect of this is that String.length() is now a compile-time
constant (it wasn't such as a property because properties are not supported in
compile-time constant evaluation)

 #KT-3571 Fixed
2014-11-27 20:38:17 +03:00
Evgeny Gerashchenko fbcfed6757 Fixed EA-57220. 2014-10-15 11:51:01 +04:00
Evgeny Gerashchenko fda7aeecfb Simplified CodeTransformationTest. Only one doTest method remains, intention class is moved to test data. Merged other intention tests (SpecifyTypeExplicitlyTest, ConvertToBlock/ExpressionBodyTest) into this one. 2014-07-10 15:05:17 +04:00
Nikolay Krasko 0716b09920 Fix errors in intentions after parser fixes 2014-06-25 14:22:54 +04:00
Zalim Bashorov 247808e17b IDEA plugin: fixed crashing ifExpressionToElvis intention when applying to if expression which is part of another expression.
#EA-57307 fixed
2014-06-20 16:42:42 +04:00
Nikolay Krasko 3d588acd2d Add space between 'when' and '(' 2014-05-16 17:10:02 +04:00
Zack Grannan aec5ae5dd4 Added IfThenToDoubleBangIntention 2014-04-22 22:33:08 +04:00
Zack Grannan 8476a790bd Added DoubleBangToIfThenIntention 2014-04-22 22:33:08 +04:00
Zack Grannan e5054a4a54 Modified IfThenToElvis to not apply when using '!!' would be better 2014-04-22 22:33:08 +04:00
Natalia Ukhorskaya ed7a156553 Merge remote-tracking branch 'origin/pr/435'
Conflicts:
	idea/src/META-INF/plugin.xml
	idea/tests/org/jetbrains/jet/plugin/codeInsight/JetInspectionTestGenerated.java
2014-04-11 12:11:44 +04:00
Zack Grannan 867925d5a1 Added ifThenToSafeAccessInspection 2014-04-10 15:44:59 -07:00
Zack Grannan 328607a3ab Added ifThenToElvisInspection
Conflicts:
	idea/src/META-INF/plugin.xml
2014-04-10 14:43:18 -07:00
Zalim Bashorov b43958f4b3 Fixed tests after adding error checking for intention tests. 2014-04-01 20:49:24 +04:00
asedunov 85dbd8cf49 Merge pull request #410 from kuity/unnecessaryParensInWhenToIf
Fix KT-4385 "Unnecessary parentheses in "replace when with if"
2014-03-17 13:00:10 +01:00
Lingzhang 877b9f2d99 KT4385 Bug Fix for Unnecessary Parentheses in WhenToIfIntention 2014-03-13 21:26:03 -04:00
Zack Grannan 3862a3b5bc Added ifThenToSafeAccessIntention 2014-03-12 16:02:56 +04:00
Zack Grannan 1f720c8559 Added safeAccessToIfThen intention 2014-03-12 16:02:55 +04:00
Zack Grannan 1ca4bb0e79 Added ifThenToElvisIntention 2014-03-12 16:02:55 +04:00