Commit Graph

7323 Commits

Author SHA1 Message Date
Bas Leijdekkers
b5a53393ed Java: fix bad code is green problem (IDEA-366474)
"cannot reference super before superclass constructor is called"

(cherry picked from commit a2eeb5211fed697bc99ec9620bca4493c5a7adae)

GitOrigin-RevId: 6c404d216a804825e70d5c37866e3055dc8c5443
2025-02-13 14:23:53 +00:00
Bas Leijdekkers
3746633993 Java: match javac from jdk 24 in error highlighting for Flexible Constructor Bodies - JEP 492 (IDEA-364189)
(cherry picked from commit 686bd65963483f93acd22ae8956681f889105409)

GitOrigin-RevId: b8c02f835e7173b68aa39aee57e4a8c590608482
2025-02-13 14:23:53 +00:00
Bas Leijdekkers
8e0d1b142f Java: fix error message (IDEA-364189)
(cherry picked from commit 6ddc29ca9af9523ac8597bc00b920b872a4250b6)

GitOrigin-RevId: 4ae3e61c614cde608f4593ec7fa758b2ed6c1a5d
2025-02-13 14:23:52 +00:00
Mikhail Pyltsin
b3f8bbb608 [java-highlighting] IDEA-365996 Constructor in an implicitly declared class is not highlighted as error
(cherry picked from commit 2de45c452608cea2ab314511060ac733259a8c18)

GitOrigin-RevId: daed31a96a3fb96a6cbed183443ed90205b679f3
2025-02-13 14:23:52 +00:00
Mikhail Pyltsin
aea70bba3b [java-highlighting] IDEA-363617 Support JEP 494: Module Import Declarations (Second Preview)
- support shadowing module imports by package-on-demand

(cherry picked from commit 643fc10bcbfee2f1d41ec02e624b30bc3a48e4bb)

GitOrigin-RevId: d1e49b2d48f0b69f8e15393cb823e5529f9b4452
2025-02-13 14:23:52 +00:00
Tagir Valeev
a35bbc7c9c [java-inspections] Preview feature warning: limit highlighting to method name
Fixes IDEA-362013 Stream.of should not be highlighted because it's not a preview feature


(cherry picked from commit 0818188d2e5ae25916c0433dfe976c808eebf869)

IJ-CR-151174

GitOrigin-RevId: c81154ec031a4da1ef432831628fe93537ce599b
2024-12-13 10:37:17 +00:00
Tagir Valeev
071179ffed [java-intentions] IDEA-363624 Create Class generates invalid and redundant annotation @NotNull @NotNull for constructor parameter
(cherry picked from commit 9c3c9c55517369e6715c65a9696c287514261a10)

IJ-CR-151031

GitOrigin-RevId: 8306c8925395abd7dcee24de847335e4e9b1f535
2024-12-09 10:58:58 +00:00
Tagir Valeev
d2d87a71f3 [java-intentions] IDEA-363734 "Make Xxx impelent Yyy" quick fix inserts @NotNull
(cherry picked from commit 4e9a3f94cf1aedadd0b2c4699e168ccb3be0e405)

IJ-CR-150708

GitOrigin-RevId: ced9d4595e513387ebf996bf8dd0894877ef0f3e
2024-12-05 01:08:15 +00:00
Tagir Valeev
32684d7e9f [java-intentions] Create method from usage should skip external type annotation
Fixes (finally) IDEA-360115 Create method from List.of results in long jetbrains NotNull annotation


(cherry picked from commit 8e1657ad1d3af686e50c048eea1f7c439ec7365b)

IJ-CR-149633

GitOrigin-RevId: 1c86e8a1b9b0d5902f095ca7393bef8e2dea66d9
2024-11-19 14:11:05 +00:00
Tagir Valeev
1d58cede1d [mod-commands] Rely on document text, rather than PSI text when building the final command
For some reason, they might be different. Probably due to incorrect PSI at the beginning of the action. In any case, document should be the source of truth, as the ModCommand will be applied to the document, rather than PSI
Fixes IDEA-359782 try postfix completion generates trailing garbage


