Commit Graph

224 Commits

Author SHA1 Message Date
Mikhail Pyltsin
d6bb45a7d4 IJPF-CR-29151 [java] IDEA-374204 JEP 512: use 'Compact Source Files' for implicitly declared classes
- fix naming

(cherry picked from commit 91c2c095f5ca3b2ac3d6fc6de8d85b4f7205cfe7)


(cherry picked from commit e9c066e0a80b0154b69f1cf94334ab1e209dd74f)

IJ-MR-169535

GitOrigin-RevId: 305bc4173b42de65872f95e867b193eaef35a8c8
2025-08-04 12:58:50 +00:00
Mikhail Pyltsin
a631076474 [java] IDEA-374204 JEP 512: use 'Compact Source Files' for implicitly declared classes
(cherry picked from commit e77a013fa84cbafbfec866f6489147115532f656)


(cherry picked from commit 4619021e3dc70c3bec362b174b02a25212b954db)

IJ-MR-169535

GitOrigin-RevId: 639568fba9e6ac43f505e88d4cd5510f6203dd55
2025-08-04 12:58:49 +00:00
Bas Leijdekkers
7737d87729 Java: fix error message when assignment before chained constructor call (IDEA-375281)
(cherry picked from commit 49c4a8ce04845726d1c35aa114612bf5410e1a37)


(cherry picked from commit 65c5e6c26545cad86d03d71f9d1ab818b4f8e1af)

IJ-MR-169535

GitOrigin-RevId: 099919c02438d74a307aa939f2128ad00aac15f9
2025-08-04 12:58:49 +00:00
Bas Leijdekkers
0321ccb557 Java: detect method call before supertype constructor called in anonymous class argument list (IDEA-375801)
(cherry picked from commit 0066baefa439fe1eccf838ffb863c0a0753260d4)


(cherry picked from commit fad6252a4945573dedadc7ae3c5a3d4c2454527f)

IJ-MR-169535

GitOrigin-RevId: 9c2b45cc8db846b9850ad89ce1673356a3d1da8a
2025-08-04 12:58:49 +00:00
Bas Leijdekkers
89671dc01a Java: use consistent naming, avoid context record (IJ-CR-166762)
(cherry picked from commit f02c73ea73a915660388a65b3a30de2f3b13b2d8)


(cherry picked from commit 575f4a13537f7dc0ab58eb485708a047c1eb78c9)

IJ-MR-169535

GitOrigin-RevId: b876e505412cd2b75f7d3e53f006ec3cc91fd425
2025-08-04 12:58:49 +00:00
Bas Leijdekkers
a1481db89d Java: report primitive patterns in switch after case null branch correctly (IDEA-374619)
(cherry picked from commit 3afe71cd1d81188830b1cc332689f42c33e8da8b)


(cherry picked from commit d82959372171236d6d5f36dce4da5e615a3c4790)

IJ-MR-169535

GitOrigin-RevId: 07628789dd9e46eac39c3811ca4534b83777f19f
2025-08-04 12:58:49 +00:00
Bas Leijdekkers
9d345bbb34 Java: report local class instantiation from a different static context (IDEA-372971)
(cherry picked from commit 6bc936ee3dd849db2db187b03edac58f4c9b2c73)


(cherry picked from commit 18853b7d75a40f6a8761489a5655602be915a1ba)

IJ-MR-169535

GitOrigin-RevId: 058ac27f8f0ef5c605c962e596711dafb1eeb5fc
2025-08-04 12:58:49 +00:00
Bas Leijdekkers
695481c17c Java: fix quotes in error message (IDEA-372971)
(cherry picked from commit 6d5fb46cea97bfb20acfce6beed64e33ca3d5142)


(cherry picked from commit 187fd43da740a0b415c38719332402b4725ef19f)

IJ-MR-169535

GitOrigin-RevId: 69a062f0d96dd4770bdd5131a95508a0a6858ea3
2025-08-04 12:58:49 +00:00
Bas Leijdekkers
fcc5e59573 Java: fix incorrect "Static member qualifying type may not be annotated" (IDEA-210876)
(cherry picked from commit 48d08a4d0d3db72fa458d7d67f6ccd72a435b4c8)

IJ-CR-168601

