Commit Graph

5282 Commits

Author SHA1 Message Date
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
Tagir Valeev
c56dbec5f8 [java] Replace CreateMissingDeconstructionRecordClassBranchesFix20Test and ReplaceCaseDefaultWithDefault20FixTest with stubs
Cannot remove the tests yet, as their removal triggers re-bucketing on CI, which results in unrelated test failures
IDEA-345498 Remove explicit Java 20-preview support and parenthesized patterns (in progress)

GitOrigin-RevId: e84e4cb7f26ecc45f81bb0b04904540a9e3cac0d
2024-02-12 19:12:33 +00:00
Bas Leijdekkers
0cae65939b Java: improve incompatible types reporting
- only report type with "anonymous" prefix when the left side is anonymous
- use short names in the tool tip when fq names would be identical as well
- use error color for the entire type name, including the anonymous prefix

GitOrigin-RevId: f1555687adb0ab9e7c5850719165a7a508ecf181
2024-02-11 16:31:14 +00:00
Tagir Valeev
3f4201aae8 [java-intentions] Disable 'initialize variable fix' for record component
Fixes EA-893719 - UOE: SyntheticElement.findSameElementInCopy

GitOrigin-RevId: 6e5d54c1b32f2c7cb0621bba1b4a6ef02de4b8f8
2024-02-06 21:35:03 +00:00
Mikhail Pyltsin
b4dd504e01 [java-highlighting] IDEA-341846 Code with instanceof for a local class inside a generic function is marked as red
- skip methods to capture parameters

GitOrigin-RevId: df0c152d33bb9f880dad2428b7635d06209b3e0c
2024-02-05 19:44:16 +00:00
Mikhail Pyltsin
4948c8af8c [java-highlighting] IDEA-344235 support calls with checked exceptions for instanceOf patterns
GitOrigin-RevId: 15d80e2f3028bd59c1ec9a73a7a3af4c1c5f1027
2024-02-05 19:22:52 +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
Aleksey Dobrynin
0d8b737e97 [java, kotlin, quickfix] Add dependency in a single step while using Jigsaw modules. IDEA-341660
GitOrigin-RevId: 7c0ad3a4079ca76c1f1afb4147498e0ae08cc449
2024-01-30 14:29:06 +00:00
Tagir Valeev
1813854fea [java] Improve support for multi-shred injections with guarded blocks in ModCommands
IDEA-333006 Language injection in String templates

GitOrigin-RevId: 6b6bec62bd709cd0419139d8a78925ee3d59e249
2024-01-25 19:15:30 +00:00
Mikhail Pyltsin
82abbe2dbb IJ-CR-119726 [java-highlighting] S IDEA-306108 Assignment to a variable with non-denotable type: confusing error message
- fix for quickfix
- refactoring

GitOrigin-RevId: aedc118f2dd67bf56391792e7cd3042a8f7f33a8
2024-01-25 16:31:41 +00:00
Bas Leijdekkers
a18169660e Java: fix CCE when converting interface to class and there is a comment between the interface keyword and identifier
GitOrigin-RevId: fd2ee4537423961785fdb2bee2e0a46411c6a91e
2024-01-23 18:14:05 +00:00
Bas Leijdekkers
45d3f80e5e [java-inspections] UseHashCodeMethodInspection: support reporting and replacing with Double.hashCode() when temp var is reused
GitOrigin-RevId: 8b6169bd90214b30d3d83acf7ebe49bc20b4f29d
2024-01-22 19:24:31 +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
4085dad9bb [java-inspections] IDEA-343139 StaticAccessViaInstanceForImplicitClasses produces errors for implicitly declared classes
- allow such access

GitOrigin-RevId: 2deafb0f6fb0be420a33174ccc2265103a0ce183
2024-01-16 14:03:15 +00:00
Mikhail Pyltsin
8b76574052 [java-actions] IDEA-343025 "Move initializer to constructor" shouldn't be available for implicitly declared class
- disable for ImplicitClass