(cherry picked from commit 292399a28d347f9b4fa22730002299d5c5b68167)

IJ-CR-147269

GitOrigin-RevId: 2ccd437d3c51c0ded16be634650ed8dfc59770b4
2024-10-22 14:39:05 +00:00
Bas Leijdekkers
dfae4a26c2 Java: "Generate overloaded constructor with default parameter values" for records (IDEA-360071)
GitOrigin-RevId: a20fd5478241de404df3243f1b8b9a7d1a73829e
2024-10-02 20:13:41 +00:00
Bas Leijdekkers
95ed423db6 Java: don't create final fields from parameters when this does not compile (IDEA-359981)
GitOrigin-RevId: 3a85c9310c8928cf65459ae1ff1825fabf31ec03
2024-10-02 20:13:41 +00:00
Bas Leijdekkers
14096f0f03 java: don't create final field from parameter when this does not compile (IDEA-359980)
GitOrigin-RevId: d7ce31fbb607a409afa0e2b988eed424440cc336
2024-10-02 20:13:41 +00:00
Tagir Valeev
3ec30c1c1b [java-highlighting] IDEA-359187 LVTI: 'lambda expression requires an explicit target type' not highlighted as error when in parenthesis
GitOrigin-RevId: 248072c38aeaf7f05b088c04bc435ecd0e940dd8
2024-10-02 14:26:44 +00:00
Tagir Valeev
5905b6f62a [java-inspections] TrivialFunctionalExpressionUsageInspection: more accurate side-effect handling
IDEA-355026 "Trivial usage of functional expression" breaks semantics if one argument updates the variable used in another

GitOrigin-RevId: e3d9374ecc427d62cee0d821473e9119ae240fc5
2024-10-01 14:50:18 +00:00
Georgii Ustinov
3f4982e47d [Java. Logging] Disable completion on reference expressions for logger
IDEA-359882

GitOrigin-RevId: f5550041a59d0b89cf1b18a3ccd8104eed0fb240
2024-09-30 17:50:19 +00:00
Mikhail Pyltsin
f474d8047b IJ-CR-145218 [java-inspections] IDEA-201932 Provide inspection to highlight redundant creation operations in java date time api
- combine into one inspection
- fix messages

GitOrigin-RevId: d4e064948f8c730c4d68c58e6c9b1277c6b66b4d
2024-09-27 17:12:29 +00:00
Bart van Helvert
690f1167ff [java] Don't suggest generating broken overload constructors
In implicit and anonymous classes, constructors can't be declared. #IDEA-359731 Fixed

GitOrigin-RevId: 76e978d04052dffd955bfac6c1016fa707201b29
2024-09-27 16:07:34 +00:00
Bas Leijdekkers
6c2a3df811 Java: generated equals(), hashCode() and toString() can now use getters in records as well (IDEA-359692)
GitOrigin-RevId: d94b6278d61e5a0497a402c8201e31d9165691ab
2024-09-25 21:53:25 +00:00
Bas Leijdekkers
7fbe663b37 Java: don't add instance check when generating equals() (IDEA-357686)
GitOrigin-RevId: 21a0555c2fe6be705fe4d510c8d8d08238af4585
2024-09-25 21:53:25 +00:00
Mikhail Pyltsin
bff9894b8b [java-highlighting] IDEA-359527 Class 'MyRecord' must implement abstract method 'value()' in 'MyInterface' in implicit class
- incorrect accessibility in implicit records with light members

