Commit Graph

547 Commits

Author SHA1 Message Date
Tagir Valeev
83db437eba [java-refactoring] Fix inline variable in IDEA when INLINE_LOCAL_THIS setting was stored in config in older IDE versions
GitOrigin-RevId: 10fcf8ee46c40edae0bd714c1c3867aad32958d0
2024-02-19 14:20:53 +00:00
Nikolay Chashnikov
0d6c09fc44 [java] API: mark for removal unused deprecated API (IJPL-275)
GitOrigin-RevId: bd2e927a5c22a1f2930b97de8e051bc70d62a0c7
2024-02-16 15:45:41 +00:00
Tagir Valeev
92ac3066cb [java] JavaFeature.OVERRIDE_INTERFACE; isLanguageLevel6OrHigher usages removed
GitOrigin-RevId: 5d1bedeee34435ecbfc0d4bda6245a50c9ac24d7
2024-02-15 17:28:26 +00:00
Tagir Valeev
bf85acba82 [java] More JavaFeature uses
Also: new JavaFeatures (ASSERTIONS, ENUMS, PRIVATE_INTERFACE_METHODS)

GitOrigin-RevId: f073845a77730b486afa56317e2c12ff044f5425
2024-02-12 19:12:43 +00:00
Tagir Valeev
bc953af5de Fix/suppress IgnoreResultOfCall
GitOrigin-RevId: 2f0cc37e902e13b9dade80af300e218a6f7665ec
2024-02-09 19:11:14 +00:00
Tagir Valeev
ea2b70a2d1 [java] IDEA-345355 Refactor HighlightingFeature (in progress)
JavaFeature.EFFECTIVELY_FINAL

GitOrigin-RevId: d52ab73d7d24745b149b5a4704f1dee55e4179f0
2024-02-08 10:08:09 +00:00
Tagir Valeev
72890668ad [java] IDEA-345355 Refactor HighlightingFeature (in progress)
Rename STREAMS to STREAM_OPTIONAL; use features instead of isLanguageLevel8OrHigher

GitOrigin-RevId: 36f56560f6c7ca626a268d8b07da86497f2501a0
2024-02-08 10:08:04 +00:00
Tagir Valeev
340c4d40ba [java] IDEA-345355 Refactor HighlightingFeature (in progress)
JavaFeature.isAvailable moved to PsiUtil, as we cannot get PsiElement language level inside frontback-api module

GitOrigin-RevId: 8092b1f55f0d90af5bc570f2fb49cdf9ef94485a
2024-02-08 10:07:48 +00:00
Tagir Valeev
d0d82eba52 [java] IDEA-345355 Refactor HighlightingFeature (in progress)
Declare new features: SERIAL_ANNOTATION, NESTMATES, ALWAYS_STRICTFP, COLLECTION_FACTORIES, INNER_NOT_CAPTURE_THIS, STRING_SWITCH
Use more features instead of explicit Java levels

GitOrigin-RevId: e90a96501c218ed44faebb7c882770b50477b6e1
2024-02-08 10:07:38 +00:00
Tagir Valeev
7625b3c7a2 [java] IDEA-345355 Refactor HighlightingFeature (in progress)
Merge JavaLanguageFeature into JavaFeature

GitOrigin-RevId: 212b31d072450df03fc9eeeeb2cf0861b2b32bc1
2024-02-08 10:07:28 +00:00
Tagir Valeev
d8aa739e97 [java] IDEA-345355 Refactor HighlightingFeature (in progress)
Use JavaLanguageFeature instead of HighlightingFeature

GitOrigin-RevId: ad24840c3e810521c82da3873ec42aa3fadb4c0d
2024-02-08 10:07:18 +00:00
Anastasia Katsman
3d74f7fa36 [rdct-tests]: rewrite UndoAfterExtractingInterfaceTest using modal dialogs to avoid importing of java dependencies
(cherry picked from commit 4cb9bec3af55f129eafdb657b3b6adb7641a9262)

IJ-CR-125270

GitOrigin-RevId: 42b4c14034ff0cace480a8db16969900b506b271
2024-02-06 22:36:50 +00:00
vladimir.petrenko
e5043e9da6 RDCT-874: test for preserving ClientId for delayed operations in CodeStyleCachedValueProvider
(cherry picked from commit 8e481688690cf5cf99eab7016f59c67b94f1f4a2)

IJ-CR-125270

GitOrigin-RevId: 920a346e3b1f8658c48655d39f011f2159a96c6f
2024-02-06 22:36:44 +00:00
Tagir Valeev
554b75c8b9 [java-refactoring] @NotNull
GitOrigin-RevId: 054af6ae9a425c3cc6bd09081ff6a27d38259c74
2024-02-06 21:35:16 +00:00
Tagir Valeev
5bd02b55c3 [java-intentions] AddVariableInitializerFix: suggest more suitable initial values instead of null for some types
Fixes IDEA-344453 Intellij should not try to initialize an Optional var with null