GitOrigin-RevId: ca9dfd435af2f6c580af42d6eb2061d01cad98cf
2025-07-25 09:08:33 +00:00
Tagir Valeev
e79d3d8824 [java-highlighting] IDEA-374968 Red code in ConcurrentSkipListMap.java
(cherry picked from commit cfb9b5cbf965190668e9cb4cb9ed102f26fcd3f7)

IJ-CR-166980

GitOrigin-RevId: 529629a073d5107bd13a12203f0528b49e3b5613
2025-06-26 14:43:03 +00:00
Tagir Valeev
94f84681ac [java-inspections] Redundant cast: do not report if there's a change in compilation errors within the parents
Fixes IDEA-372049 Erroneous RedundantCast inspection on varargs with nested calls
Fixes IDEA-361212 Redundant cast false positive: method call type changes

GitOrigin-RevId: d999fccd9a491445502e48bbab3f0b828ca98f6a
2025-06-16 18:45:28 +00:00
Vladimir Krivosheev
ef0323d07c IJ-MR-162467 don't export intellij.platform.core
GitOrigin-RevId: 05f350c1c087be1bf9b46d8bdac5345a65f55958
2025-06-13 21:52:48 +00:00
Mikhail Pyltsin
e842105580 [java-highlighting] IJ-CR-165049 IDEA-374019 Don't show error about 'main' method if there is an error with braces
- highlight for java 21 duplicated classes

GitOrigin-RevId: 31a935297e6b2dcb843cfd5ce1d10acb78774df1
2025-06-10 22:18:37 +00:00
Mikhail Pyltsin
708f2a6328 [java-highlighting] IJ-CR-165049 IDEA-374019 Don't show error about 'main' method if there is an error with braces
- don't highlight if there is package statement
- skip duplicated nested class for implicit classes

GitOrigin-RevId: eadb287b7e52bfedd04340b8841597b9d6839ee5
2025-06-09 13:40:12 +00:00
Mikhail Pyltsin
dc8ca06f05 [java-highlighting] IDEA-374019 Don't show error about 'main' method if there is an error with braces
GitOrigin-RevId: 38e303a7ace428d45c6e869fce3acc655dba1a6d
2025-06-05 16:28:21 +00:00
Tagir Valeev
4256fabb46 [java-highlighting] More navigation shifts
GitOrigin-RevId: 36ec4d292c798f3a81ba32af7ee5bd1be1d90846
2025-06-04 10:47:19 +00:00
Tagir Valeev
6dd081fd22 [java-highlighting] IDEA-373426 When highlighting an error in method arguments, navigate (via F2) inside the parentheses
GitOrigin-RevId: 760549be13f4c78c66c9074e3de8be34cf0f3a51
2025-05-26 15:22:29 +00:00
Alexey Kudravtsev
6d1f55f160 cleanup: rename file to psiFile to distinguish from VirtualFile
GitOrigin-RevId: e718eac8ba2d2177787ae941d8525b3c154d10fc
2025-05-16 02:54:06 +00:00
Alexey Kudravtsev
be07a22a4c get rid of deprecated method usages
GitOrigin-RevId: 3aafdd3355bba6c98e358a8e52c5cf7a3e3238e8
2025-05-15 16:36:52 +00:00
Ilia Kirianovskii
5686cf1893 [bazel] Update build files
GitOrigin-RevId: 8038dfd0c3f32ea766ea4a73673186c44960f996
2025-05-15 12:18:11 +00:00
Vladimir Krivosheev
b660081493 IJ-MR-162467 don't export intellij.platform.workspace.storage
GitOrigin-RevId: 65ff26dfef46b205eb68dc2f2e60eab4720c87c8
2025-05-15 09:18:18 +00:00
Vladimir Krivosheev
fbc9805e89 IJ-MR-162467 don't export intellij.platform.jps.model
GitOrigin-RevId: ebaebc90d514e5f3046fe2b973647da4bf156625
2025-05-14 18:10:23 +00:00
Vladimir Krivosheev
6f8ff07ccc simplify bazel labels (another step towards using simple names that reflect directory structure)
GitOrigin-RevId: 12bfb2d0fa315d87c7a4ade363d0f834cf324b71
2025-05-08 16:58:30 +00:00
Aleksey Dobrynin
dbeeca52b4 [java jpms] Consider file system case sensitivity when processing JDK modules IDEA-371051
GitOrigin-RevId: e8f7ac3f9d2a3b10a1bd92173cae966d30ee2bc9
2025-05-07 15:47:27 +00:00
Ilia Kirianovskii
675eab0b82 [bazel] Update build files
GitOrigin-RevId: 8666e87d2a1221f1d48e9c170bdf632ed0cfd6d9
2025-04-22 20:36:03 +00:00
Dmitry Batkovich
21a4616d5a java: drop FrontendJavaTypedHandler, move its code to JavaTypedHandlerBase
GitOrigin-RevId: d53e5564dc1813adfe99e9544c9cde5ddbbaac13
2025-04-17 13:10:08 +00:00
Tagir Valeev
69fc3018bb [java-highlighting] Avoid duplicate highlighting for duplicate classes when dangling modifier lists are present inside the class
Fixes IDEA-370725 Multiple 'Duplicate class' errors for the same class

