5410 Commits

Author SHA1 Message Date
Tagir Valeev
26ecc4e294 [java-highlighting] Precise member tracking for unresolved reference
Also: support method ref highlighting in incomplete project model
Part of IDEA-353117 Error highlighting in incomplete project model

GitOrigin-RevId: b081ddcbaa4e54403a20bac0a2cdb37db421ceca
2024-05-23 00:20:40 +00:00
Tagir Valeev
caad5f1cb1 [java-inspections] Properly track multiple potential imports for unresolved reference
Part of IDEA-353117 Error highlighting in incomplete project model

GitOrigin-RevId: 06ac6ae2759e5ff0935bf39f750bfb9dad1fd235
2024-05-23 00:20:35 +00:00
Alexey Kudravtsev
12fe9dde02 handle one other type of PSI change (part of KTIJ-27988 K2 IDE: used/unused declaration highlighting is not updated in Kotlin source on editing Java source)
GitOrigin-RevId: d2e7d4c9801d50df41cffa33eedb22a1db1ac7cf
2024-05-21 16:23:10 +00:00
Tagir Valeev
c26fabffef [java-highlighting] Do not mark potential imports for unresolved references as unused
Improves IDEA-353117 Error highlighting in incomplete project model

GitOrigin-RevId: d6419b900fc817c28b7d1b942b28857a14b44141
2024-05-21 14:09:47 +00:00
Alexey Kudravtsev
c84e273956 rehighlight the entire file whenever the reference was changed in some other place, even inside codeblock, to correctly update unused declarations, to fix KTIJ-27988 K2 IDE: used/unused declaration highlighting is not updated in Kotlin source on editing Java source
GitOrigin-RevId: d4025dde88ed3a997a515cb859077fb2a4348d5d
2024-05-17 13:50:18 +00:00
Georgii Ustinov
77bfbe1b39 [Java. Code Formatting] Fix tests which relied on old version of Nullable/NotNull annotations
IDEA-353192

GitOrigin-RevId: f913b37c8fb9c7c754d7c6fcd5c1cdd215a7f295
2024-05-17 11:16:41 +00:00
Bas Leijdekkers
106130b6f8 [java] better quick fix text (IDEA-353386)
GitOrigin-RevId: ebc64c441f2140181ad4e996005a45b19936b7d3
2024-05-14 10:29:57 +00:00
Bas Leijdekkers
0a8f0ae1c8 [java] better error message for type parameter outside bounds when the type parameter is not a concrete class (IDEA-353386)
GitOrigin-RevId: 6fcb1f8c2180ed319cdf7030de9c38b302e8e2d4
2024-05-14 10:29:53 +00:00
Georgii Ustinov
f762b8fa7b [Java. Code Formatting] Change tests after adding support to format last line
IDEA-351758

GitOrigin-RevId: 11bb2e2298d371ebf4041a05b089b0997a228d14
2024-05-13 13:59:09 +00:00
Tagir Valeev
0e644d03a3 [java-highlighting] Incomplete model (IDEA-353117) improvements
Annotations; casts; modules; fix accidental negation

GitOrigin-RevId: 5fee6394cd39b066c1c05b1af93f4fdc9d554b82
2024-05-08 19:27:19 +00:00
Tagir Valeev
deb33bbc1d [java-highlighting] IDEA-353117 Error highlighting in the incomplete project model
First draft

GitOrigin-RevId: e9dbfd1d6c42fe92f43686e465c11201b07cf3d4
2024-05-07 18:33:41 +00:00
Mikhail Pyltsin
c50d80250d [java-highlighting] IJ-CR-132828 IDEA-352588 Support JEP 455: highlighting for switch with primitives
- chars print as themselves without a conversion

GitOrigin-RevId: beee890cd3fca0d4ae907645f76e9f28f173ad09
2024-05-04 17:18:12 +00:00
Tagir Valeev
cebdcda899 [java-intentions] DefineParamsDefaultValueAction: fix cast for vararg type
GitOrigin-RevId: 09705b6a78f4f07c0f62c5642ccd23853b2ba7f8
2024-05-02 11:33:05 +00:00
Mikhail Pyltsin
f27595c831 [java-highlighting] IJ-CR-132825 IDEA-352187 Support JEP 455: highlighting for instanceof with primitives
- use `HighlightUtil.checkFeature` for PRIMITIVE_TYPES_IN_PATTERNS
- simplify tests
- add javadocs a bit

