Commit Graph

738 Commits

Author SHA1 Message Date
Ilya Kirillov
8f34a2a79f [java] allow providing exclusions for PsiShortNamesCache by specific languages
It will be additionally used in the following commit

KTIJ-30842

GitOrigin-RevId: 8370a2ef5157b8c4afff45cfbf6c1e563cb9cd82
2024-08-15 17:53:01 +00:00
Max Medvedev
c57b418673 cleanup JavaSuperClassNameOccurenceIndex.java
GitOrigin-RevId: f9ac89cf7ba2494112de5595d851132b981bfe2a
2024-08-14 14:05:32 +00:00
Peter Gromov
f9fcfadb11 JavaBinaryPlusExpressionIndex, JavaNullMethodArgumentIndex, PropertyCodeReferenceIndex: check for content substrings
GitOrigin-RevId: a2b31c05cb7380354592539b59653e27c66f0a0a
2024-08-11 11:16:44 +00:00
Ilya Kirillov
3e42f78fcc [kotlin] Do not use resolve/LC in go to class/symbol for Kotlin
Instead, implement the functionality via Kotlin declarations. Previously, it worked in a mixed mode: some declarations were provided via LC, some via Kotlin declarations.

Additionally, this change makes Kotlin "go to symbol/class" fully dumb-aware.

New behavior:
- All declarations are now provided via plain Kotlin declarations.
- No Light Classes are used:
  - To avoid using LC, `PsiShortNamesCache` is adapted in a way that it can ignore `PsiShortNamesCache` implementations which are explicitly marked as producing generated declarations instead of existing Java-based PSI like `PsiClass`, `PsiMethod`, etc.
    - `KotlinShortNamesCache` is marked as such, so it's ignored.
- As no resolve is used, all Kotlin contributors work in dumb mode.
- For facade declarations, like callables (functions or properties) from a facade or a facade class itself, new Kotlin contributors create new `PsiElementBasedNavigationItem`:
   - It points to the original Kotlin declaration (or to a `KtFile` in the case of a facade class itself).
   - In go to class/symbol action, duplicated declarations are merged with the original ones, so they are used only for text search purposes.
     - It's reflected in the tesdata updates
- `GotoSymbolModel2.getFullName` is updated so it can handle not only `PsiElement` but also a `PsiElementNavigationItem`
- Behaviour of qualified name is stabilized:
  - Previously, it produced `(in Container).Foo` for LC-based classes and `Container.Foo` for plain Kotlin classes.
  - Now, it always produces `Container.Foo`
       - It's reflected in the tesdata updates

^KTIJ-30913 fixed
^KTIJ-30842 fixed

GitOrigin-RevId: c671f6e161dd530e19e8abbbc7046f1cd121908d
2024-08-09 19:06:53 +00:00
Tagir Valeev
229eff0461 Raw type and other warnings fixed
GitOrigin-RevId: cde52de8987d2a995c4d2861f3b77356d79f3dd4
2024-06-28 16:52:24 +00:00
Bart van Helvert
7a3729260a [java] Make implicit class index final
GitOrigin-RevId: 053e62b390ad3835b64295214551ae9b5fc1f24e
2024-06-26 18:23:10 +00:00
Tagir Valeev
4dcafc063c [java] IDEA-350754 Java wildcard imports not recognized when class is located in multi-release JAR
GitOrigin-RevId: 669f22c7f718a83129cf9c88d89a55ba3df2126a
2024-04-16 16:24:07 +00:00
Tagir Valeev
3122a1801c [java-indexing] JavaVersionBasedScope: remove unused field
GitOrigin-RevId: ff42a273bdaff82ffd8807837b69b6909b6a5270
2024-04-11 14:46:20 +00:00
Tagir Valeev
47a98d4500 [java] LanguageLevel#feature method; javadoc
GitOrigin-RevId: f3c57f7101b3ce7369c66b97411c897bdcd46d24
2024-02-15 13:23:21 +00:00
Tagir Valeev
c3b35ef889 [java] Rename methods to avoid mentioning explicit Java version
GitOrigin-RevId: a2d0fcf924b19d88462cbae662f6bc50fac51903
2024-02-13 15:29:35 +00:00
Tagir Valeev
bf85acba82 [java] More JavaFeature uses
Also: new JavaFeatures (ASSERTIONS, ENUMS, PRIVATE_INTERFACE_METHODS)

