Commit Graph

5520 Commits

Author SHA1 Message Date
Tagir Valeev
f3a9cdfdab [java-psi] Static interface method accessible through inheritance should not shadow static import
Fixes IDEA-355152 Good code red when static import collides with static interface method from the hierarchy

GitOrigin-RevId: f6f68cc372928d98bb1f66f2c3ddfaaf63d69702
2024-06-19 15:08:14 +00:00
Bas Leijdekkers
b0b4e53ad2 Java: strip trailing whitespace from text-block string template end correctly (IDEA-354777)
GitOrigin-RevId: fa0266faeeaf63b04451b4f068550e22e2cdf8ee
2024-06-18 19:20:03 +00:00
Mikhail Pyltsin
4221b3e7bb [java-parser] Fix unnecessary qualifiers for static fields for parsers
GitOrigin-RevId: 8e0e9b3351cfc9229137661c555e898194e53060
2024-06-14 18:09:14 +00:00
Bas Leijdekkers
3b9377a54b Java: better error message on duplicate reference in extends/implements list (IDEA-354856)
GitOrigin-RevId: 0ba4eed5966c273f94552d7fe623a69bb6eb6c95
2024-06-14 13:20:40 +00:00
Louis Vignier
47d5d6da56 [javadoc] Add navigation for inheritDoc tags
#IDEA-89977 Fixed

GitOrigin-RevId: 74fc471426b82445abc49ce9b760e005f2130917
2024-06-14 08:36:16 +00:00
Tagir Valeev
267d56619e [java-stubs] TypeInfo.innerDepth: take into account whether the type is static (IDEA-354780)
GitOrigin-RevId: 2f3e781bea91ab738db46507b050a267da51a9d1
2024-06-13 18:36:49 +00:00
Tagir Valeev
62f4255568 [java-psi] ClsJavaCodeReferenceElementImpl: fix when only nested types have annotations (part of IDEA-354780)
GitOrigin-RevId: 19837b975419604a655215ca8a51a7e49c42aa88
2024-06-13 18:36:43 +00:00
Tagir Valeev
09250f103d [java-psi] ClsTypeAnnotationCollector: doc typo fixed
GitOrigin-RevId: 420bd32de1c78ae87ec3c4cd4cb6b684c87b3a0e
2024-06-13 18:36:38 +00:00
Mikhail Pyltsin
ce5a0d65c2 IJ-CR-135655 [java-highlighting] S IDEA-286130 annotations are not allowed in permitted list
- fix text
- fix test

GitOrigin-RevId: 87072c9561528bd04a27c03293f926a33a2519f9
2024-06-13 10:54:53 +00:00
Tagir Valeev
7fe1b165a4 [java-psi] Do not resolve super() call to Object() constructor when superclass is not resolved
Needed for incomplete project model.

GitOrigin-RevId: 2acbba54f4fd50fb3261601f1cb66175d7f19da6
2024-06-07 16:43:12 +00:00
Tagir Valeev
a8788fa3b8 [java-highlighting] Do not try to resolve star-import if existing explicit import fails to resolve
Otherwise, wrong class may be resolved in incomplete project model
AnonymousHashCode.java changed, because java.lang.Object import was unresolved (no JDK configured) and we now refuse to resolve to same-package class if there's a suitable explicit import
beforeHierarchy.java/afterHierarchy.java changed, because the import was incorrect, and it prevented importing implicit java.lang.Exception
predicates2.java changed: incorrect import removed (now prevents importing java.lang.String)
MoveInnerProcessor changes: import refs should be rebound first; otherwise they disallow to rebind normal refs
SpringDataMongoDbQueryCompletionTest changed: erroneous import removed

GitOrigin-RevId: f380409c445306bb9b8aceb5fe4dce1351511283
2024-06-04 20:27:13 +00:00
Mikhail Pyltsin
687ea8c03c [java-highlighting] IDEA-286130 annotations are not allowed in permitted list
GitOrigin-RevId: 921ad24be3586a17a6e393d73687ddc36ce539ac
2024-05-30 17:07:51 +00:00
Bas Leijdekkers
2b4e8631ef [java] consider enum constants used in editor when valueOf() is called (IDEA-293797)
GitOrigin-RevId: 6a494c11f8e658f6bebef2f97623a0ab4801a672
2024-05-27 10:30:37 +00:00
Mikhail Pyltsin
41c184cc13 Revert "IJ-CR-134196 [java-highlighting] IDEA-352727 Incomplete model with lombok"
This reverts commit 1c5fc12a0f4dd70c8899a807dc03925680c68ab9.