GitOrigin-RevId: 1712abbfd7594028d839b5962c5a4ca13881250f
2025-04-15 07:15:41 +00:00
Tagir Valeev
7e12b8c8c5 [java-indexing] Search sealed inheritors without index and fix scope for scratches
Fixes IDEA-370469 Optimize sealed class inheritor search to explicitly permitted ones
Fixes IDEA-326216 Good code is red: "Sealed class must have subclasses" in scratch files with java 17

GitOrigin-RevId: d500a91d39003ef30e420bce12f3a1a38cefa6f0
2025-04-09 14:42:34 +00:00
Alexey Kudravtsev
a6b53c8961 fix "modifying immutable collections" warnings
GitOrigin-RevId: 5a98fca8ccd622a64d1c8de632c6c3b0af8a78c2
2025-04-09 14:23:32 +00:00
Tagir Valeev
04553c756e [java-highlighting] IDEA-352818 Good code red: usage of package-private member as a generic parameter is reported as an error whereas code compiles
GitOrigin-RevId: 59d67b15be8c8404caed906764c096f74e927dc4
2025-04-04 15:52:06 +00:00
Max Medvedev
0e5df35887 IDEA-359853 rename PsiKeywords to JavaKeywords
GitOrigin-RevId: 549c1b35265414221b6b83ed1b5c426418ad032e
2025-04-03 11:33:32 +00:00
Max Medvedev
0ce5d6986a IDEA-359853 deprecated constants in PsiKeyword
GitOrigin-RevId: 94f23984ad8f4f467fed1f01f47b2a9b46242cac
2025-04-03 00:36:42 +00:00
Tagir Valeev
a8dac43c9e [java-highlighting] Do not report incompatible type on calls when found type is lambda
Fixes IDEA-336129 Incorrect error if excess arguments passed to a function with lambda

GitOrigin-RevId: 712960416933e710740b9053b3604039c9a9b2ef
2025-03-21 14:59:41 +00:00
Tagir Valeev
c855231a3b [java-highlighting] Do not report incompatible type when found type is lambda
GitOrigin-RevId: 511c42c0fbbb713ec34b6a25d1ceddb0d5612b2f
2025-03-21 14:59:41 +00:00
Tagir Valeev
c05cf16cf5 [java-highlighting] Remove duplicated code; cosmetic
GitOrigin-RevId: 6614eab7ab8e4535ebff45f43a0b40b0951c34ac
2025-03-21 14:59:41 +00:00
Tagir Valeev
ef4334ea4b [java-psi] Multi-resolve of functional interface type improvements
- Support constructors
- Support diamond types
- Infer lambda parameter type even if functions differ
Also: PsiCall.multiResolve method; used where possible
Improves IDEA-364426 Missing variable type inference of lambda in a method call while typing a first parameter if all parameters haven't been provided yet (until overload is chosen, even though the first parameter can be inferred already)
Fixes IDEA-318792 Stray "Cannot resolve constructor" error

GitOrigin-RevId: 3227c2da22ef417457ad07a524403b405aeebbcd
2025-03-20 10:06:40 +00:00
Tagir Valeev
b6806f1e7b [java-highlighting] IDEA-369375 A syntax error (PsiErrorElement) should suppress the surrounding error
Also: allow a custom highlighter to supersede the default one

