Commit Graph

620 Commits

Author SHA1 Message Date
Nikita Barkov
149838abea [perf_test_kotlin]AT-695. Implemented move kotlin files test
GitOrigin-RevId: 318c1046a6d66fe0dd851435e3e75f855dc7587c
2024-07-05 14:14:58 +00:00
Tagir Valeev
d52f6c789f [java-dfa] IDEA-355908 Add new mutation contract option: io
GitOrigin-RevId: 206fae268d8444d475a4feac6ebc5ef96ffc57bb
2024-07-04 21:05:23 +00:00
Tagir Valeev
e1751e5f4d [java-refactoring] ConvertToInstanceMethodHandler: separate targetQualifiers computation logic from UI
GitOrigin-RevId: 4f0e3c3af486085920b3f3883935910cb9dd280e
2024-07-03 21:09:22 +00:00
Gregory.Shrago
92047f763d migrate getData to uiDataSnapshot: java
GitOrigin-RevId: 6917901f5fe425ee883779c2fc1775960c2af540
2024-07-01 17:55:51 +00:00
Tagir Valeev
e35d04820c [java-refactoring] IJPL-157516 T: InlineUtil.inlineVariable
GitOrigin-RevId: 89f3781736ca0f67437538878c26174286657973
2024-06-28 17:23:07 +00:00
Bas Leijdekkers
db923128c6 Java: take care to avoid calling a different method when converting static method to instance method (IDEA-275602)
GitOrigin-RevId: 644b0312256a7cd2859f18ba261bfc83addfb672
2024-06-28 17:14:56 +00:00
Bas Leijdekkers
a17097bea4 Java: no "this/new ClassName()" option for enums and implicit classes (IDEA-330992)
for "Convert to Instance Method" refactoring

GitOrigin-RevId: a353f19d817616c5445da3f7c60aa0a2f46ec155
2024-06-28 17:14:56 +00:00
Alexey Kudravtsev
679a71cd40 wildcardize parameters correctly
GitOrigin-RevId: 1041f4afb9f7970c1f28f79909a5a3a8ed6750af
2024-06-27 15:44:12 +00:00
Tagir Valeev
1ddafbe011 [java-refactoring] IDEA-354116 Make Static refactoring erroneously qualifies calls inside the anonymous inheritor of the outer class
GitOrigin-RevId: 732a36ab1c1577909e66175ac94efc4597121fe0
2024-06-26 11:52:02 +00:00
Tagir Valeev
19fb624028 [java] Use PsiUtil.getContainingClass instead of ClassUtils.getContainingClass
GitOrigin-RevId: f8a6abc7358a2c39dc4c50deaabe14c676f0977c
2024-06-26 11:52:02 +00:00
Tagir Valeev
5a32449b23 [java-refactoring] MakeStaticUtil: avoid recursion
GitOrigin-RevId: 705bfd2e37f16133bccaa6a6b27a458e0eccd11e
2024-06-26 11:52:02 +00:00
Tagir Valeev
e573732e7c [java-inspections] Extract method recommender: do not include initial comment into the length
Fixes IDEA-354492 "Method can be extracted" includes comments as minimum code length

GitOrigin-RevId: 3d4e34e6726f7917fe3b0224653b89f07cd2ae42
2024-06-21 13:49:43 +00:00
Alexandr Suhinin
ac42764da7 [extract method] IDEA-262123: return default variable value on unconditional exits
GitOrigin-RevId: eaf46751769ecddd3711de96c48b62f209878b27
2024-06-20 16:21:05 +00:00
Alexandr Suhinin
0f55d369e4 [extract method] IDEA-262123: disable extract method if there is a variable to return and a continue/break statement
GitOrigin-RevId: fc4b2f17bd1359740f8c2bde3948fe2b960a873e
2024-06-20 13:40:09 +00:00
Tagir Valeev
2b639d4b80 [java-refactoring] IntroduceVariableBase: use computeWithAlternativeResolveEnabled
GitOrigin-RevId: 82b6b1ab4bec9b12f65722d6b904ed1cd6ddc54b
2024-06-20 11:51:01 +00:00
Alexandr Suhinin
0baf44b97e [extract method] IDEA-354122: make static should pass local variables as method parameters
GitOrigin-RevId: e1c14880358479e7c6b151f0ece7ab6cdd8ac87e
2024-06-19 15:37:48 +00:00
Tagir Valeev
440654c48f Pattern variable can be used fixes; other warning fixes
GitOrigin-RevId: 49f37e7f5d748be50ee66fdf66a5c9b98b1b7432
2024-06-18 19:55:23 +00:00
Tagir Valeev
3fd0f4975d Pattern variable can be used fixes; other warning fixes
GitOrigin-RevId: 4965216d1872b439970db33dbe2864d5aab9606e
2024-06-18 19:55:23 +00:00
Mikhail Pyltsin
70f1723530 [java] IDEA-355024 use explicit modifiers for formatting and for suggestion.
GitOrigin-RevId: 770b9a3d009fe5734d0732feeebde54d3566819c
2024-06-18 13:55:12 +00:00
Mikhail Pyltsin
6568ebd170 [java] IDEA-355024 don't use hasModifier on EDT
GitOrigin-RevId: 039c84abb7051af0e49aef654ac68b825dfa7696
2024-06-18 13:55:12 +00:00
Mikhail Pyltsin
46c1a5c6e9 [java] IDEA-355024 try not to propose suggestion in dumb mode
GitOrigin-RevId: dca5096fb7079ef4623f100fb0e7c0ab37eb2df4
2024-06-18 13:55:12 +00:00
Mikhail Pyltsin
2023228d8c [java-generation] IDEA-344399 generate annotation based on type_use option
- extracted new option
- reuse this option in MissortedModifiersInspection
- override uses this option too

