Commit Graph

44 Commits

Author SHA1 Message Date
Toshiaki Kameyama 148f49d54a UselessCallOnCollectionInspection: fix false positive when lambda last statement is function call that returns generic type
#KT-38267 Fixed
2020-06-03 20:42:42 +03:00
Toshiaki Kameyama afd544cbab Introduce "Redundant 'asSequence' call" inspections
#KT-35893 Fixed
2020-06-02 22:17:54 +03:00
Toshiaki Kameyama 4638a97bbc "Call on collection type may be reduced": fix false positive with mapNotNull, generic lambda block and new inference
#KT-32801 Fixed
2020-05-27 02:38:40 +09:00
Toshiaki Kameyama 081d6c1dff Useless call on collection: propose 'Replace with toList()' instead of 'Remove useless call' if receiver is array type
#KT-38961 Fixed
2020-05-20 12:46:23 +03:00
Dmitry Gridin 50506658c0 fix some tests for as36 2020-05-08 19:13:28 +07:00
Dmitry Gridin 11a3482970 tests: apply official code style
#KT-38632 Fixed
2020-05-07 12:36:44 +00:00
Dmitry Gridin c34b417d0c Fix tests after disabling trailing comma
#KT-34744
2020-02-04 21:34:53 +07:00
Dmitry Gridin 96f49d8e3c Remove trailing comma from some tests 2020-01-30 15:32:09 +07:00
Dmitry Gridin d06787886a Fix tests after implementing trailing comma in formatter
#KT-34744
2020-01-17 21:02:54 +07:00
Toshiaki Kameyama c0f896c96a flatMap call could be simplified to flatten(): Fix false positive with Array
#KT-33204 Fixed
2019-08-23 14:12:17 +07:00
Yan Zhulanow a8d08815a6 Simplify call: Fix false positive in "filter {}" detection (KT-32468)
"Simplify filter {}" conversion changes semantics when the casted type is not a subtype if an initial collection element type.
This commit limits a replacement suggestion to subtype cases.
2019-08-07 01:15:28 +09:00
Mikhail Glukhikh 54411bd248 Simplifiable call: support case w/out receiver, add minor enhancements
Related to KT-30501
2019-05-07 14:28:20 +03:00
Mikhail Glukhikh e934eba6e4 Simplifiable call inspection: add filter -> filterIsInstance replacement
#KT-30501 Fixed
2019-05-07 14:28:18 +03:00
Mikhail Glukhikh 8913755e11 Simplifiable call inspection: add filter -> filterNotNull replacement
Related to KT-30501
2019-05-07 14:28:17 +03:00
Mikhail Glukhikh 4a5cbe0443 Replace "flatMap -> flatten" inspection with abstract "simplifiable call"
Related to KT-30501
2019-05-07 14:28:16 +03:00
Toshiaki Kameyama 47b1ea7fa4 SimplifiableCallChainInspection: replace .sorted().first() with .min()
#KT-30725 Fixed
2019-04-11 18:07:06 +03:00
Toshiaki Kameyama e4b10a156e SimplifiableCallChainInspection: fix tests 2019-04-11 18:07:06 +03:00
Toshiaki Kameyama 3de723b8d0 SimplifiableCallChainInspection: replace .sorted().firstOrNull() with .min()
#KT-30725 Fixed
2019-04-08 11:07:24 +03:00
Burak Eregar db4144426a Fix SimplifiableCallChain inspection quick fix removes comments for intermediate operations 2019-03-18 11:35:32 +03:00
Mikhail Glukhikh de33905c44 Fix formatting in "simplify call chain" #KT-28576 Fixed 2018-12-06 15:37:47 +03:00
Mikhail Glukhikh a3909d8e47 Refactor code in "simplify call chain" (relates to KT-28576) 2018-12-06 15:37:47 +03:00
Toshiaki Kameyama dc750cdbb3 Call chain into sequence: add 'unzip' to conversion targets #KT-27486 Fixed 2018-10-11 09:18:30 +03:00
Toshiaki Kameyama 3f252b15e1 Call chain into sequence: add 'flatten' to conversion targets #KT-26969 Fixed 2018-10-11 09:17:23 +03:00
Toshiaki Kameyama 9a725b99b2 Call chain into sequence: fix false negative on Iterable
#KT-26650 Fixed
2018-10-09 12:22:17 +03:00
Toshiaki Kameyama 539c55c5b2 Call chain into sequence: fix false negative on implicit receiver
Part of KT-26650
2018-10-09 11:33:55 +03:00
Toshiaki Kameyama 8fc5fefc7f Call chain --> Sequence: don't report if first call is 'groupingBy'
#KT-27104 Fixed
2018-10-09 11:26:50 +03:00
Toshiaki Kameyama 3c75dd7b5a Fix inspection message 2018-10-09 11:09:43 +03:00
Toshiaki Kameyama 920c200693 Call chain --> Sequence: introduce "call chain length" parameter
#KT-26571 Fixed
2018-10-09 11:09:28 +03:00
kenji tomita 6532916dd2 Change necessary labels in "Call on collection type may be reduced"
#KT-24492 Fixed
2018-10-03 08:00:40 +02:00
kenji tomita 6d9fb4f382 Fix #KT-26902 Bad quickfix name for "Call on non-null type may be reduced" 2018-09-19 15:56:26 +03:00
Toshiaki Kameyama 1d2e18e263 SimplifyCallChainFix: Keep comments in place #KT-22552 Fixed 2018-09-07 17:26:15 +03:00
Toshiaki Kameyama 2c71b3873e Introduce "flatMap { it } -> flatten" inspection #KT-25969 Fixed 2018-08-31 15:03:24 +03:00
Toshiaki Kameyama 6a140fb9ed "Useless call on collection type" inspection: Apply to 'kotlin.sequences.orEmpty' 2018-08-30 14:50:56 +03:00
Toshiaki Kameyama 7e28cb1fe3 Call chain --> Sequence: take termination into account
Related to KT-15476
2018-08-08 11:02:47 +03:00
Toshiaki Kameyama 108dea5b46 Introduce "Call chain on collection should be converted into 'Sequence'"
So #KT-15476 Fixed
2018-08-08 10:29:10 +03:00
Toshiaki Kameyama a059d50c8f "Call chain may be simplified": fix false positive on Java Map
So #KT-25089 Fixed
2018-08-03 13:15:53 +03:00
Toshiaki Kameyama bde9a57c9e Don't suggest map{}.filterNotNull() -> mapNotNull{} on primitive array
So #KT-21556 Fixed
2018-06-05 15:18:28 +03:00
Mikhail Glukhikh 45c9be2945 Fix problem with mutable map in "simplifiable call chain"
So #KT-20315 Fixed
2017-10-10 22:48:35 +03:00
Kirill Rakhman 91c35a6c59 Support listOfNotNull in SimplifiableCallChainInspection #KT-20410 Fixed 2017-10-09 16:38:52 +03:00
Mikhail Glukhikh d08b18f5f8 Introduce "use expression body" inspection #KT-16063 Fixed
Converted from the relevant intention
Reported cases: one-liners, whens
Also, more exact caret detection in local inspection tests
2017-07-07 18:15:06 +03:00
Mikhail Glukhikh fdca96634e Add restrictions for "simplifiable call chain" inspection
Do not use on maps; do not suggest for lambdas with return inside
Related to KT-18274
2017-06-29 16:25:55 +03:00
Mikhail Glukhikh 36be1fdaef Introduce "simplifiable call chain on collection" inspection
Related to KT-12165
So #KT-18274 Fixed
So #KT-17198 Fixed
2017-06-29 16:25:52 +03:00
Mikhail Glukhikh bdb9f00c75 Introduce "Useless call on collection type" inspection
Related to KT-12165
Supported functions: filterNotNull, filterIsInstance,
mapNotNull, mapNotNullTo, mapIndexedNotNull, mapIndexedNotNullTo

Also, "Useless cal on not-null" improved a bit
2017-06-29 16:25:50 +03:00
Mikhail Glukhikh 0f4ae3b727 Introduce "Useless call on not-null type" inspection #KT-18386 Fixed
Supported functions: orEmpty(), isNullOrEmpty(), isNullOrBlank()
2017-06-29 16:25:45 +03:00