GitOrigin-RevId: c7d7a8be3ef762c9516ed3b637d467d4b544af00
2025-03-20 10:06:39 +00:00
Tagir Valeev
53ddaa64da [java-highlighting] Improve error message in IDEA-369310
Previous hasError status (after syntax error) was not reset. As a result, we did not report the next error on the surrounding element.

GitOrigin-RevId: 60c0be1cc6ca4967eb72e2fc24278cdc5cf2728e
2025-03-18 14:53:44 +00:00
Tagir Valeev
f9bf970c56 [java-highlighting] IDEA-369310 NPE in error highlighter
GitOrigin-RevId: 0944d4f1c9594d138df85041748ff72fb56e436d
2025-03-17 15:01:10 +00:00
Tagir Valeev
830860950b [java-highlighting] Avoid highlighting outside of PsiField psi element
Fixes IDEA-368916 IAE in error highlighting when several fields are declared with shared modifier list

GitOrigin-RevId: 012b6564f9ca1a775894a3fc2b003c4feb2477e6
2025-03-10 21:59:42 +00:00
Tagir Valeev
cd443481a1 [java-highlighting] Unify null-handling in switch-related code
Now, isNullLiteral is used everywhere. There are differences between isNullLiteral and isNullType, but they affect only

GitOrigin-RevId: b778f35bcc321b925689a46a8725df5fcad75c93
2025-03-04 17:38:53 +00:00
Tagir Valeev
bca1a631f8 [java-highlighting] IDEA-368498 Errors about incorrect TYPE_USE annotations are not reported by IntelliJ IDEA
GitOrigin-RevId: 05b017fe457e4efaf0685d429bfd6c2e743936cb
2025-03-04 17:38:52 +00:00
Tagir Valeev
8620b4d854 [java-highlighting] Move JavaPlatformModuleSystem to codeserver.core and deprecate/merge with JavaModuleGraphHelper
We don't need both service and EP to support modules; one thing would be enough. JavaModuleSystem is still used from Kotlin compiler, so should be kept for a while.

GitOrigin-RevId: d55622468eea50cd60c99ada794b6c855dcc0079
2025-03-03 18:30:06 +00:00
Tagir Valeev
9169d77071 [java-highlighting] Include syntax errors into JavaErrorKinds
Still need to handle them sometimes separately, as they should be displayed in DefaultHighlightVisitor, but other clients (not IJ frontend) should process them uniformly as other kinds of errors
Part of IDEA-365344

GitOrigin-RevId: 6f08d0c78bf2b3a481fa454ca5f1cadc99ab70cd
2025-03-03 16:24:04 +00:00
Tagir Valeev
d7e4c31308 [java-highlighting] New highlighter is not experimental anymore; better description
GitOrigin-RevId: 8b9699cf8aed138c2ef7e00bff87e50a546046a7
2025-03-03 13:02:23 +00:00
Tagir Valeev
89dda01eeb [java-highlighting] Exhaustiveness checks migrated (the last error from HighlightVisitorImpl!)
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)

GitOrigin-RevId: c45b258fc18e267122946be7d3aebfd9dc77387f
2025-03-03 12:11:00 +00:00
Tagir Valeev
96b87e85a5 [java-highlighting] fix-related code moved to HighlightFixUtil
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)

GitOrigin-RevId: fcb88cf8e0bb3aa976d675f28863a4ec292c5df5
2025-02-28 17:16:32 +00:00
Tagir Valeev
a1d51b1179 [java-highlighting] hasExhaustivenessError moved to JavaPatternExhaustivenessUtil
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)

GitOrigin-RevId: 0190cf700e9e38b473982c73e2f2d88fdb696870
2025-02-28 17:16:32 +00:00
Tagir Valeev
7ce31efa0b [java-highlighting] Extract JavaPatternExhaustivenessUtil to compute exhaustiveness information
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)

GitOrigin-RevId: 2f02174a6eaa696caa51fed1d4fa1bd953751759
2025-02-28 17:16:32 +00:00
Tagir Valeev
174ffe0cac [java-highlighting] getSwitchBranches moved from SwitchUtils to JavaPsiSwitchUtil
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)

GitOrigin-RevId: 9e356b8522c0bb5a8112d5c30913a4aa3d9cf45d
2025-02-27 19:55:56 +00:00