GitOrigin-RevId: f073845a77730b486afa56317e2c12ff044f5425
2024-02-12 19:12:43 +00:00
Daniil Ovchinnikov
f687028e37 IJPL-639 don't request service in MethodTextOccurrenceProcessor.<clinit>
GitOrigin-RevId: 4ba4b6ba7d07e1200d0e2d2bad305ba17481d7ca
2024-02-12 15:32:09 +00:00
Vladimir Krivosheev
1c5f802ea3 do not use guava immutable map (part 2)
GitOrigin-RevId: a30122e0670b70932eed14da4c391317153c5024
2024-02-10 19:46:05 +00:00
Andrey Cherkasov
1a62d88764 Cleanup: use light services
^IDEA-254577

GitOrigin-RevId: 01afb3f2166f8713cd4599f37d43ecf7f4d2944c
2024-01-23 06:03:51 +00:00
Alexandr Suhinin
79653f2633 CR-101244 clean up: remove redundant overriding methods
GitOrigin-RevId: d4d165c6280b7bead925940c82b20f5300c7750a
2024-01-20 15:47:17 +00:00
Tagir Valeev
c74bfa2e57 [java] IDEA-341317 Navigation into multi-release JARs
GitOrigin-RevId: 43612b6950fca72ab58af9b1eb5dc4940f90c501
2023-12-19 16:48:57 +00:00
Tagir Valeev
b262b8affe Minor warnings fixed
GitOrigin-RevId: 8e52edaa2770b151e52e754aca7095d97f7d80ec
2023-12-14 12:10:57 +00:00
Andrey Cherkasov
019a6852f4 [java] Make extension classes final
GitOrigin-RevId: 1aae04982598568a111e8c78b9a71c9d2b4aa150
2023-12-13 20:02:09 +00:00
Mikhail Pyltsin
3f86cf9292 [java-highlighting] IDEA-339935 JEP 463
- rename unnamed classes to implicitly declared classes

GitOrigin-RevId: 2c6d7f16a1dc6d2371b8f8b5f5675246c9bc99f9
2023-12-11 15:49:28 +00:00
Elena Shaverdova
9e77f9bb03 IDEA-331326 Create FUS event for stub index inconsistency
GitOrigin-RevId: 8194bd9128dd7639655b335bed6747d6ce046b14
2023-11-22 20:56:50 +00:00
Tagir Valeev
eec03c8b24 [java-analysis] ReadableExternalAnnotationsManager: warning fixed
GitOrigin-RevId: 8a210a692ebd86dc57eab3f8d1b819213c9116d4
2023-11-06 19:11:52 +00:00
Andrey Cherkasov
094b9fc6c1 The "Simplifiable service retrieving" inspection: cleanup
Merge-request: IJ-MR-116656
Merged-by: Andrey Cherkasov <Andrey.Cherkasov@jetbrains.com>

GitOrigin-RevId: d42dd51ec49b4176265baf2bb69df04a964418a3
2023-10-17 13:36:11 +00:00
Louis Vignier
ed300a6ffc [java] Delete superfluous override
IJ-CR-115084

GitOrigin-RevId: 5fd39d816682125a3a893aa240790641e88e2de6
2023-10-11 19:07:58 +00:00
Louis Vignier
329f346fcd [java] Use correct scope to check unnamed class configuration validity
IJ-CR-115084

GitOrigin-RevId: 65e3a76dfe73b670bee43e7be2a3565f06b327d2
2023-10-11 19:07:54 +00:00
Louis Vignier
619640a0ca [java] Add stub index for unnamed classes
#IDEA-331209

GitOrigin-RevId: bf52092b67108e81fc148f7e223ac802f0214fdf
2023-09-28 18:34:14 +00:00
Tagir Valeev
9513c10254 [java-indexing] ConstructorReferencesSearchHelper: fix search in non-physical files
GitOrigin-RevId: b97c3008706df137ddefb451ad5ca57aa2c7f011
2023-09-27 11:27:10 +00:00
Louis Vignier
7da0863c33 [java] Remove JavaUnnamedClassIndex
The index made tests fail, reverting until a better solution is found.

IJ-CR-115084

