Commit Graph

5133 Commits

Author SHA1 Message Date
Louis Vignier
e668728d78 [java-highlighting] Test extra semicolons highlighting in JDK 21
IJ-CR-110702

GitOrigin-RevId: c477953def6dd7c26f0b46755afabe98161e08dc
2023-08-11 14:51:54 +00:00
Mikhail Pyltsin
584d755d71 [java-intentions] IDEA-327634 CreateSealedClassMissingSwitchBranchesFix support generics
- try to calculate generics for generic sealed classes using a selector type

GitOrigin-RevId: 80fafc8f359a8841814f0e13f87f67d4e81039cb
2023-08-11 13:54:34 +00:00
Picowchew
fb9a20325f Fix typos in 'variable' and 'initial'
GitOrigin-RevId: a0ebc0930bea4dcfa9386adddee5e872e05c0a8e
2023-08-07 15:44:22 +00:00
Tagir Valeev
13cf92eb7f [java-inspections] ConstantExpressionInspection: minor fixes
1. Disable for literals
2. Checkbox description moved to the form

GitOrigin-RevId: 48303e0c704ef9db5e09f64f34d3ee32d2743194
2023-08-04 15:20:12 +00:00
Bas Leijdekkers
0d8bea1143 Java: better message for raw processor (IDEA-321466)
GitOrigin-RevId: 4d0df99352f5dfbd819ab7e353df89c3f200c2f8
2023-08-04 01:22:58 +00:00
Tagir Valeev
03799f2298 [java-highlighting] IDEA-327447 Inconsistent string template exception handling highlighting
GitOrigin-RevId: a5ebbd73511ca0dd51d67e05037471df3061e535
2023-08-03 15:57:16 +00:00
Bas Leijdekkers
8b353e8997 java: "Seal class" intention should not be available on annotation interface (IDEA-327298)
GitOrigin-RevId: 1051943ab071973c6ff462eb2270b2bc42c6393a
2023-08-02 23:54:13 +00:00
Tagir Valeev
a828a34968 [java-highlighting] Fixes in unnamed variables highlighting (IDEA-323960)
1. Highlight C-style arrays
2. Do not highlight variables inside for initializer
3. Highlight variables without initializer
4. Better message for underscore references when unnamed variables are allowed

GitOrigin-RevId: 5bca18969cf8fb0ea6e052b0aef71323bbfa69b5
2023-08-02 21:04:54 +00:00
Bas Leijdekkers
8354caf1f5 Java: highlight bad escapes in string template fragments (IDEA-321466)
GitOrigin-RevId: 3d7fb0ab16db230d216bac4eb8b9ac5301232902
2023-08-01 11:58:28 +00:00
Bas Leijdekkers
d50045f34f Java: lex nested string templates correctly (IDEA-321503)
GitOrigin-RevId: f88d2034128a7a1dcae5f1adca5a9105c6109eb6
2023-08-01 11:58:22 +00:00
Bas Leijdekkers
cdb4d0e7ae Java: highlight sealed, non-sealed and permits keywords as not supported on lower language levels
GitOrigin-RevId: 17ff33c11a6d5ede697aaa3a7c749bff44dc7d67
2023-08-01 11:58:12 +00:00
Tagir Valeev
a41ef84fea [java] Unnamed variables
IDEA-323910 Implement parser for "JEP 443: Unnamed Patterns and Variables (Preview)"
IDEA-323960 Support error highlighting for unnamed variables (JEP 443)

GitOrigin-RevId: 1b9ee424063dfd4d32c2215fc8b0a9838dbdcd95
2023-07-31 13:41:28 +00:00
Tagir Valeev
7933354967 [java-highlighting] UnnamedPatterns exhaustiveness tests fixed (IDEA-326473)
GitOrigin-RevId: 046110c4a35093a859b02b17b0c6277d5d48e02b
2023-07-31 10:52:41 +00:00
Tagir Valeev
dbf25ab12b [java-inspections] IDEA-326604 Constant expression can be evaluated using dataflow analysis
GitOrigin-RevId: 5e663ac98c323faf36afcaf18115b6e4036d980d
2023-07-28 09:45:29 +00:00
Tagir Valeev
ab550ac4c0 [java] IDEA-326473 Implement unnamed patterns
GitOrigin-RevId: 1b5db700434306be23d07e38905537025e2cc892
2023-07-27 10:03:54 +00:00
Bas Leijdekkers
3534648803 Java: types, exceptions and more error highlighting for string templates (IDEA-321503)
GitOrigin-RevId: c6571bf0011dea625063da40b435ac7d8000c3aa
2023-07-24 20:08:35 +00:00
Tagir Valeev
1a157d9e68 [java-intention] New ModCommands
ChangeExtendsToImplementsFix, ClassMayBeInterfaceInspection, MethodRefCanBeReplacedWithLambdaInspection

