Commit Graph

136 Commits

Author SHA1 Message Date
Tagir Valeev
d0cf7b359a [java] IDEA-345498 Remove explicit Java 20-preview support and parenthesized patterns
GitOrigin-RevId: 8d646035979e3ec0a7de3c6f58a4e6ec9967bdbd
2024-02-12 19:12:36 +00:00
Mikhail Pyltsin
299b7e468b [java-highlighting] IDEA-334683 (EA-921945) anonymous classes and local classes must not inherit sealed classes
- fix for completion
- fix for error highlighting

GitOrigin-RevId: 337131aab1bc7473711ffc078175b5adba34f30d
2023-10-12 11:53:56 +00:00
Mikhail Pyltsin
b2f6272507 [java-highlighting] Fix flacky test for switch dominance
GitOrigin-RevId: 498b70950311ac9b5f1aee55d62f70844060afdb
2023-09-04 12:17:01 +00:00
Tagir Valeev
3dd5f3d6f0 [java-highlighting] Fixes for unnamed patterns in switch (IDEA-326939)
1. More uniform messages
2. Better anchor when var is defined in multiple patterns
3. Separate error messages for Java 20 and Java 21

GitOrigin-RevId: d7c6ab5b4445b7929bdcf200ac0838fc5431e803
2023-08-18 11:33:05 +00:00
Tagir Valeev
efbff7c99c [java-highlighting] Move guard expression to switch label
Part of IDEA-326939 Support multi-pattern switch labels that define no variables

GitOrigin-RevId: c236438af58e1c74a2bf12a5985b33cedadb9cbb
2023-08-18 08:18:06 +00:00
Tagir Valeev
5618627fa4 [java-highlighting] IDEA-326939 Support multi-pattern switch labels that define no variables
GitOrigin-RevId: fb0360f00314417c17566637db6bbda4c21e6faa
2023-08-16 08:59:25 +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
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
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
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
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
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
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
1b8c014dbd [java-highlighting] IDEA-324654 IDEA-324725 Coverage with 2 sealed hierarchies (exhaustiveness)
GitOrigin-RevId: 1b5ad7fc6c70c9df125cb660ea17e5567ae5a560
2023-07-11 13:30:21 +00:00
Mikhail Pyltsin
1c9acababc [java-highlighting] IDEA-324654 IDEA-324723 For permitted classes must cover only direct subtypes
GitOrigin-RevId: 144a419d3dce0786457236ac96cb066c4718c084
2023-07-11 13:30:20 +00:00
Mikhail Pyltsin
9add8b349e [java-highlighting] IDEA-324708 Coverage with 2 sealed hierarchies
GitOrigin-RevId: c38172bc2a5f16c29a7587f798d889da1c9d80eb
2023-07-11 13:30:19 +00:00
Mikhail Pyltsin
20285c8d02 [java-highlighting] IDEA-324654 IDEA-324727 Coverage overfitting
GitOrigin-RevId: 301d2ef5dac2384ec6de653a5fd78a1ef74c6536
2023-07-11 13:30:17 +00:00
Mikhail Pyltsin
fef71943cd [java-highlighting] IDEA-324654 Tests for record patterns
GitOrigin-RevId: d79a18b38ae689c4024c0dacc7aeedfd279be26e
2023-07-11 13:30:15 +00:00
Mikhail Pyltsin
5cfb7551e7 [java-highlighting] IJ-CR-110513 IDEA-324599 Highlight assignment to variable declared outside the guard
GitOrigin-RevId: b2e2ccb9e2464323cf615ecbe311da3a749ea098
2023-07-11 13:30:13 +00:00
Mikhail Pyltsin
11a07b9e2c [java-highlighting] IDEA-324654 IDEA-324675 Take into account the hierarchy for coverage
GitOrigin-RevId: 37d211b59419aa50a106c47ac897e704bed32ca7
2023-07-11 13:30:10 +00:00
Mikhail Pyltsin
d64809acc7 [java-highlighting] IDEA-324586 Highlight duplicated values with casts in java 21. Fix for null
GitOrigin-RevId: 85c0a0e8608267502c300b150fa9c5df23521efb
2023-07-08 13:45:02 +00:00
Mikhail Pyltsin
fb5e591040 [java-highlighting] IDEA-324599 Highlight assignment to variable declared outside the guard
GitOrigin-RevId: 6764de4f511daaeb477c727ea622c64c041e4356
2023-07-08 13:44:53 +00:00
Mikhail Pyltsin
0d8d977eff [java-highlighting] IDEA-324551 Support enums in permitted list for exhaustiveness
GitOrigin-RevId: 7b6a01cbd18b7062babcb4875a580f8f67fb66ee
2023-07-08 13:44:38 +00:00
Mikhail Pyltsin
cb3916ded4 [java-highlighting] IDEA-324544 Support intersections for exhaustiveness
GitOrigin-RevId: c87035335aa16dd8ff50d903cc9de814fe7b6a30
2023-07-08 13:44:35 +00:00
Mikhail Pyltsin
d1ee298827 [java-highlighting] Refactoring for fallthrough
GitOrigin-RevId: 88bf0c45eb23406f29f693659c8495b286512d36
2023-07-05 20:46:12 +00:00
Mikhail Pyltsin
f92fe33afa [java-highlighting] IDEA-324405 Not take into account guarded cases for dominating
GitOrigin-RevId: 980851746c2e1c1e0f644540867c970598224d2a
2023-07-05 20:46:01 +00:00
Mikhail Pyltsin
4bc43b46f4 [java-highlighting] IDEA-323955 Record patterns support available only for Java 20 preview. Fix compiler errors and tests
GitOrigin-RevId: 5f856519e56e61818e95cf63766fb6a54c6283ad
2023-07-05 12:09:22 +00:00
Andrey Cherkasov
9ccc820db2 [java] Remove Java 17 Preview and Java 18 Preview language levels
IDEA-314047

