Commit Graph

21419 Commits

Author SHA1 Message Date
Lev Leontev
4478324e2a IDEA-358871 honor exclusion in CoreJavaDirectoryService#getPsiClasses
GitOrigin-RevId: 19fa5bfadef763431bcf025773127cb58f01f850
2024-09-06 19:39:11 +00:00
Mikhail Pyltsin
6f4d6c3fc7 IJ-CR-144148 [java] IDEA-358751 Java Annotations copied to generated getter / setter
- more tests for annotations with arguments

GitOrigin-RevId: e2a6ce55af9899df4c6fbf9101989c00b8ba2723
2024-09-06 15:36:44 +00:00
Bas Leijdekkers
c47a581888 Java: merge two tests
GitOrigin-RevId: 3811faf0c478ae7e9e2c7ff40da645ef41312d09
2024-09-06 13:43:06 +00:00
Bas Leijdekkers
d009fb0ae7 Java: remove unnecessary calls to setTemplateTesting() from test (IJ-CR-143669)
GitOrigin-RevId: 4e7a40baa1c5b2c4caa1213ae5fefb8d745a85aa
2024-09-06 13:43:06 +00:00
Bas Leijdekkers
7e0038ce14 Java: "Open in editor" checkbox for Replace constructor with builder (IDEA-358746)
GitOrigin-RevId: 72f2bf32432a2b623ab562cefac5568904fb5cee
2024-09-06 13:43:06 +00:00
Tagir Valeev
ec5666b7cc [java] IDEA-358832 Newer java.lang classes should not be resolved on older language level
GitOrigin-RevId: de3f26ca24a881d0daf5eeb7349a5b22058ef40d
2024-09-06 12:04:27 +00:00
Mikhail Pyltsin
fa49b1270e IJ-CR-144148 [java] IDEA-358751 Java Annotations copied to generated getter / setter
- tests for annotations with arguments

GitOrigin-RevId: f03c82ee31fdfc2731f19e3f55bc4dfbdeffa566
2024-09-06 11:17:08 +00:00
Alexey Kudravtsev
a0ddc4085d remove/update changed highlights in one pass to fix IJPL-161572 LSP-based code highlighting is slow in files without PSI
GitOrigin-RevId: f3db04c83e181c01366b563652d73473924a494f
2024-09-05 21:30:41 +00:00
Mikhail Pyltsin
ae365f891c [java-inspection] IDEA-358668 Red code after "Replace 'if' with 'switch' statement" with Enum's
- support enums in patterns

GitOrigin-RevId: b00182c5f77bda03552fb9750e960f74c75582a5
2024-09-05 16:13:13 +00:00
Bas Leijdekkers
028d526405 Java: fix false positive when using java 21 pattern matching (IDEA-357175)
in "'equals()' should check the class of its parameter" inspection

GitOrigin-RevId: f84071ea339bf690eadcba60d491eebe4cb21a7e
2024-09-05 15:02:58 +00:00
Bas Leijdekkers
2870f49e0a Java: disallow making builder class from the constructor class itself (IDEA-254858)
GitOrigin-RevId: 071a0fd3c45f2b28b73b811e0d844a0f1b911372
2024-09-05 15:02:58 +00:00
Mikhail Pyltsin
47768dd4dd [java] IDEA-358751 Java Annotations copied to generated getter / setter
- don't copy annotations except nullable

GitOrigin-RevId: 0592a3e224a8cb0614b496f8f6e6ddd6e2315239
2024-09-05 14:08:34 +00:00
Mikhail Pyltsin
7a9b0a636a [java] IDEA-358431 Support MessageFormat specifier-to-argument navigation, similar to String.format
- fix place for formatted index (without style)