GitOrigin-RevId: dd3bcd03cf5dd5d1b3ef8958805579283cbcca37
2024-05-24 21:18:26 +00:00
Bas Leijdekkers
4e62efd5b3 [java] add proper toString() implementation
GitOrigin-RevId: fd03f94bbd8ffee2e8d66f7a3bc4abf27e022334
2024-05-24 20:34:32 +00:00
Mikhail Pyltsin
153827e5e4 IJ-CR-134196 [java-highlighting] IDEA-352727 Incomplete model with lombok
- add a more accurate message for non-initialized fields

GitOrigin-RevId: 1c5fc12a0f4dd70c8899a807dc03925680c68ab9
2024-05-23 14:11:43 +00:00
Bas Leijdekkers
5f42212d1e [java] unused symbol messages for records and annotation types
GitOrigin-RevId: caf22949ba07b7644244865dcbd6b780494a4e6e
2024-05-23 12:46:43 +00:00
Bas Leijdekkers
36be8ea15b [java] better fix to inferring diamond type to also support Scala (IJ-CR-134324)
GitOrigin-RevId: 4eaa4279c2c8fd1aad91f9b51528fecbbe81f4ff
2024-05-23 12:46:43 +00:00
Tagir Valeev
f23bd6e698 [java-analysis] PsiClassType.equals: cache wildcard capturing
Optimize partially IDEA-353780 Syntax Analysis hangs forever with complex use of Java generic parameters

GitOrigin-RevId: 8ef87b3ffafa1aa3996f39a69c4aebbaa4dc2197
2024-05-22 09:55:41 +00:00
Tagir Valeev
1189577111 [java-analysis] PsiSubstitutorImpl#PSI_EQUIVALENCE: inline areElementsEquivalent
Allow to get rid of some double checks, as we know that we are working with PsiTypeParameter specifically
Optimize partially IDEA-353780 Syntax Analysis hangs forever with complex use of Java generic parameters

GitOrigin-RevId: 9563e7f872230794a6db22002acfa2517a506c5c
2024-05-22 09:55:37 +00:00
Tagir Valeev
a9f114717a [java-analysis] PsiSubstitutorImpl: simplify processClass; avoid map copying
Will likely be checked on other code paths
Optimize partially IDEA-353780 Syntax Analysis hangs forever with complex use of Java generic parameters

GitOrigin-RevId: 9fd543691289b5cd8d9d36827b69f49221dbfc61
2024-05-22 09:55:34 +00:00
Tagir Valeev
519acbe8ca [java-analysis] JavaClassSupersImpl: remove ensureValidType check
Will likely be checked on other code paths
Optimize partially IDEA-353780 Syntax Analysis hangs forever with complex use of Java generic parameters

GitOrigin-RevId: f95a3161bfbc6f15c463852d40dbe20471d5b48a
2024-05-22 09:55:31 +00:00
Tagir Valeev
4dfb99a6b3 [java-analysis] JavaClassSupersImpl: avoid many intermediate substitutors
Optimize partially IDEA-353780 Syntax Analysis hangs forever with complex use of Java generic parameters

GitOrigin-RevId: e1d66fcd6839cebea580a068f2ac90f9692538bc
2024-05-22 09:55:28 +00:00
Tagir Valeev
3f46270d18 [java-analysis] PsiSubstitutor.hasRawSubstitution
Optimize partially IDEA-353780 Syntax Analysis hangs forever with complex use of Java generic parameters

GitOrigin-RevId: 3b6d77db8353c21e0d09c9c28d551c1edd6c5e1d
2024-05-22 09:55:24 +00:00
Mikhail Pyltsin
2ca5b2bcd4 [java-lombok] IDEA-352726 Augment class in dumb mode in Lombok
- support dumb mode