GitOrigin-RevId: 5b4ca90aa8059e70c656d3e9ff80868940670736
2023-09-19 05:49:03 +00:00
Louis Vignier
f90a3ca248 [java] Try to fix reentrant indexing in JavaUnnamedClassIndex
#IDEA-331209

GitOrigin-RevId: 7e1e8eecb616498c69b15cb0a7cf6b264ddcaae0
2023-09-19 05:48:55 +00:00
Louis Vignier
3a824750de [java] Create index for unnamed classes
#IDEA-331209

GitOrigin-RevId: 938f5962a345939221baf00f237a8190a7d7dfa3
2023-09-19 05:48:49 +00:00
Yan Zhulanow
a6137597b3 Merge commit 'e7e91bf86117e09bb40e53461f818e0ec9645ee5'
GitOrigin-RevId: 4310e333a4b326022001786485e451ad8ae439e5
2023-09-06 21:55:17 +09:00
Mikhail Pyltsin
52c0005828 IJ-CR-113485 IJ-CR-112205 [java-completion] IDEA-324073 Complete static methods with the first argument as qualifier
- added javadoc
- deleted Registry key for this completion

GitOrigin-RevId: fb4ed0cfb0bae66253a794141a6a197fa18b7a96
2023-09-06 10:35:34 +00:00
Anna Kozlova
50f1250d28 [kotlin] k2: don't search enum inheritance in foreign languages (KTIJ-26876)
If enabled, `JavaDirectInheritorsSearcher.calculateDirectSubClasses` finds kotlin enum constants as light classes (and k1 relies on that). Based on those classes, light methods are found. But for k2 these results are redundant, because direct kotlin search is performed as well.

Regular Kotlin inheritors are not identified by the `JavaDirectInheritorsSearcher` due to their absence in the `JavaSuperClassNameOccurenceIndex`.

GitOrigin-RevId: 6ba01326975297d73ed88085154fd9706dec2b50
2023-09-04 06:25:18 +00:00
Mikhail Pyltsin
81d3b3f897 IJ-CR-113485 IJ-CR-112205 [java-completion] IDEA-324073 Complete static methods with the first argument as qualifier
- added extension points for other languages. Experimental

GitOrigin-RevId: 6a0383f0137b7e8418b51a1336a16dc3389e9470
2023-08-25 17:26:33 +00:00
Izmar Verhage
06190372c4 Deprecate AbstractStubIndex::get and migrate usages
In this commit we implement a logical implication of the fact
that StubIndex::get is deprecated, combined with the fact that
AbstractStubIndex::get is not deprecated but calls
StubIndex::get with the exact same arguments it received. The
absence of deprecation of AbstractStubIndex::get obfuscates
the fact that we want to phase out StubIndex::get calls.

Apart from deprecating said method, we add some convenience
methods in AbstractStubIndex inheritors that ensure a few things:
- The not-deprecated and preferred StubIndex::getElements is
  called with appropriate arguments, including a properly
  specialised requiredClass argument.
- Shorter syntax and DRY: only 3 arguments are required to pass
  into the convenience method, whereas getElements requires 2
  more. These 2 arguments are fields of the AbstractStubIndex
  inheritor, so it makes little sense to get them from there
  and pass them into StubIndex::getElements everywhere.

Wherever we can, these convenience methods are now used.

If you have access to JetBrains internal resources, also see:
https://jetbrains.team/p/ij/reviews/112930/timeline
https://jetbrains.slack.com/archives/CMDBCUBGE/p1691509451975689

GitOrigin-RevId: c51ef4de44aa85841799640b1ece9d291208dc69
2023-08-11 16:14:17 +00:00
Dmitry Batkovich
79e27a499b do not rely on file-name while indexing manifest files (effectively reverts IDEA-303356 fix)
we should not fix issues caused by wrong file type re-association instead of it we should create a mechanism to warn user about it

GitOrigin-RevId: 8e00c260d7f319828b9686fa9e8e98175ce0361a
2023-08-03 10:41:45 +00:00
Tagir Valeev
707000aac2 [java] JavaRecordComponentSearcher: intersect scope with search scope in optimizer
Also: fix use scope for record components
Fixes IDEA-323449 Noticeable delay in record members highlighting when I click on them