GitOrigin-RevId: 1cd67fd89726eb19ccedb5227715a7d95c2c7c50
2024-01-15 22:12:12 +00:00
Tagir Valeev
3fad9d4a33 [java-inspections] UseHashCodeMethodInspection: check for side-effects (IDEA-338114)
GitOrigin-RevId: cf54ae1e7c99e0ddff88bf8a6bf951b36f8b89b7
2024-01-15 16:29:07 +00:00
Bas Leijdekkers
f60a136213 Revert Java: allow Create field from Usage on records (to create static field, IDEA-337138) (IJ-CR-122437)
GitOrigin-RevId: afaf9642a626d99d65f989ca6bbd4713b85c7704
2024-01-10 19:31:02 +00:00
Bas Leijdekkers
04ee289bc9 Java: "insert ';'" quick fix for local variables and fields (IDEA-330590)
and skip JavaErrorQuickFixProvider for non-Java elements

GitOrigin-RevId: 2fb2b6321c1a087d53bf52509f1513859ac4faf8
2024-01-10 16:09:01 +00:00
Bas Leijdekkers
3e0ed000da Java: sensibly parse non-sealed modifier on local class and provide better error message (IDEA-342500)
GitOrigin-RevId: 574a5d9c31e5823127227622adaefaaea224b247
2024-01-10 16:08:52 +00:00
Bas Leijdekkers
ab928055bb Java: better error reporting and quick fixes for the diamond operator and generic array creation (IDEA-299195)
GitOrigin-RevId: baa354ad9132bf6d939f19ecd2cfd6cfc56466a2
2024-01-08 17:34:42 +00:00
Alexandr Suhinin
386f5e9ad2 IDEA-335907 [highlighting] highlight unresolved annotations
GitOrigin-RevId: f23313adc278a5c84363cc938c1a25b9d2270ddf
2024-01-08 12:53:05 +00:00
Bas Leijdekkers
551728bdca Java: report local class accessed from another switch branch (IDEA-113520)
GitOrigin-RevId: 7a467fc0cda90dc1944185e83607d8a7d2579cf4
2024-01-07 11:21:02 +00:00
Bas Leijdekkers
e7ee84d0ca Java: correctly check if class is inner class according to the JLS (IDEA-336426)
and clarify error message

GitOrigin-RevId: 4614ced685521a06fee1bb681001e1484f9dca7d
2024-01-05 11:51:41 +00:00
Mikhail Pyltsin
e7ff016f3e [java-inspections] IDEA-341640 Mark main(String[] args) parameter as unused with implicit classes
- return back support `premain`

GitOrigin-RevId: 71ed562fa9e0f514852cb3aff0e993452371aa44
2024-01-05 09:34:47 +00:00
Bas Leijdekkers
6feb5f4628 Java: don't suggest 'final' modifier in error message for interfaces (IDEA-336055)
GitOrigin-RevId: 6023a90b7e15a4154ca030f7cfc175bb1a3d21c7
2024-01-04 11:32:25 +00:00
Mikhail Pyltsin
0df89a1b62 [java-inspections] IDEA-341640 Mark main(String[] args) parameter as unused with implicit classes
GitOrigin-RevId: 08ca1f5ed4f48439b394f7fd313f2b95d50c48e7
2024-01-04 10:15:11 +00:00
Bas Leijdekkers
85598d6315 Java: don't generate uncompilable code in case of chained constructors (IDEA-342068)
in "Initialize in constructor" quick-fix

GitOrigin-RevId: 626d5ce6dfa823c0b1bd37c37c59edc1b45e03d6
2024-01-03 00:25:03 +00:00
Bas Leijdekkers
415d6a8b56 Java: respect "Make generated parameters final" setting when creating constructor parameters from field (IDEA-341545)
GitOrigin-RevId: 3f12122ecf79a835e649425f2301b7fbda950afc
2024-01-03 00:24:56 +00:00
Bas Leijdekkers
bee5c5dacd Java: Improve error message on accessing static field from enum initializer (IDEA-342001)
GitOrigin-RevId: 533518be63dded4577e70a4ecbd747203d136689
2024-01-01 18:09:31 +00:00