GitOrigin-RevId: 93a6325ee1fa6ef515c579aa09bec9eb290ed967
2024-05-21 11:54:54 +00:00
Tagir Valeev
a60bd8c4eb [java-analysis] JavaPsiPatternUtil.getExposedPatternVariables: support switch guard
Fixes IDEA-353697 Instanceof pattern as nullchecks are suggested for removal

GitOrigin-RevId: b187d2dcc71ecac7ad68c696d0583741791c47eb
2024-05-21 10:55:03 +00:00
Mikhail Pyltsin
1b026e0b7f IJ-CR-133924 [java-test] EA-1144109 Fix IndexNotReadyException for other languages
- new JvmLanguageDumbAware introduced

GitOrigin-RevId: 4bdd0195d5defd407e6d2804b528a79b018b50eb
2024-05-20 01:21:32 +00:00
Tagir Valeev
492642606c [java-inspections] UnhandledExceptions: avoid resolve under overload check (IDEA-353666)
GitOrigin-RevId: 58f284295522f92e81fb876945725d27bf462b75
2024-05-17 15:52:27 +00:00
Tagir Valeev
8b83a30705 [java-inspections] RedundantThrowsDeclaration: do not report when method contains unresolved calls
Helps IDEA-353117 Error highlighting in incomplete project model

GitOrigin-RevId: ac7e3931d54ed2ac24c34adf074b8dd09dd7cda9
2024-05-16 17:49:36 +00:00
Tagir Valeev
a25d7951bd [java-mrjar] Treat classes with the different multi-release version as equivalent
It looks like this is a better alternative for now. In particular because we don't know how to resolve a reference from a library class within the same library. The result depends on in context of which module we are doing this resolve, but in general we don't know from which module we started. Currently, we resolve to the same version as the original class, but this might be incorrect. If we consider different versions of a class as different classes, we have problems with code-insight features, as for example, return type of a method and its direct supermethod might be non-equivalent, if the method is declared in source file but a supermethod is declared in the library.
Fixes IDEA-353000 must either be declared abstract or implement abstract method

GitOrigin-RevId: 3fa59bc6c8510f8dc0bcab63ccf491b4ff90610a
2024-05-15 20:15:37 +00:00
Bas Leijdekkers
7b074a10b1 [java] don't skip type parameter extends when inferring diamond type reference to kotlin class (IDEA-352823)
GitOrigin-RevId: 26c97dc1440a5d7e43588be17b96b80b3554943b
2024-05-14 10:29:50 +00:00
Mikhail Pyltsin
2fdade319c [groovy-test] IDEA-353402 Inappropriate support test frameworks for groovy in dumb-mode
GitOrigin-RevId: 270a3cb538b2e2ed6b97f61c8302de7d12f59b21
2024-05-13 18:35:17 +00:00
Alexander Lobas
cde41ba2b4 IJPL-49419 Move old UI to plugin (fix tests)
GitOrigin-RevId: 66c2ddecc30a03803accdd02e59094ff99065e44
2024-05-12 09:26:05 +00:00
Tagir Valeev
deb33bbc1d [java-highlighting] IDEA-353117 Error highlighting in the incomplete project model
First draft

GitOrigin-RevId: e9dbfd1d6c42fe92f43686e465c11201b07cf3d4
2024-05-07 18:33:41 +00:00
Mikhail Pyltsin
2d6af434c0 [java-completion] IDEA-352726 support records for dumbmode
- made `RecordAugmentProvider` implemented `DumbAware`

GitOrigin-RevId: 4101d389688745969d09469b0d910734036324db
2024-05-06 10:56:50 +00:00
Mikhail Pyltsin
45160db0df [java-highlighting] IDEA-352588 Support JEP 455: highlighting for switch with primitives
GitOrigin-RevId: 06636352b202037ec3400b2f9763e101d8ed6042
2024-04-29 21:17:42 +00:00
Mikhail Pyltsin
8416740b8c [java-dfa] Support JEP 455: IDEA-352186 dfa for primitives in patterns
GitOrigin-RevId: 2033b095f35f02222aa40f43d37e07b0019c4324
2024-04-29 21:17:42 +00:00
Mikhail Pyltsin
5679815962 [java-highlighting] IDEA-352677 Incorrect type inference for deconstruction patterns when the type is raw
GitOrigin-RevId: cfdb7e233f067e7dcc177a949aba7ae87c77a538
2024-04-29 20:11:33 +00:00
Mikhail Pyltsin
8b8df76dee [java-decompiler] IDEA-352102 support dumb mode in com.intellij.psi.impl.compiled.ClsModifierListImpl.setMirror
- simplified