GitOrigin-RevId: 39f3f72991240753c86c7f80df865728aa9743ad
2024-06-17 21:14:57 +00:00
Tagir Valeev
20c7b3400a [java-refactoring] MoveInstanceMethod: moving abstract method to interface should not change the 'default' modifier
GitOrigin-RevId: db6aca91eed8c0d7bebe6bb86dd398a3a372bfab
2024-06-17 13:22:21 +00:00
Bas Leijdekkers
0715321e22 Java: fix Replace Constructor with Builder help id (IDEA-354682)
GitOrigin-RevId: b7e151303f3742c419a81ee1d9a00f6aa80e21b9
2024-06-14 13:20:40 +00:00
Alexandr Trushev
4dcc88eb48 IJPL-797 intellij.platform.editor review internal API
GitOrigin-RevId: 008ab023d706e3aa8dfe71ac1d5205f04fb8e71d
2024-06-11 20:04:46 +00:00
Tagir Valeev
5ae125edd4 [java-refactoring] MakeMethodStaticProcessor: handle member classes without qualified name
Fixes EA-1001747 - IOE: BasicJavaParserUtil.parseFragment

GitOrigin-RevId: 472bbc66731a0ed38f1d0fe7c79aa5faa02d1dc1
2024-06-11 13:02:11 +00:00
Anna Kozlova
cc2e5564bc [kotlin] extract function: don't validate on lookup selection
- defaultHandler is unable to finish template after validation for some reason

^KTIJ-30232 fixed

GitOrigin-RevId: 396ecc4dbd5840ad4aae3a270239c6d602fbef28
2024-06-07 20:11:53 +00:00
Anna Kozlova
6c2c2db190 [kotlin] extract function: suggest numeric name in case of conflict
- also validate name, chosen from lookup

^KTIJ-30166 fixed

GitOrigin-RevId: d346cd614784718cf8850ff7b074114154539575
2024-06-06 14:12:24 +00:00
Bart van Helvert
4171b97475 [kotlin] Add API for retargeting usages in MoveDirectoryWithClassesHelper
Various languages might have different requirements on how usages should be retargeted, this API allows implementations to define their own retargeting logic. #KTIJ-29395

GitOrigin-RevId: c411ef45ef091316a1fab9dd620e57c73d9975b9
2024-06-06 12:31:10 +00:00
Tagir Valeev
a8788fa3b8 [java-highlighting] Do not try to resolve star-import if existing explicit import fails to resolve
Otherwise, wrong class may be resolved in incomplete project model
AnonymousHashCode.java changed, because java.lang.Object import was unresolved (no JDK configured) and we now refuse to resolve to same-package class if there's a suitable explicit import
beforeHierarchy.java/afterHierarchy.java changed, because the import was incorrect, and it prevented importing implicit java.lang.Exception
predicates2.java changed: incorrect import removed (now prevents importing java.lang.String)
MoveInnerProcessor changes: import refs should be rebound first; otherwise they disallow to rebind normal refs
SpringDataMongoDbQueryCompletionTest changed: erroneous import removed

GitOrigin-RevId: f380409c445306bb9b8aceb5fe4dce1351511283
2024-06-04 20:27:13 +00:00
Bart van Helvert
9c9a813ea2 [java] Don't run move directory with classes helper on light classes
This move directory with classes helper should only be responsible for moving Java files. #KTIJ-30171 Fixed