GitOrigin-RevId: 8097988bf1335a282138e8d09e350c3a5f65204d
2024-02-02 19:17:55 +00:00
Tagir Valeev
86d9d3a43e [java-refactoring] TypeMigration: migration rules for optional
GitOrigin-RevId: 5f7c1413476c7aea1b6282e86426e7ccf414c94b
2024-02-02 10:29:22 +00:00
Tagir Valeev
4e8623cb77 [java-refactoring] TypeMigrationTest: update to use latest JDK; cleanup and partially fix implementation
Tests T49 and T50 do not work with graph inference resolver. It looks like, the resolver was selected based on the JDK version, so updating JDK caused problems. For now, the problem is not solved.

GitOrigin-RevId: accb3a90954bdcb0d07953b9266216395a788855
2024-02-02 10:29:14 +00:00
Tagir Valeev
22219e1658 [type-migration] ReadAction
GitOrigin-RevId: baf6842ba5425cec4480121c5a254f1e5a3c68ae
2024-02-01 10:32:00 +00:00
Alexandr Suhinin
b7ca72a251 EA-1047558 [extract method]: revert editor state inside write action always
GitOrigin-RevId: f6ca59b7c1ee5a60fe42a2b14925e37d730d601c
2024-02-01 09:36:14 +00:00
Bart van Helvert
4494ef5c18 [refactoring] Remove redundant refactoring helper preparation APIs
These APIs are redundant now because a new API was introduced in #KTIJ-28288 that allows running the preparation on both usages and elements the refactoring was invoked on.

GitOrigin-RevId: 2cf65c49a43b6b12c0be365a7973d6ef00d1e6f7
2024-01-24 14:23:04 +00:00
Bas Leijdekkers
a9e8828ed9 Java: introduce VariableAccessUtils.getVariableReferences() convenience overload and use it
also adds javadoc

GitOrigin-RevId: b69dfea4b74880a67720c95d7a0695e69978bc24
2024-01-22 19:24:24 +00:00
Alexandr Suhinin
79653f2633 CR-101244 clean up: remove redundant overriding methods
GitOrigin-RevId: d4d165c6280b7bead925940c82b20f5300c7750a
2024-01-20 15:47:17 +00:00
Anton Lobov
1bf43101d9 [java] FL-24196 Java: Inline local variable from its declaration throws NPE
GitOrigin-RevId: 8d7e4e03293e944e36fb3fd7dcd9b461c8ac2639
2024-01-18 14:06:32 +00:00
Mikhail Pyltsin
ab3056d33d IJ-CR-124030 [java-refactoring] S IDEA-343148 Introduce constant causes exception for implicit classes
- add comments

GitOrigin-RevId: 54ed3548ef5cd95dafd8c4025988d70ec9d68f27
2024-01-17 13:46:10 +00:00
Bart van Helvert
dc11424f70 [kotlin] Run import optimizer when no usages are found
Fixes the issue in Kotlin, Java and Groovy. #KTIJ-28288 Fixed

GitOrigin-RevId: 7cd5942539a10f9ccdba386396f15546b0a9ac00
2024-01-17 13:18:01 +00:00
Mikhail Pyltsin
d72e824939 [java-refactoring] IDEA-343148 Introduce constant causes exception for implicit classes
- use `this`

GitOrigin-RevId: 77ba9f60586b4f16904220145567800082928a68
2024-01-16 14:03:23 +00:00
Tagir Valeev
fc3e5df389 [java-completion] IDEA-339251 IDEA: make Postfix templates dumb aware
GitOrigin-RevId: 082102197a4a06457685b5d6cd94e7296e51d8db
2024-01-12 18:46:51 +00:00
Mikhail Pyltsin
a42f86fba8 [java-inspections] rename dialog to more accurate name
GitOrigin-RevId: cf6989d1f637fbfae71523b2048c76590ffe86ea
2024-01-12 17:41:41 +00:00
Alexandr Suhinin
d75d619ab9 [extract method] IDEA-251837 use type element to annotate method nullability
[extract method] IDEA-251837 fix texts

GitOrigin-RevId: 37da2e7e8f83a4d85a87c644788a66ce6ea1e05f
2024-01-12 16:42:18 +00:00
Nikolay Chashnikov
2c187bc8b7 [java] API cleanup: remove unused deprecated API (IJPL-275)
GitOrigin-RevId: 460fb9a3eec415c9ebaf27e28493c9dc197cf8e3
2024-01-11 11:19:57 +00:00
Tagir Valeev
ca4c2a77a0 [refactoring] RenameDialog: get rid of initUI(), instead allow to update name suggestions after UI creation
GitOrigin-RevId: 084709ab0aa5bd68d604d98fa210b527cd077fdf
2024-01-10 10:04:16 +00:00
Mikhail Pyltsin
5568197815 [java-inspections] IDEA-342216 Fix place for call inspection ExtractMethodRecommenderInspection
GitOrigin-RevId: 507f2d2fabb98a46e7a519a9edf904182fe5b3fb
2024-01-04 16:15:41 +00:00
Mikhail Pyltsin
79a2497d0c IJ-CR-122503 [java-refactoring] IDEA-340596 Unable to rename file with implicit class
- added more tests