GitOrigin-RevId: de9de919b756f0905be25d09a9908335a74415fe
2024-04-22 16:21:32 +00:00
Tagir Valeev
053d59f113 [java-psi] Move JavaLexer utility methods to PsiUtil to make them accessible from java-psi-api
GitOrigin-RevId: 88a728c1d021f703dc9f882e1f9213cd8477ed7a
2024-04-19 17:41:51 +00:00
Mikhail Pyltsin
795eecd6a7 [java-decompiler] IDEA-352102 support dumb mode in com.intellij.psi.impl.compiled.ClsModifierListImpl.setMirror
GitOrigin-RevId: 3d2e0562124a3fcc75c6f681a475dba59c15d69d
2024-04-18 20:19:06 +00:00
Tagir Valeev
6e1b6d24d3 [java] Alternative way to support for multi-release JAR root
Should fix KTIJ-29454 Performance Degradation in completion and highlighting Apr 13, 2024

GitOrigin-RevId: fec9f2a187c77c8af3ab21b3bc89c429d6737853
2024-04-18 10:40:18 +00:00
Piotr Tomiak
3a14f22bc7 WEB-64707 Flaky test com.intellij.tests.BootstrapTests: org.angular2.codeInsight.Angular2HighlightingTest.testTrUnderTemplate
GitOrigin-RevId: a46fed4f6d7e64a89e44cca76bd09c6c117b0abe
2024-04-17 16:21:14 +00:00
Tagir Valeev
deedad65a6 [java-analysis] JavaMultiReleaseUtil: use findChild directly to avoid parsing META-INF/versions
GitOrigin-RevId: 8583ded2c39c6c1e6c8e345a8d7f9cab1d875d74
2024-04-17 14:20:32 +00:00
Vladimir Krivosheev
52d1112027 JavaPsiFacadeImpl - connect with scope
GitOrigin-RevId: 5ad6524a201802d11518d17bb051a8999ec4bf76
2024-04-16 17:06:38 +00:00
Vladimir Krivosheev
b1167c581c cleanup - sort modifiers
GitOrigin-RevId: e733e90257ce8940d87dfd0a6d0e887f60c5330a
2024-04-16 12:48:35 +00:00
Tagir Valeev
36b14c80fd [java-indexing] PsiElementFinderImpl.processPackageDirectories: support MR-JARs
Should fix alternative resolve in MR-JARs in dumb mode
Should fix IDEA-350808 StreamEx can not be resolved

GitOrigin-RevId: 6fae6c419d8e01fb9e7d28904b8df9b94cabdcab
2024-04-12 14:55:57 +00:00
Mikhail Pyltsin
df6d77f795 [uast-inspection] IDEA-350483 IJ-CR-130570 New inspection LoggingGuardedByConditionInspection also deletes comments
- move commenter into UastCodeGenerationPlugin

GitOrigin-RevId: 8c0079fb1e3c0b7f4606bca547e40721c118b9c2
2024-04-09 13:05:17 +00:00
Sergei Tachenov
ea4d7f9f85 EA-1145457 Add NPE check in getClassIconOfKind
This function is only called in two places in PsiClassImplUtil.java,
and in both places it's expected to return a non-null value.
Since we have no way of figuring out why it returned null
(and it doesn't seem reasonably possible), let's try
to throw a more meaningful exception (since one is going
to be thrown anyway) and see what happens.

While we're at it, specify nullability for both input and output.

GitOrigin-RevId: 36523f24ab7218200d34deb82766bb580a8b6215
2024-04-08 16:34:07 +00:00
Bas Leijdekkers
89c8dc03ed [java] better error message on @interface throws/extends list not allowed (IDEA-350501)
GitOrigin-RevId: 1f89c42ac5ffda1d026f6e40cb922b08a095d1dc
2024-04-08 09:54:38 +00:00