GitOrigin-RevId: 61019896534a11e1c7e2f281054d49a32a8ab8e6
2024-05-01 21:37:16 +00:00
Alexey Kudravtsev
3102effabf make highlight visitors run concurrently; fix tests, get rid of HighlightInfoProcessors to fix IJPL-149030 HighlightVisitors should run in parallel
GitOrigin-RevId: 8a77dd409a575d3eaf28d6935ffeb87fce35dbd4
2024-05-01 11:53:23 +00:00
Tagir Valeev
860bc0e5e7 [java-intentions] DefineParamsDefaultValueAction: add cast by default when ambiguous overloads are present
GitOrigin-RevId: 10d5c9f66fa5bef5ab5e5be71987d14757fd07e2
2024-04-30 16:09:51 +00:00
Mikhail Pyltsin
45160db0df [java-highlighting] IDEA-352588 Support JEP 455: highlighting for switch with primitives
GitOrigin-RevId: 06636352b202037ec3400b2f9763e101d8ed6042
2024-04-29 21:17:42 +00:00
Mikhail Pyltsin
0f5c405185 [java-highlighting] IDEA-352188 Support JEP 455: change error messages for records
GitOrigin-RevId: a6e9fe75500155ca9e77514eca8d00f5e4e94e51
2024-04-29 21:17:42 +00:00
Mikhail Pyltsin
c8995f3cc8 [java-highlighting] IDEA-352187 Support JEP 455: highlighting for instanceof with primitives
GitOrigin-RevId: cbd688d0945b03bffb05af85825c610889383fc4
2024-04-29 21:17:42 +00:00
Tagir Valeev
8ee089b9b2 [java-highlighting] Do not show error on override if there's an unresolved superclass
GitOrigin-RevId: 03bd2f1e2a303f8a36ac33c81ad9ccd64c3b5084
2024-04-26 14:23:18 +00:00
Tagir Valeev
514e918516 [java-intentions] DefineParamsDefaultValueAction: do not copy @Override annotation
GitOrigin-RevId: ca02de483aeeab6e7a516a839edda6cae1515195
2024-04-25 13:12:13 +00:00
Tagir Valeev
ee495db972 [java-intentions] MoveMembersIntoClassFix: improve and revive property test
After implicit classes, out-of-class member is parsed. If it was mistakenly put out of the class, it may have many unrelated compilation errors. E.g. extra Override annotation, unresolved reference (to another member of the class), etc. These errors were masking the 'Move member to class' action, because its scope was larger (the whole method).
Now, we put 'feature not available' error specifically to the method/field name identifier, so it's almost always available. Also, action name is more friendly now, and JavaOutOfClassDefinitionPropertyTest is tuned: caret position and language level set correctly.

GitOrigin-RevId: 39917d11fb216be4db3f6fbc9e984ca7378f7302
2024-04-23 10:35:24 +00:00
Tagir Valeev
a3e3ed8591 [java-highlighting] Remove extra space
GitOrigin-RevId: 98a9c2395ef5f9605d39029dfe5e695d76c4237e
2024-04-23 09:43:59 +00:00
Tagir Valeev
f701cdab11 [java-highlighting] Test for IDEA-350192 Opening < is missing for generics in inspection message
GitOrigin-RevId: 0de35be85e748d6a50d3bca9c13dcd8116e6ffdf
2024-04-17 14:20:37 +00:00
Tagir Valeev
5caf42dc70 [util] Merge NameUtilCore#uniqName into UniqueNameGenerator
GitOrigin-RevId: a43f8908b639a6e5b562be99af5f880a85cfac74
2024-04-16 19:06:47 +00:00
Tagir Valeev
5ae32b3ec9 [java-analysis] LambdaUtil.isSafeLambdaReplacement: check all calls in-between; check applicability
Fixes IDEA-350194 Inspection QuickFix results in compilation error

GitOrigin-RevId: fb83bfcb4e4aef9dc87a5c84de6d08202dd52ec6
2024-04-16 19:06:42 +00:00
Bas Leijdekkers
0b1872f794 java: report string.toCharArray().length -> string.length() (IDEA-351174)
for "Redundant 'String' operation" inspection

GitOrigin-RevId: 96c3b5d310b9639c74241f48348257bbb83dbe93
2024-04-11 09:52:00 +00:00
Bas Leijdekkers
89c8dc03ed [java] better error message on @interface throws/extends list not allowed (IDEA-350501)
GitOrigin-RevId: 1f89c42ac5ffda1d026f6e40cb922b08a095d1dc
2024-04-08 09:54:38 +00:00
Bas Leijdekkers
f96bb8f6d4 [java] define "type parameters" element kind
GitOrigin-RevId: 883cd7f25b3ca5a3eac311b3c9b8b90fc3334653
2024-04-03 14:14:32 +00:00
Bas Leijdekkers
afb2aef0a1 [java] better error message when extends/implements list not allowed (IDEA-350501)
GitOrigin-RevId: 3eee3e73fe57a8dc7bf10b9b30956e02a36c89d8
2024-04-03 14:14:22 +00:00
Bas Leijdekkers
0fc08dae0c [java] better error message when permits list not allowed (IDEA-350501)
GitOrigin-RevId: 93cc9241dd77e12df1baeda1d06538f3159a6e59
2024-04-03 14:14:17 +00:00
Bas Leijdekkers
e614239ca4 [java] better error message and quick-fix text on record constructor throws list (IDEA-350501)
GitOrigin-RevId: 50570e951ec901fe7619465352f725788032c8f2
2024-04-03 14:14:12 +00:00
Bas Leijdekkers
9414c123b8 [java] create annotation value() method from usage (IDEA-350345)
GitOrigin-RevId: 3596e1f35ce3f603789c69f90b28aacaf448866a
2024-04-01 10:52:18 +00:00
Bas Leijdekkers
1fd9cf454d [java] more precise highlighting for "Annotations are not allowed in deconstruction pattern types"
GitOrigin-RevId: 689808b6ab80920e12a0b5d55712df066e84a406
2024-04-01 10:52:15 +00:00
Bart van Helvert
96690d8ae4 [java] Fix false positive for local classes with super call in constructor
#IDEA-350324 Fixed

