Commit Graph

207 Commits

Author SHA1 Message Date
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
Tagir Valeev
fc6de8a515 [java-highlighting] Migrate checkRedundantDefaultBranch
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)

GitOrigin-RevId: 8bf45e8e4e26a2766c9755a90dfba6d6cc94e198
2025-02-27 16:13:31 +00:00
Tagir Valeev
b3b3fcf587 [java-highlighting] Use JavaPsiSwitchUtil.isBooleanSwitchWithTrueAndFalse
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)

GitOrigin-RevId: bde4078ac2d09977730c7803a3565c9bbe683a06
2025-02-27 16:13:31 +00:00
Tagir Valeev
85bcd9b77e [java-highlighting] PatternsInSwitchBlockHighlightingModel: more refactoring of exhaustiveness checks
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)

GitOrigin-RevId: 54943a1bd0996e48023e577c6780001d9fcbd404
2025-02-27 11:42:20 +00:00
Tagir Valeev
61d6c1a24d [java-highlighting] checkCaseLabelCombination: variable renamed
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)

GitOrigin-RevId: 8b5e6d9b72587042d57e8e6b0d2059972ce3bf91
2025-02-27 11:42:20 +00:00
Tagir Valeev
12a0fbbe73 [java-highlighting] checkDominance migrated
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)

GitOrigin-RevId: 4552c6ca739c04aa4ce53f1b5376ef8f4b454207
2025-02-26 18:59:35 +00:00
Tagir Valeev
fa60db5164 [java-highlighting] Switch dominance: extract reusable code to JavaPsiSwitchUtil
Also: move JavaPsiSwitchUtil to codeserver.core; isEnhancedSwitch to ExpressionUtil (used in ControlFlowAnalyzer which is psi-impl module)
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)

GitOrigin-RevId: d9b1070db6b5b44f7523db284ca5fabcc1cdef22
2025-02-26 18:59:35 +00:00
Tagir Valeev
30c5bb9996 [java-highlighting] Remove more unused messages from JavaErrorBundle.properties
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)

GitOrigin-RevId: 158354577fc61a14ed229194c6376b96adefabb0
2025-02-26 18:59:35 +00:00
Tagir Valeev
6d7ef89b5a [java-highlighting] Migrate fallthrough-related errors
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)

GitOrigin-RevId: 0a2b7e91a93e8207101368c0fcfb3cf58a793203
2025-02-26 10:29:12 +00:00
Tagir Valeev
711a88d18d [java-highlighting] Simplify range/anchor API for JavaCompilationError/JavaErrorKind
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)

GitOrigin-RevId: a2ce220aa2ae0a08bc5c35180fe63813574e3d01
2025-02-25 17:24:00 +00:00
Tagir Valeev
88f3eacae7 [java-highlighting] Make description always plain-text (html was not used de-facto)
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)

GitOrigin-RevId: c6c7f571929908237e5c818f4bf8af5bcd61b88c
2025-02-25 17:24:00 +00:00
Tagir Valeev
ecd965ed36 [pwa] Migrate from HighlightVisitorImpl to JavaErrorCollector; tune API
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)

GitOrigin-RevId: a611259d44b044132d6cedd30919aaf2917773f7
2025-02-25 17:24:00 +00:00
Tagir Valeev
2250bb64ee [java-highlighting] Finish moving module access errors
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)

GitOrigin-RevId: 0f89a7cd9609aea2780e132118aae892a6b0bafd
2025-02-25 17:24:00 +00:00
Aleksey Dobrynin
680ff9a391 [java, import-module] Correction of grammar (IDEA-367430) IJPF-CR-27284
GitOrigin-RevId: a0c4f49d53963734ff5e66d17d4632fdb12691b2
2025-02-25 16:06:14 +00:00
Tagir Valeev
8492a12ace [java-highlighting] JpmsModuleAccessInfo: replace lambda with JpmsModuleAccessMode
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)

GitOrigin-RevId: 6433be5cf21b45ca79fbbaa1650f52e9249e4f26
2025-02-24 11:43:33 +00:00
Tagir Valeev
d843df8aa8 [java-highlighting] HighlightUtil.checkModuleReferenceAccess migrated
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)

GitOrigin-RevId: 72eaed5e89969c19e29dee7a6921fa3b5f45c6c0
2025-02-24 11:43:33 +00:00
Aleksey Dobrynin
ee90bc0f93 [java, jigsaw] support JEP 11 class file attributes (IDEA-366117) IJ-CR-154755
GitOrigin-RevId: 44bfa9f62cb31f539c40cb2ecd534fa0856ac8aa
2025-02-24 10:44:41 +00:00
Aleksey Dobrynin
5151559045 [java, jigsaw] Support JDK-8197532: add tests (IDEA-367339) IJ-CR-154794
GitOrigin-RevId: e3acb5c8848ae13da6f28c1593b432e27c81cd14
2025-02-24 10:44:41 +00:00