GitOrigin-RevId: 1ef6864503e633a37c1f1dda1f5604cc9ae978de
2023-07-21 11:17:38 +00:00
Tagir Valeev
2c12f7c579 [java-intentions] ExtendSealedClassFix: ModCommand
IntentionActionWithChoice UI replaced with multi-step ModCommand, as we don't have IntentionActionWithChoice in ModCommand API, and it's unclear whether it's a good idea, and how to implement it better

GitOrigin-RevId: a702bc672b56f4c51dd7e7b01cf5ee0ded457805
2023-07-21 11:17:34 +00:00
Tagir Valeev
9ab2a2cd01 [mod-commands] Testing: declarative testing of multi-step actions
GitOrigin-RevId: d8c195494ae7973a44c1daf707fc38e6f76a7191
2023-07-21 11:17:31 +00:00
Mikhail Pyltsin
b65d25e4eb [java-highlighting] IDEA-308514 Incorrect Java error highlighting when accessing private method of var local variable
GitOrigin-RevId: 29c869bc79161b6adf24f0090ee591cb9abc1c6b
2023-07-20 16:42:57 +00:00
Bas Leijdekkers
6abbbdd360 Java: error highlighting for string templates (IDEA-321503)
GitOrigin-RevId: d17a540698ecf5330326a7757475756ea2f85f86
2023-07-19 16:08:43 +00:00
Tagir Valeev
07d22ea643 [java-inspections] Do not fuse PriorityQueue and PriorityBlockingQueue into the stream operation
It's more efficient to construct these containers from the collection directly
Fixes IDEA-324751 Inefficient code suggested by the "Stream may be extended replacing PriorityQueue" inspection

GitOrigin-RevId: 4a1ee4882e4c0d5b303f14f5d3a643df5ecd9933
2023-07-19 08:54:40 +00:00
Tagir Valeev
7ba5b8972a [java-inspections] AddMethodQualifierFix: preserve existing arguments
GitOrigin-RevId: 4631d490d89ef9f3c65789d0eb8e0a9840a88ec7
2023-07-19 08:54:39 +00:00
Mikhail Pyltsin
c44bd90939 [java-highlighting] IJ-CR-110955 IDEA-324714 Add quick-fix to produce missed deconstruction patterns.
Added more tests, change to reduce in loop

GitOrigin-RevId: 609da394429c3cc3fad72147d9856fd0b7afcee2
2023-07-18 18:34:57 +00:00
Mikhail Pyltsin
da7fe16e4e [java-highlighting] IJ-CR-110955 IDEA-324714 Add quick-fix to produce missed deconstruction patterns.
Added more tests, added shortenClassReferences

