Commit Graph

604 Commits

Author SHA1 Message Date
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
Georgii Ustinov
a526e56691 [Java. Refactorings] Show rename popup only when method is located outside the test class
IDEA-351758

GitOrigin-RevId: f4004e304639fa4f58d6bc4a67e5c137172482fc
2024-04-18 22:19:58 +00:00
Mikhail Pyltsin
74e210570e [java] Pattern variable can be used mass cleanup
GitOrigin-RevId: 46452d7711435b63fca78af3a6f634bcec862139
2024-04-18 14:03:54 +00:00
Tagir Valeev
5caf42dc70 [util] Merge NameUtilCore#uniqName into UniqueNameGenerator
GitOrigin-RevId: a43f8908b639a6e5b562be99af5f880a85cfac74
2024-04-16 19:06:47 +00:00
Tagir Valeev
43b02d2a23 [java-refactoring] Support parameters on conflict detection
GitOrigin-RevId: 308c1da92a04f6212c0e6bb764bdf6d940192b2d
2024-04-11 14:46:35 +00:00
Tagir Valeev
06977838b9 [java-refactoring] JavaUnresolvableLocalCollisionDetector: more precise collision detection (IDEA-350196)
GitOrigin-RevId: a46b338c88fa4407d45979b7291cab20f6c61de2
2024-04-11 14:46:15 +00:00
Tagir Valeev
59def66076 [java-inspections] JavaUnresolvableLocalCollisionDetector: better conflict resolution (IDEA-350196)
GitOrigin-RevId: d5f90829166860d33b5ac9fbb21570be8687a615
2024-04-09 10:29:14 +00:00
Tagir Valeev
ac165fab2d [java-refactoring] Separate description for pattern variable; tests for conflicts
GitOrigin-RevId: 8609f4658c1ceb0575372102b55128e098000dc6
2024-04-09 10:29:09 +00:00
Tagir Valeev
faf35d0309 [java-refactoring] Extract delegate: fix when field has eol-comment (IDEA-350071)
GitOrigin-RevId: 6647c1d115ec2b49334f647ffaf8c0981d24862d
2024-04-08 11:42:20 +00:00
Tagir Valeev
36cb2326fc [java-inspections] JavaUnresolvableLocalCollisionDetector: correct the scope of pattern variables
Fixes IDEA-350196 Redundant conflict report when renaming a pattern variable to 'ignored'

GitOrigin-RevId: 4c26d52897668f895fe46193de2704efca888ebb
2024-04-05 18:52:01 +00:00
Yuriy Artamonov
59597eb185 [platform] IJPL-938 Deprecate public utils in com.intellij.refactoring.suggested
Update usages

GitOrigin-RevId: d56e13ad1631e92d900ded8d89edbed7bf214c41
2024-03-29 22:09:46 +00:00
Bas Leijdekkers
76e1902f7e [java] fix in-place Introduce Parameter delegate option when introduce from local variable declaration (IDEA-349736)
GitOrigin-RevId: abef6928a1b46b548c20013518418bf922b832a4
2024-03-22 15:10:44 +00:00
Dmitry Drobotov
78a468c530 IDEA-349563 Use title as label for the signature preview text field in Change Signature and Extract Method dialogs
GitOrigin-RevId: 8854ebc6b3bb3e08a913e503c31fdafdbd37792d
2024-03-20 21:12:29 +00:00
Tagir Valeev
aed276dfd3 [java-inspections] Use LocalRefUseInfo in more contexts to avoid extra PSI traversals
GitOrigin-RevId: 0dae53843eebe7232460cad1c809223342824cd2
2024-03-20 14:22:13 +00:00
Tagir Valeev
21617c8137 [java-refactoring] Rename conflicting local class
IDEA-332489 Inlining refactoring operation leads to naming conflicts

GitOrigin-RevId: 4e239def02419e7a0a30097d3b3ec8cdb69911fd
2024-03-16 12:47:10 +00:00
Tagir Valeev
4228eb556f [java-refactoring] Cosmetic; use JavaFeatures
GitOrigin-RevId: 4a60e9012e90a77a7fd0c0c3bf73619e3f5c2c49
2024-03-16 12:47:07 +00:00
Tagir Valeev
0237abc6f4 [java-refactoring] IDEA-348800 If a record and implemented interface have matching record parameter and interface method names, a refactor should change both
GitOrigin-RevId: d65847c2ae91f5fe2ae67d26cacfe22d3358e1b5
2024-03-15 14:05:54 +00:00