GitOrigin-RevId: a987c30427f32d2754c1fd1afeacdb6f6213dec4
2024-01-03 11:44:07 +00:00
Bas Leijdekkers
0dbc31a8b6 Java: allow to introduce a constant as a field of an inner, local or anonymous class (IDEA-341923)
for Introduce Constant refactoring. Also fixes IDEABKL-3269 when introducing a compile-time constant from an expression.

GitOrigin-RevId: 169e7ee8e14306a265948537b62746d9a26c0298
2023-12-28 17:40:25 +00:00
Bas Leijdekkers
f60c642158 Java: fix preview for "Convert Local Class to Inner" refactoring (IDEA-341832)
GitOrigin-RevId: 511cb8c3612ab1bdd29cc26c61511420f3cc5d4e
2023-12-28 17:40:12 +00:00
Bas Leijdekkers
29eeec8c04 Java: remember dimensions of Convert Anonymous to Inner dialog
GitOrigin-RevId: e4b7164634d73954c4e4509ff440286a581472f3
2023-12-28 17:40:09 +00:00
Bas Leijdekkers
db953d1a59 Java: add quick-fix to "Local class" inspection and enable by default at information level (IDEA-341832)
GitOrigin-RevId: 57c018ee9e1c55031957d06b417cc0e192c83c9b
2023-12-28 17:40:06 +00:00
Bas Leijdekkers
35bfda4e82 Java: better error message for "Convert to inner class" refactoring
GitOrigin-RevId: 487bd49a11a288a82684fe9359dd46cd2e91f6ef
2023-12-28 17:40:03 +00:00
Bas Leijdekkers
44373573e7 Java: Introduce field - disallow fields with local class types that do not compile, part II (IDEA-198440)
GitOrigin-RevId: 239fa53af5b1fc0c48f88f1ff27c99d1634cf2a1
2023-12-28 17:39:50 +00:00
Bas Leijdekkers
72faf00daf Java: disallow introducing field from local variable in interface (IDEA-300134)
GitOrigin-RevId: 754b44618f4c59e6196ffd4430e7fb5b4b404742
2023-12-28 17:39:47 +00:00
Bas Leijdekkers
82c1552e82 Java: make "Inline method" refactoring "statements before super()" aware (IDEA-340403)
GitOrigin-RevId: da7491d85473d64bbf9525adcfd6021274b6e35c
2023-12-28 17:39:44 +00:00
Bas Leijdekkers
8f2386e1d4 Java: make "Introduce variable" refactoring "statements before super()" aware (IDEA-340403)
GitOrigin-RevId: 5b961c4baf967175428cb594e0f6d534d9824eb3
2023-12-28 17:39:41 +00:00
Bas Leijdekkers
b2cf7e2e4b Java: Introduce field - disallow field with local class types that do not compile (IDEA-198440)
GitOrigin-RevId: 52e0dfc48276061214da0b2ad0ef68a512bdf2ee
2023-12-28 17:39:38 +00:00
Bas Leijdekkers
7157fcb5e8 Java: Introduce field - don't offer initializing in constructor for static fields (IDEA-341676)
GitOrigin-RevId: 761d6740ac1302a8bf1615225a6757b678d92f37
2023-12-28 17:39:35 +00:00
Bas Leijdekkers
c0997ef509 Java: Introduce field - always allow introducing static field in records (IDEA-312819)
GitOrigin-RevId: 2b73cef07f61c1f9a80b9598e9b6a162990f1417
2023-12-28 17:39:31 +00:00
Bas Leijdekkers
a650d056d4 Java: make "Introduce field" refactoring "statements before super()" aware (IDEA-340403)
GitOrigin-RevId: 60ef523fedfa5065c591acedfb646d7718717489
2023-12-28 17:39:28 +00:00
Tagir Valeev
6f8f56d319 [java-inspections] Fix interaction with suppression
1. Don't include suppression comment itself to the inspection range
2. Use first statement as anchor when possible (otherwise suppression mechanism went wild)
Fixes (in most of the cases) IDEA-341289 Wrong "Redundant suppression" warning for suppression for "Extract method" weak warning

GitOrigin-RevId: 5fa48805d9b34236a733a206275d3b21c26bd2ef
2023-12-20 22:44:48 +00:00
Mikhail Pyltsin
fab280de6b [java-refactoring] IJ-CR-122503 IDEA-340596 Unable to rename file with implicit class
- check identifier

GitOrigin-RevId: 143e8d34a9eae594133c3f9ff66b18affa60ed53
2023-12-19 13:34:28 +00:00
Mikhail Pyltsin
4a7e2fc711 [java-refactoring] IJ-CR-122503 IDEA-340596 Unable to rename file with implicit class
- reuse library methods

GitOrigin-RevId: a2a2de5a34bbd623eae1c408b45a96b79907f7d4
2023-12-19 11:16:31 +00:00
Mikhail Pyltsin
abed593937 [java-refactoring] IDEA-340785 Unable to rename file with implicit class
- add verifications for names

GitOrigin-RevId: 80d526e9a4f20d58875f59d81fd4c87f0c3cccd7
2023-12-18 20:57:27 +00:00