GitOrigin-RevId: e74d9b61a09fb314a8d9dbdceee8c30c0c5a3def
2023-07-18 13:16:41 +00:00
Tagir Valeev
5d5dfb997a [java-intentions] AddMethodQualifierFix: ModCommand
GitOrigin-RevId: efe77eed876481149c7b58356ffd6dcada649a16
2023-07-17 19:20:35 +00:00
Mikhail Pyltsin
3f18cddb20 [java-highlighting] IDEA-325375 Exhaustive switch expressions can produce definitely assigned variables. Fix type ranks
GitOrigin-RevId: 1a36f38c08e51d4cafb897a2b8ace796a74ec298
2023-07-17 17:05:57 +00:00
Mikhail Pyltsin
82b6cf4e7d [java-highlighting] IDEA-325375 Exhaustive switch expressions can produce definitely assigned variables
GitOrigin-RevId: 013d2367e1fa08189272343af83c5af9c2ad0582
2023-07-17 11:27:45 +00:00
Mikhail Pyltsin
830275db3c [java-highlighting] IDEA-324652 Unreachable branch quickfix produces incorrect code
GitOrigin-RevId: 3c00dae40f890c0a5bfda425f9c30d479f4d40b3
2023-07-17 11:27:28 +00:00
Tagir Valeev
ee20b97285 [java-intentions] Do not suggest to insert 'return' in the void method
GitOrigin-RevId: e73ca4a07b093b819858fb165d4b6207e9fcd360
2023-07-14 22:49:34 +00:00
Mikhail Pyltsin
afe84f8eed [java-highlighting] IDEA-324474 Highlight unreachable statement for exhaustive switch. Tests
GitOrigin-RevId: 97f525a579bd45c6863a6662142f26193e7e2429
2023-07-14 16:14:48 +00:00
Mikhail Pyltsin
2ab3cddf1f [java-highlighting] 'case default' is the incorrect syntax, and it was replaced with the proper 'default' syntax.
GitOrigin-RevId: d69adf33903bda7bb28090145fc57b690438281b
2023-07-14 16:14:47 +00:00
Mikhail Pyltsin
ab14666e4e [java-highlighting] 'case default' is the incorrect syntax, and it was replaced with the proper 'default' syntax.
GitOrigin-RevId: 72f8e7f6c9080db7cb0b89c0ed876eb949171e8f
2023-07-14 16:14:45 +00:00
Mikhail Pyltsin
125ae46c37 [java-highlighting] IDEA-324638 Null type can be covered by any reference type
GitOrigin-RevId: 98c93a763cc6172aa3a2789759ae1e1715e79278
2023-07-13 19:06:23 +00:00
Tagir Valeev
e8adfcce9b [java-intentions] InitializeFinalFieldInConstructorFix: ModCommand
GitOrigin-RevId: 2fafef8e7f7c086bfbadc0d7e1470359f5c677e9
2023-07-13 19:05:49 +00:00
Mikhail Pyltsin
07a6f3f57a [java-highlighting] IDEA-324314 Enums must be qualified with switch with compatible types
GitOrigin-RevId: db218b31e81d767fff0c341a00593983522564b1
2023-07-13 13:29:07 +00:00
Mikhail Pyltsin
4f951e7be9 [java-highlighting] IDEA-324327 IJ-CR-110223 Constant associated with switch block must be used with primitives or String
GitOrigin-RevId: 56154226d27f3c254f27cc8db27ca95d2f967ac1
2023-07-13 13:29:03 +00:00
Mikhail Pyltsin
50a055ff5c [java-highlighting] IDEA-325165 Take into account direct superclass for covered enum or record pattern classes
GitOrigin-RevId: 7176453ec46c0156391b064e60bf9c0f7f291d42
2023-07-13 13:28:59 +00:00
Tagir Valeev
4c7609bdd7 [mod-commands] Basic support for templates and member chooser
GitOrigin-RevId: e7df218ea71800e71409de20474f43eb758e41de
2023-07-13 12:05:33 +00:00
Mikhail Pyltsin
3c671cfafa [java-highlighting] IDEA-324714 Add quick-fix to produce missed deconstruction patterns
GitOrigin-RevId: 23118a9d1df738a77484a35feb7902416f487036
2023-07-12 21:09:46 +00:00
Mikhail Pyltsin
c09ed3984b [java-highlighting] IDEA-324625 fix case with nested record patterns
GitOrigin-RevId: c88ce329fd28cf12a6b27f752a6d96040061aa17
2023-07-12 21:09:42 +00:00
Mikhail Pyltsin
d8896eb511 [java-highlighting] IDEA-324625 fix tests
GitOrigin-RevId: d087bd995b416a5cae2e097e4ed6a8d2d50651bd
2023-07-12 11:06:42 +00:00
Mikhail Pyltsin
ae0a9aceaa [java-highlighting] IDEA-324599 IJ-CR-110513 Use isAccessedForWriting for guard expression
GitOrigin-RevId: 3baedbcb85eb0de7a186cc9f990693da7283f90a
2023-07-12 11:06:40 +00:00
Mikhail Pyltsin
6f2c4ec3f3 [java-highlighting] IDEA-324625 Highlight using non-final variable in guard
GitOrigin-RevId: 0cedf700c6960e15104409b9cc411e8a5bd15fea
2023-07-12 11:06:37 +00:00
Mikhail Pyltsin
5237df5eb3 [java-highlighting] IDEA-324880 Exhaustive switches can produce definitely assigned variables
GitOrigin-RevId: 7e644a2565803fdd900830d986dba481aeb127db
2023-07-12 11:06:36 +00:00
Mikhail Pyltsin
133cf1e8d2 [java-highlighting] IDEA-324705 Non-final variable in guard: provide a fix to rewrite 'if' statement
GitOrigin-RevId: 99770663b569ed2bd6a8d6452e5b0bbe923f9d15
2023-07-11 13:31:11 +00:00
Mikhail Pyltsin
aeb1714a62 [java-highlighting] IDEA-324641 Allow fallthrough for empty block
GitOrigin-RevId: e60d99c7c4e142d0df91601e9bcee02f4ff4cd7e
2023-07-11 13:31:09 +00:00
Mikhail Pyltsin
4054012fb4 [java-highlighting] IDEA-324654 Fixes to find missed and covered classes
GitOrigin-RevId: 6eb6f4cab91bc3b27c39f7dd60f9cdcdbe2e9475
2023-07-11 13:30:28 +00:00
Mikhail Pyltsin
5ba68a238f [java-highlighting] IDEA-324654 Small fixes
GitOrigin-RevId: 36edc684ed89148f9f5914c6637db55110ebbcef
2023-07-11 13:30:23 +00:00
Mikhail Pyltsin
1b8c014dbd [java-highlighting] IDEA-324654 IDEA-324725 Coverage with 2 sealed hierarchies (exhaustiveness)
GitOrigin-RevId: 1b5ad7fc6c70c9df125cb660ea17e5567ae5a560
2023-07-11 13:30:21 +00:00