GitOrigin-RevId: 8c24deb2dfb5361f08857d7933ab290476f4ce84
2023-06-19 17:37:05 +00:00
Andrey Cherkasov
d1049d3b8f [java-highlighting] Incorrect priority of error identification for "case default"
IDEA-315471

GitOrigin-RevId: 15ba8b32ad2f8616aa7be9f76a4a7f0880baf196
2023-03-16 16:23:41 +00:00
Mikhail Pyltsin
2171340c50 IJ-CR-104238 [java-highlighting] IDEA-299588. Generate missed deconstruction. Fix cover with a type test pattern
GitOrigin-RevId: f42b523605d69ebf62c18dfe1b27743e7ef9698c
2023-03-14 21:29:12 +00:00
Andrey Cherkasov
3f67f5fe7e [java-highlighting] Illegal case label combination
— Improve message errors
— Highlighting for default label not allowed here

IDEA-309572
IDEA-311508
IJ-CR-100879

GitOrigin-RevId: ec31413e87c30697c58ae0444425a68d838c7210
2023-03-13 12:53:39 +00:00
Mikhail Pyltsin
9058e87a79 [java-highlighting] IDEA-302714. 'switch' statement does not cover all possible input values: false positive with super
GitOrigin-RevId: 2582f6b318357bd44f154bc91e8b837c88f87cd8
2023-03-02 18:08:10 +00:00
Mikhail Pyltsin
632183ab2a [java-highlighting] IDEA-302721. an empty 'switch' statement with records is not highlighted
GitOrigin-RevId: 900da600f9e207a5bc8f13542909be495ed3c183
2023-03-01 17:51:33 +00:00
Andrey Cherkasov
5fbc9b814a [java-highlighting] IDEA-313989 'switch' expression does not cover all possible input values: false positive
GitOrigin-RevId: 8292fda6965d42e4034c2f6a8c2ee8d185133654
2023-02-24 13:26:54 +00:00
Tagir Valeev
9b9e75531c [java-highlighting] Fix pattern type inference for wildcard-parameterized patterns
Also: fix and unify unchecked warnings for patterns
#IDEA-312000 fixed

GitOrigin-RevId: 8f47b72ec308cc9b089571ddc486d275d5d8ff4e
2023-02-07 12:02:04 +00:00
Andrey Cherkasov
48c32d8c10 [java-highlighting] Cannot resolve symbol: false negative in 'switch' statements and expressions
IDEA-311341

GitOrigin-RevId: f3010ae23ade75f3a6ab4dcf31ae27b9c539f3f1
2023-01-26 10:14:57 +00:00
Andrey Cherkasov
59d7b0c4c5 [java-highlighting] switch has both an unconditional pattern and a default label: false negative
IDEA-310722

GitOrigin-RevId: 1dfaeb0a35715757272dfaa4f10dc0e7ed628101
2023-01-17 18:02:27 +00:00
Andrey Cherkasov
12c6c8f2c5 [java] Highlight "Duplicate unconditional pattern" instead of "Label is dominated by a preceding case label"
IDEA-310687

GitOrigin-RevId: edc302b7042dd5cfc79903644dadcf3238bc97c2
2023-01-17 18:02:24 +00:00
Andrey Cherkasov
62ebc2616f IDEA-310575 A total pattern is now called an unconditional pattern
GitOrigin-RevId: 306b7b66d45e6f92bc2629db93241630156e5164
2023-01-15 05:39:37 +00:00
Tagir Valeev
4b5400beb3 [java-highlighting] Report ':' or '->' expected instead of ':' expected when parsing switch case (IDEA-309553)
GitOrigin-RevId: 1820e2fc1045450cee2abe0064b6a12576bd5abc
2023-01-11 16:33:07 +00:00
Andrey Cherkasov
b9c8ca5b1f [java-highlighting] Move tests
GitOrigin-RevId: d2a25443ec1006f7f4381695fc22feeaf4c644d3
2023-01-06 19:26:56 +00:00
Andrey Cherkasov
f884fcde64 [java-highlighting] foreach patterns: applicability and exhaustiveness
GitOrigin-RevId: f136201891af221d3ffa9065363da9894bf56e55
2023-01-06 19:26:51 +00:00
Andrey Cherkasov
4c2d17acba [java-highlighting] Pattern matching for switch (fourth preview): illegal falling-through
IDEA-309572

GitOrigin-RevId: 2dbf9102e0302fa84ad358c9afb0b21df7a877eb
2023-01-04 18:41:04 +00:00
Andrey Cherkasov
b56985873a [java-highlighting] JEP 432: A 'case null, default' label dominates all other switch labels
A 'default' label dominates a case label with a case pattern, and it also dominates a case label with a 'null' case constant.

IDEA-309549

GitOrigin-RevId: 6877992c530e41a1200ea7c20d6405da4be0324b
2022-12-29 00:57:49 +00:00
Andrey Cherkasov
608c99ed4d [java-highlighting] Display error if record patterns in for-each loops aren't available (IDEA-309351)
GitOrigin-RevId: 0919de47769682aff2c016920175a74d89c9f7b6
2022-12-26 13:39:22 +00:00
Andrey Cherkasov
d9087ea8cb [java-highlighting] Update error message in accordance to that parenthesized patterns are present in Java 19 preview
IDEA-304626

GitOrigin-RevId: d5fef52aa028be12b13db2166014b51b77291352
2022-11-15 19:34:41 +00:00