GitOrigin-RevId: aa82d7312bab57ce7b2dc736456574746da5fd9d
2024-09-05 12:57:16 +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
245479dba8 fix(JavaDoc): escaped brackets spacing, reference link with 2+ args
Links like [String#copyValueOf(char\[\], int, int)] won't have an additional space for no reason
Links like [String#copyValueOf(char\[\], int, int)] can now be clicked on for navigation purposes.

GitOrigin-RevId: 42cb742a641b767a82820f5d01a9baff4e78811e
2024-09-04 15:20:28 +00:00
Tagir Valeev
7e2050cf72 [java-inspections] MagicConstantInspection: test to ensure that parameters and fields do not propagate automatically
GitOrigin-RevId: 7053c2c950894e6694353e90d77cb1f2ff772fb3
2024-09-04 12:07:39 +00:00
Alexey Kudravtsev
c83ce9390f tests: cleanup
GitOrigin-RevId: 4c0abf48343a2ad6c4ebfea78c20d66cd981c02b
2024-09-04 12:03:32 +00:00
Tagir Valeev
6c29e44d6b [java-inspections] Track references in 'extends'; fix getMinimalAccessLevel for default constructor
Fixes IDEA-357158 "Replace constructor with factory method" makes code uncompilable

GitOrigin-RevId: dfe3341d2cb0ea975aa6a40d045bf8419ff39e5f
2024-09-04 11:31:52 +00:00
Alexey Kudravtsev
7040e8e2ae fix testThrowingExceptionFromInspectionMustPropagateUpToTheLogger():
- sometimes an exception could be wrapped in TestAssertionError by Logger - expect both
- avoid data race when thread 1 does "progress.cancel(); save exception" and the other thread does "progress.checkCanceled(); catch (PCE) { get saved exception }"
- unify saved exception storage in the DPI

GitOrigin-RevId: cc960addac3c9eb71522fc6c63edf8248c90ca71
2024-09-03 17:45:46 +00:00
Aleksey Dobrynin
f4f245c45a [java-property-tests] Add coroutine timeout, validate empty methods, and update calculation methods.
GitOrigin-RevId: 8134ec4be5fbb565a0f184c5250fc7831b89c477
2024-09-03 16:28:46 +00:00
Bas Leijdekkers
0c4fc2ab23 Java: don't suggest to "Replace with text block" a text block (IDEA-358449)
GitOrigin-RevId: 4db08b1a6a9e5bb3c957e23af185e6df1f757c47
2024-09-02 21:52:50 +00:00
Tagir Valeev
b01ac55564 [java-refactoring] Inline variable on non-initialized declaration
Could be available if there's only one write visible for all the reads
Fixes IDEA-354157 Inline variable not working when staying on uninitialized declaration

GitOrigin-RevId: e257b2b493a3902e901699efa4eac90f62e3108b
2024-09-02 21:01:25 +00:00
Tagir Valeev
84ce93ddc5 [java-dfa] Test for IDEA-357456
GitOrigin-RevId: b7b97300c5a4512009b006cdfafeba56bcfe4c69
2024-09-02 21:01:25 +00:00
Tagir Valeev
49f0880f57 [java] IDEA-358431 Support MessageFormat specifier-to-argument navigation, similar to String.format
GitOrigin-RevId: 5bfb87b48e714f92f5c469d4110426ff76f8c14b
2024-09-02 21:01:25 +00:00
Mikhail Pyltsin
dd822c1bc7 IJ-CR-142710 [java-inspections] IDEA-357725 LoggerInitializedWithForeignClassInspection should skip when the logger is not the final field
- fix texts

GitOrigin-RevId: 85d86f362ce860118d2a047321bf4916e01757da
2024-09-02 18:36:41 +00:00
Alexey Kudravtsev
b96b50d09c fix test: do not call super.visit() because it set the "info must be removed" too soon
GitOrigin-RevId: ee5bf56bb2a68353aae153a3ea7d94c2e9fdf3ff
2024-09-02 17:00:27 +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
Mathias Boulay
d4e45d6061 tweak(JavaDoc): Disable some inspections on older javadoc
Some inspections are pointless to check, related to javadoc tags.

GitOrigin-RevId: b7bb8bba4b51f1d90678705af3da8e5e5c4a4907
2024-09-02 16:39:21 +00:00
Alexey Kudravtsev
121f917f61 IJPL-161270 Semantic highlighting is still visible after disabling
GitOrigin-RevId: 0af6e1899921ffaf613240ce0865d13d607d86c5
2024-09-02 15:44:59 +00:00
Mathias Boulay
19b9a28603 fix(JavaDoc): Refactoring misplaced tags
GitOrigin-RevId: 313091e94f8b65d379615f91dca7b975428aeeba
2024-09-02 10:36:29 +00:00
Frederik Haselmeier
feb3dd7614 [kotlin] Fixed daemon has terminated error causing flakiness in Kotlin compiler reference tests
KTIJ-31055

GitOrigin-RevId: 544a5cda4f0fa6fa724ed3655577baf0045fc148
2024-09-02 10:33:56 +00:00
The1xDeveloper
dc4b3eccd4 Add ExpandCollapseToggleAction to IdeActions so it can be used by plugins like IdeaVim to support 'za' vim motion
closes https://github.com/JetBrains/intellij-community/pull/2825

GitOrigin-RevId: 27026dda3b9355a652c8ad5d6cb58efdac27ced6
2024-09-02 09:09:34 +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
Bas Leijdekkers
ed81723f17 Java: don't evaluate constant for incomplete expressions
GitOrigin-RevId: 15542db6b8631edbc96bd7ea9cc2b1a975fcbcbb
2024-08-29 19:03:09 +00:00
Bas Leijdekkers
8827db8d65 Java: remove enum functionality from constant evaluator
GitOrigin-RevId: edcb80e7ddeee3a45b83c98cf77f3c56fd850298
2024-08-29 19:03:09 +00:00
Tagir Valeev
cd2be32f62 [java-inspections] Java9CollectionFactoryInspection: copyOf: respect declared nullity of source collection
Fixes IDEA-349386 Don't suggest List/Set/Map.copyOf when elements are annotated @Nullable

GitOrigin-RevId: f2c1298394f204732437d304f68272f6cf406cc0
2024-08-29 18:27:57 +00:00
Alexey Kudravtsev
986ce23323 do not return duplicate class references for string literal (part of KTIJ-27513 K2 IDE: Slow reference search for specific symbols in unused symbol inspection)
GitOrigin-RevId: 7dc1777e0a741f785d01f4777baa35a423a068c1
2024-08-29 17:34:57 +00:00
Mathias Boulay
d03ded346a fix(JavaDoc): Inline code block support
GitOrigin-RevId: ac902221d848139b9a92559b0f61558cfb259319
2024-08-29 16:55:53 +00:00
Mathias Boulay
2bd10fba65 fix(JavaDoc): Html code support in tags
GitOrigin-RevId: b4d6a52b9e5a8f292a41b5b94e93b6bfd16364b9
2024-08-29 16:55:53 +00:00
Tagir Valeev
07c73fd64a [java-dfa] Recognize String.strip/stripLeading/stripTrailing/isBlank
Also: limit the length of the resulting string if the length of the original string is known

GitOrigin-RevId: bfe3752b15949047366c3d3d79c7d13a49193abd
2024-08-29 14:08:22 +00:00
Tagir Valeev
13845dd38c [java-dfa] Call restrictFromState when we track chained qualified value as well
It's possible that we track chained qualifier value only. E.g., under if (!str.trim().isEmpty()) we store nothing about str.trim, but we know that str.trim.length is 'int >= 1'. So if later we get a new fact about str, like if (str.equals("\n")), we still should call restrictFromState, as this fact implies that str.trim == "" and str.trim.length == 0, contradicting the current memory state, so we should not apply such a fact.

Fixes IDEA-357897 DFA produces exception: Precalculated value description.trim mismatches with method handler
Should fix at least partially EA-1080132 ISE: MethodCallInstruction.getMethodResultValue (String.trim, Enum.name)

GitOrigin-RevId: 47849768da15f2878957a0fcce9e358152fbd7e4
2024-08-28 17:54:26 +00:00
Tagir Valeev
59325634ab [java-inspections] IDEA-356832 Inspections ignore redundant Class::cast method call
GitOrigin-RevId: 390a19d69020bc91f1395e6c4d23f14992ca396b
2024-08-28 17:54:26 +00:00
Mikhail Pyltsin
07ce79c60f IJ-CR-143108 [java-action] IDEA-356782 Incorrect place of caret into text block with injection after enter
GitOrigin-RevId: 0550bdd9f009773eb84fb51c0faf82df157b5265
2024-08-28 13:04:23 +00:00
Mathias Boulay
2750d267ea fix(JavaDoc): better language highlight on codeblock
GitOrigin-RevId: 2445935a3c083ecca24d899a300d02c08378f525
2024-08-27 18:12:21 +00:00
Mathias Boulay
d69bdfe6a4 fix(JavaDoc): illegal character on escaped array types
GitOrigin-RevId: dd8098159715bd42510d807077d2679b365c546f
2024-08-27 17:29:56 +00:00
Mikhail Pyltsin
4aa99fd33a IJ-CR-143396 [java-inspection] IDEA-356207 incorrect work with typeUseWithType option
- more tests

GitOrigin-RevId: 14fc2ab77a0659541423741c704437c7fba446b6
2024-08-27 14:43:05 +00:00
Mikhail Pyltsin
4362fe4584 IJ-CR-143108 [java-action] IDEA-356782 Incorrect place of caret into text block with injection after enter
- add <cursor> for tests
- get rid of `Host`
- reformat code

GitOrigin-RevId: 0ca88901798a6f282089992f48fd1c88d26e0293
2024-08-27 12:46:52 +00:00
Georgii Ustinov
c15dd29151 [Java. Inspections] Add test to ForwardCompatibilityInspection to check qualified yield call
IDEA-358316

GitOrigin-RevId: 9b1633787a92b719606c31f09499cad9bde8dcfb
2024-08-27 10:05:40 +00:00