GitOrigin-RevId: f55453f1c212d785e7b5fde78c4e0fbc4870ce86
2024-09-25 09:24:37 +00:00
Tagir Valeev
34006d311d [java-annotations] Type annotations for reflection
GitOrigin-RevId: 8a38692e45db2775c4ccee3b3cfcd40864b47224
2024-09-25 08:04:53 +00:00
Tagir Valeev
f7a5a79a2e [javadoc-tests] Test for external type annotations (IDEA-231901); bump default level to 21
GitOrigin-RevId: 184754528a776dbd7545cecb7da625840e2cbffe
2024-09-19 19:06:26 +00:00
Tagir Valeev
be4f6cd282 [java-inspections] Redundant keySet()/values(): support entrySet(); avoid warning inside Map implementations (IDEA-346005)
GitOrigin-RevId: ebf925ab3ff7c1357248a65201fe654aada0f4e8
2024-09-19 19:06:26 +00:00
Mathias Boulay
0cdf89293d fix(jdoc): inline mk structs break detection
GitOrigin-RevId: 0cb1adbd59262523ce59767fee5f33e78234bd9f
2024-09-18 14:34:29 +00:00
Georgii Ustinov
2da97bd1ae [Java. Code Completion] Simplify lambda expression for Logger completion test
IDEA-359199

GitOrigin-RevId: f250bb6713f003ec06875ef149551de602573836
2024-09-18 06:25:24 +00:00
Mathias Boulay
fef6778210 fix,test(jdoc): Stabilize spaces in test files
GitOrigin-RevId: 0c6b8c8ca44e90bdc80764b5fa1d8f2656762100
2024-09-17 16:28:17 +00:00
Mathias Boulay
b7d5b6900c feat(javadoc-handler): basic typing assistance
GitOrigin-RevId: 500c7ede653a91d1ea67c85efc2248657c35ccab
2024-09-17 16:28:17 +00:00
Mathias Boulay
d6d13853e6 feat(javadoc-handler): auto insert end of code fence
GitOrigin-RevId: 24c855a125c859bcc80f43c93a7d6c57ec9e3586
2024-09-17 16:28:17 +00:00
Mathias Boulay
027d4fb022 fix(javadoc-handler): insert leading tokens before start of comment
GitOrigin-RevId: 2fc351433f7841f9753d67e2a8d925a9991a1716
2024-09-17 16:28:17 +00:00
Mathias Boulay
68242cd5b9 fix(javadoc-gen): @code tag rendering full line
Turns out there was another edge case that the ones from the Youtrack issues.

GitOrigin-RevId: 6bccd3d0aa4fc121059558b847ba90731d9c8962
2024-09-17 16:28:17 +00:00
Mathias Boulay
e05667345c fix(javadoc): Missing character on new lines within snippets
#IDEA-358874 Fixed

GitOrigin-RevId: e03874f588e31c106d3a25518c05e0850b3fcd24
2024-09-17 16:28:17 +00:00
Tagir Valeev
ac0c57748b [java-inspections] IDEA-346005 Add new inspection: Unnecessary keySet() call
GitOrigin-RevId: d1f1db0ae939017a8550b91cd8742dc222a8db99
2024-09-17 07:28:39 +00:00
Georgii Ustinov
507ae5bd17 [Java. Logging] Simplify logic of JvmLoggerCompletionContributor
IDEA-359199

GitOrigin-RevId: 946fcfa18dedd03905e6f8a638ae0a86c3515b75
2024-09-16 12:19:41 +00:00
Yuriy Artamonov
47f1c44a90 [java] IJPL-158521 Actions: fix ellipsis in messages for Java actions
GitOrigin-RevId: bfce0d6efa8747660c4b9af3d8defbfa47e4509a
2024-09-15 14:50:09 +00:00
Georgii Ustinov
f7ff124bf1 [Java. Logging] Improve completion for logger
IDEA-359199