GitOrigin-RevId: 4535c1eaa040e4ccfe61d1f214645a321438a937
2023-07-21 11:17:21 +00:00
Alex Plate
0ea27da5c6 [Workspace Model] [IDEA-320676] Move all packages from workspaceModel to workspace folder
GitOrigin-RevId: b70062397efd6347c34431c24aacd2ec2e216897
2023-06-19 09:35:12 +00:00
Andrei.Kuznetsov
a275eeb636 IDEA-320457: migrate some indexes to IndexingHint (JavaSourceModuleNameIndex)
to speed up indexing of java `.class` files. See IDEA-320457 for full explanation

GitOrigin-RevId: adb118716a6859db0e2f5f3d386a02d7ae274bbb
2023-05-31 20:48:51 +00:00
Alexey Kudravtsev
14ff37953d specify return type explicitly in Kotlin in some openapi and util to speedup Kotlin resolve
GitOrigin-RevId: 2b68c5d51524b822c645dbcb3828acbdd15245ad
2023-05-31 15:36:27 +00:00
Alexey Kudravtsev
6d9ab19f5b add missing method createConcurrentSet(); port existing usages with corresponding SSR
GitOrigin-RevId: 00645c36006d38198e8222030cf5ddd7ad7c8bf8
2023-04-21 17:31:35 +00:00
Daniil Ovchinnikov
6fe5c49599 deprecate com.intellij.reference.SoftReference constructors
GitOrigin-RevId: a723be59b812f71953e79879d7adf09d58a9e935
2023-04-15 00:04:29 +00:00
Roman Ivanov
6de5192f60 [inlays] get field of getter only when index is disabled EA-785577
GitOrigin-RevId: e549da4afc56b02a9c6061ac7245843d728b1365
2023-02-21 12:19:58 +00:00
Nikolay Chashnikov
07576fecb2 [java] get rid of identity-based comparisons of Strings (IDEA-312368)
Such a code is often written by mistake, and 'equals' method should be used instead. If rare cases where identity-based comparison is really needed, the code is changed to use a special Strings.areSameInstance method to make the intention explicit and avoid warnings.

GitOrigin-RevId: e89d229059157ecc9ad21d9a189f7393839ab45f
2023-02-06 19:58:52 +00:00
Tagir Valeev
e9832acb26 [java] Use pattern variables; other minor cleanup
GitOrigin-RevId: e2345bd54d92f6676c6fbc55955e85cbdc5c2793
2023-02-01 17:09:26 +00:00
Nikolay Chashnikov
8ce3039acf cleanup: get rid of usages of deprecated constants from PsiType (IDEA-309438)
GitOrigin-RevId: 3373eb8b47af51b9f6dd71e565f773d69e8a3218
2023-01-26 16:11:57 +00:00
Anna Kozlova
630b9cb64f [lombok] ignore implicit constructor usages in generated code (IDEA-300494)
GitOrigin-RevId: bcafd4fbb0f0771ccd46acf7cff9bc23ee3e9130
2023-01-23 16:03:17 +00:00
Nikolay Chashnikov
c8c61b308d [workspace file index] move JvmPackageRootData to Java plugin and make it public
Kotlin plugin needs to contribute its directories to PackageIndex, so we need to have a public API for that. It's better to put it to Java plugin from the beginning, since corresponding functionality will be removed from the platform as soon as we get rid of platform API which allows plugins to access it.

GitOrigin-RevId: d66adf78641383312478950bb040bdf66ffd1eb2
2023-01-20 10:31:36 +00:00
Nikolay Chashnikov
98b622aa27 cleanup: remove redundant '@author' tags from javadoc comments - 5
Now we have Code Vision hints which determine the author via Git history and show it in the editor automatically, and this information is more accurate than the tags which were automatically added when files were created.

GitOrigin-RevId: e1f798814ca7f22747768b99cbcd962d820bbfb9
2023-01-18 17:01:41 +00:00
Daniil Ovchinnikov
578eaaf60e rename library kotlin-stdlib-jdk8 -> kotlin-stdlib
GitOrigin-RevId: cddf45ccfd5563d3fe209bea62a1c37c94f44ff9
2023-01-10 12:22:34 +00:00
Tagir Valeev
15b23c536a Fix constant value and some other warnings
GitOrigin-RevId: 8c9ffeab46602a73270451ae97bd25a47a2076e4
2022-12-01 17:34:54 +00:00