GitOrigin-RevId: 32f487b6ec841c26dbb73ec8931a9f0f6863a3d9
2024-03-29 21:00:54 +00:00
Tagir Valeev
6c6697d422 [java-inspections] CreateFieldFromParameterAction: ModCommand
Otherwise, it's hard to make it compatible with new-style unused inspection (IDEA-349083)
Also: remove empty line in constructor body automatically

GitOrigin-RevId: ab1cd08352d9f0168b86acc1d4b87cb89cfe7d69
2024-03-22 12:27:40 +00:00
Tagir Valeev
5ceb7551aa [java-inspections] Move unused symbol warnings from PostHighlightingVisitor to normal inspection
Fixes IDEA-349083 Reimplement unused inspection not as a part of PostHighlightingVisitor, but as a normal inspection

GitOrigin-RevId: cb6e22eddbaf9db42626a79c7881bd377c4c7863
2024-03-22 12:27:36 +00:00
Bas Leijdekkers
e3ccfd0e4a [java] Report even more unnecessary substring() calls (IDEA-345335)
GitOrigin-RevId: 37b86167b5d2b1cac74365eaadbf3a5ddf792f69
2024-03-18 00:08:54 +00:00
Tagir Valeev
10310458ce [java] JavaCodeStyleManagerImpl: use uniqName
GitOrigin-RevId: 2421439a99da70d887810de098a000fd71b65692
2024-03-16 12:47:03 +00:00
Tagir Valeev
d4b107d27a [java] The highest language level is now 22
Some tests are adjusted, as now (after unnamed variables release), we warn on every unused lambda parameter

GitOrigin-RevId: 17ce095a19332d22ba0cbcef1e6751ea309ca774
2024-03-15 14:05:44 +00:00
Tagir Valeev
193b2cb477 [java-inspections] Experimental ModCommand-based DeletePrivateMethodFix for unused inspection
GitOrigin-RevId: efd9306505048695f1aa1de1851383e170b0c1ca
2024-03-12 16:55:18 +00:00
Bas Leijdekkers
b474e948e3 [java] report static interface field accessed via instance (IDEA-348722)
GitOrigin-RevId: f8b1b2036656ff5a4579dff82592e7bf4cfad8f9
2024-03-10 15:30:20 +00:00
Bas Leijdekkers
babfae316e [java] improve quick-fix text (IDEA-223692)
GitOrigin-RevId: 7226e492ffe7889bfbabab6dd9ea3d04d64a1d0f
2024-03-10 15:30:17 +00:00
Bas Leijdekkers
d19410735d [java] improve error message (IDEA-223692)
GitOrigin-RevId: df344c76be34232b3dc682d36b9d233ab2a6d54f
2024-03-10 15:30:11 +00:00
Mikhail Pyltsin
ba48f05c21 IJ-CR-126040 [java-highlighting] S IDEA-338688 Change variable type intention produces compile error
- allow changing input parameters

GitOrigin-RevId: 3fad3ac051e314f6858c91ed177b9df22ccef15e
2024-03-08 21:32:08 +00:00
Tagir Valeev
f598e81a95 [java] JavaFeature.ASSERTIONS: fix message
GitOrigin-RevId: da0d1c46b9b85eeed5b3ef8d717901de3f150cd3
2024-02-15 17:28:31 +00:00
Mikhail Pyltsin
8813548cbb [java-highlighting] IJ-CR-125397 IDEA-344235 support calls with checked exceptions for instanceOf patterns
- reimplement, changing only mayCompleteNormallyVisitor

GitOrigin-RevId: 67be02c535ec3d5df7a9ec9cd77395305db27e14
2024-02-13 21:45:04 +00:00
Mikhail Pyltsin
aa94146c31 Revert "[java-highlighting] IDEA-344235 support calls with checked exceptions for instanceOf patterns"
This reverts commit 15d80e2f3028bd59c1ec9a73a7a3af4c1c5f1027.

GitOrigin-RevId: a770a8ce645fa6a578d5a923098d39456d7fd379
2024-02-13 21:44:54 +00:00
Mikhail Pyltsin
c42e445e44 [java-highlighting] IDEA-338688 Change variable type intention produces compile error
- skip if a return type is changed

GitOrigin-RevId: aa6f5d52ba3a50a6c1d571f10dea99e8ce876831
2024-02-13 21:44:44 +00:00
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