GitOrigin-RevId: a3162b75c3fa4ed32b3b17bcbf0753cf01fe72db
2024-09-14 14:51:59 +00:00
Bas Leijdekkers
5c06f74975 Java: don't report non-private field as assigned not accessed when it is implicitly read and written (IDEA-357404)
GitOrigin-RevId: 943ef6961c19510e5d4291367293424a87499487
2024-09-13 16:40:26 +00:00
Tagir Valeev
8ed70be46d [java-inspections] IDEA-359031 Preview API use warning: ignore imports
GitOrigin-RevId: d9ba762be3f03f60372a70471f4c04efc26a9a66
2024-09-11 12:08:36 +00:00
Tagir Valeev
9092a09789 [java-intentions] BindFieldsFromParameters: disable for existing field if static or type doesn't match
GitOrigin-RevId: ad1d93533626f5e76a3f53c5ab25b06a5aa07f1e
2024-09-10 23:44:56 +00:00
Tagir Valeev
0f2865b919 [java-intentions] DefineParamsDefaultValueAction: better check of possible signature conflicts
GitOrigin-RevId: 5eb26ee62852e2e5e6188e740b807c775ded0277
2024-09-10 23:44:55 +00:00
Mathias Boulay
055ce7ad56 Fix(JavaDoc): fix markdown construct being unaffected inside legacy docs
GitOrigin-RevId: 25beb0f37329a1b98a511144558c291b5c284398
2024-09-09 18:26:13 +00:00
Tagir Valeev
ad5122e632 [java-completion] Use var when preferred
Fixes IDEA-212766 Java Postfix completions should use Java 10 var keyword if possible (for, fori, cast, ...)

GitOrigin-RevId: 58813cb4f7ecfbaf6da5fd51237a7e778313fff2
2024-09-09 17:41:44 +00:00
Mikhail Pyltsin
d72eba89a1 [java-completion] IDEA-357258 Java 23: .switch postfix completion is not supported for primitive data types
GitOrigin-RevId: ae848584ee81611bde2e1201c79923c2e170f6e6
2024-09-09 15:21:29 +00:00
Mathias Boulay
2cfd03bd80 fix(JavaDoc-gen): compilation on backport, Better rendering, respect IDE options
Fixes IDEA-354610, IDEA-353932
Partially addresses IDEA-352642

fix(JavaDoc-format): handle indent on markdown

fix(JavaDoc-backport): fix compilation

GitOrigin-RevId: 5d1705da21be59ec0bc92a1b35bdf986a3227064
2024-09-09 12:59:51 +00:00
Bas Leijdekkers
c47a581888 Java: merge two tests
GitOrigin-RevId: 3811faf0c478ae7e9e2c7ff40da645ef41312d09
2024-09-06 13:43:06 +00:00
Tagir Valeev
cf460af83e [java-inspections] IDEA-358770 Stream/Optional desugaring: support Predicate.not
GitOrigin-RevId: af9cdb5e674406bbbe94a746e85a662a590a4d3d
2024-09-05 12:54:57 +00:00
Anna Kozlova
716e2552f3 [java] quick doc: skip duplicated links in package doc
- classes might come from different libraries, but given the same links, it's impossible to navigate to desired one anyway

^KTIJ-26237 fixed

GitOrigin-RevId: 4db0b5e1dc38399376e998c04869374f3ef8d17d
2024-09-04 18:23:36 +00:00
Mathias Boulay
286567da08 fix(JavaDoc): Collapsed markdown comments with wrong suffixes
Not perfect at all, it should be able to rely on the commenter API instead.

GitOrigin-RevId: f41d181e9f27905bca1156912b7850f5a96ba943
2024-09-02 16:39:21 +00:00
Bas Leijdekkers
952c203d93 Java: fix surrounders selecting generated code (IDEA-355874)
GitOrigin-RevId: 5ab70db1b9aff1a5a7483729e2e65a24fffa6dab
2024-08-29 19:03:09 +00:00
Bas Leijdekkers
f198a23cdf Java: don't evaluate enum constants as constants expressions
GitOrigin-RevId: c5d703ce78b569a3bdab9e8e9dcc2e95bdadd07f
2024-08-29 19:03:09 +00:00