GitOrigin-RevId: 7d4b11ae7b0185920c60f51f7a3a4f5e1f7e7006
2024-06-04 15:10:13 +00:00
Dmitry Krasilschikov
d072954e17 IDEA-344628 fix project leak in UsageContextPanel
GitOrigin-RevId: bdeb1de2db2d1284c3e972b9e5dfc79b8b361e5c
2024-05-17 12:46:24 +00:00
Nikolay Chashnikov
70676eed64 [java] API cleanup: remove unused deprecated API (IJPL-503)
GitOrigin-RevId: 36db2165d4a4bb133b7d63db944f6c8fe3490fa8
2024-05-16 18:00:17 +00:00
Tagir Valeev
1def0c841c [refactoring] Fix some raw-types in inplace introducers
GitOrigin-RevId: 8e2e93e1bfdd4ead7d0ef0b00aeacedbec7fe341
2024-05-15 10:31:43 +00:00
Tagir Valeev
7085a927d5 [mod-commands] ModCommandExecutor.executeInteractively convenience method
GitOrigin-RevId: ae163c5afe3391aa73e8b0898546de7e74ce2419
2024-05-12 17:34:00 +00:00
Mikhail Pyltsin
38cb4bb5f3 [java-refactoring] IDEA-352592 Rebind static import during moving inner class to new file
GitOrigin-RevId: 00174f0f8ced4e9316d30125e2302110671a5e4b
2024-05-10 18:25:13 +00:00
Tagir Valeev
d34e599418 [java-refactoring] IDEA-350228 Missing method body after moving an instance method from interface to non-abstract class
GitOrigin-RevId: a54261f44b8e07273962d3c8c6c2a3db62d6fccf
2024-05-08 17:35:06 +00:00
Tagir Valeev
11a73992ad [java-refactoring] MoveInstanceMethodProcessor: extract reference replacing code; cosmetics
GitOrigin-RevId: 767c7e074a41f7e33e67b2103e688feb9331d0d3
2024-05-08 17:35:05 +00:00
Tagir Valeev
20853b6789 [lang-impl] Deprecate NameSuggestionsField constructor that assumes the Java file type
Specify file types explicitly at call sites

GitOrigin-RevId: 140cf69a83dc8ee7526bb8d6450433e0e1188750
2024-05-08 12:07:44 +00:00
Georgii Ustinov
3a961fdccd [Java. Refactorings] Extract common base for test methods
IDEA-351758

GitOrigin-RevId: 3732c0bac541df2ae4d9a8fc103b0b9b625ed30d
2024-05-03 14:51:35 +00:00
Tagir Valeev
07da803111 [java-refactorings] Encapsulate field: fix possible NPE (IDEA-352883, EA-1109779)
GitOrigin-RevId: 014e5fd3c314a46a2271a17b11db3f3d92f8765f
2024-05-03 13:23:19 +00:00
Georgii Ustinov
4f9ab6b7b8 [Java. Refactorings] Make decision of renaming method based on its location in source root
IDEA-351758

GitOrigin-RevId: 193e44faa5b82e494b794571e3b88d3e2fe3c050
2024-05-02 13:15:31 +00:00
Anna Kozlova
8b9b938b08 [psi] pass originals for UpdateAddedFileProcessor
In all existing `UpdateAddedFileProcessor` originalElement was unused, probably because it was always null. To update kotlin packages only when they were aligned initially, it's necessary to have this original information.

^IDEA-352804 fixed

GitOrigin-RevId: ec08cf1c4172b9c284d1601d920c7fcd2c7ab08d
2024-05-02 09:56:34 +00:00
Anna Kozlova
4cc5e5f9cb [java] change signature: cleanup after review
KTIJ-28579

GitOrigin-RevId: 6c8a7857f2c1b55a67e0eab2d85b6984e969bb67
2024-04-29 21:00:19 +00:00
Tagir Valeev
e8b723c468 [java-refactoring] Inline local: go specifically one level up when searching for PsiReferenceExpression
Otherwise, it's possible to find something unrelated, e.g., if you are inside the lambda
Fixes IDEA-351780 Inline Local Variable inside lambda fails with error

GitOrigin-RevId: 8f0378975da117dfbc7086a67dac6fa6c9533a67
2024-04-26 14:23:13 +00:00
Bart van Helvert
41e3580cf8 [java] Don't compute conflicts for unrelated declarations
This caused some conflicts to be computed twice. Every `MoveHandler` should only compute conflicts it is responsible for moving.

GitOrigin-RevId: 7bca70630d7d57fcd4a5c6a6d1649fc1e53fb0eb
2024-04-25 13:51:29 +00:00
Anna Kozlova
8375e0f334 [java] change signature: ensure that nullability annotations which come from new type override existing non-TYPE_USE
- kotlin brings old annotations and thus it's very possible that after refactoring repeating annotations might appear

^KTIJ-28579 fixed

GitOrigin-RevId: 76f6a1e74827f7cc5f734e93a0c1324f5e068b88
2024-04-24 22:22:26 +00:00
Dmitry Batrak
881b370b95 RDCT-1092 Hotkeys are displayed incorrectly in popups on different OS
replace SystemInfo.isMac with ClientSystemInfo.isMac() in keyboard-shortcuts-related code

GitOrigin-RevId: 640604dff8e09d1aeccd0edc156873dd63c09fea
2024-04-22 19:16:22 +00:00
Alexey Belkov
5ea9f88846 Migrate deprecated usages of com.intellij.refactoring.suggested.range
GitOrigin-RevId: 2fd44594219500e1c8a84841bcd4326ed7e54083
2024-04-22 12:48:24 +00:00
Anna Kozlova
745be55ff1 [kotlin] k2 kmp change signature: special treatment for synthetic primary constructors
KTIJ-20436

GitOrigin-RevId: 2b63010902c65cdc059d931c6d64ab092e3a3870
2024-04-19 23:31:43 +00:00