Commit Graph

4140 Commits

Author SHA1 Message Date
Frederik Haselmeier
6cff66c9a4 [Kotlin] Allow importing nested declarations when pasting from code in which they were imported
Previously, nested declarations (enum values, nested objects, static Java imports, etc.) were not copy-pasted as is, but instead fully qualified and then shortened based on the user's code style settings (which disallows importing nested declarations by default). This commit changes the behaviour of the KotlinCopyPasteReferenceProcessor and ShorteningProcessor to allow fully importing references regardless of the code style setting, which will closely resemble the original code.

^KTIJ-10687 fixed

GitOrigin-RevId: 68ccfa51d5563a62e712863feff187df5515b908
2024-02-21 14:03:55 +00:00
Nikolay Chashnikov
31e7f577f5 [kotlin] API: mark for removal unused deprecated API (IJPL-275)
GitOrigin-RevId: b5179e0f687715402ef0a8835739c092c74a03aa
2024-02-16 15:45:37 +00:00
Alexander Udalov
181bce4740 [kotlin] Adapt usage of JvmDefaultMode after renaming its entries
GitOrigin-RevId: b99f867ddc8ca625d3f794057cc1e5e6b23ecc6e
2024-02-06 16:53:28 +00:00
Anna Kozlova
ac5a50f302 [kotlin] move common services out of kotlin.idea module
KTIJ-28142

GitOrigin-RevId: c9f346debfb89aa1a0d69c945e92c66ff89876e7
2024-01-26 12:03:42 +00:00
Anna Kozlova
c51d8b1d75 [kotlin] publish analyse dependency factory to common module
part of KTIJ-28142

GitOrigin-RevId: 0c4b1f94fa5f4ee9873f0ca2e9f86dea8b02baaa
2024-01-12 09:33:39 +00:00
Nikolay Chashnikov
b89d4f076d [kotlin] API cleanup: remove unused deprecated API (IJPL-275)
GitOrigin-RevId: eb8a3bafe5fb32fc4ed97add71573ed0ed773451
2024-01-11 11:19:51 +00:00
Anna Kozlova
9b0548f1ba [kotlin] k2: rename: move lambda outside of parentheses when possible
GitOrigin-RevId: dafae17d7a54aa67625df440fa8111bef11486cc
2023-10-26 13:19:03 +00:00
Anna Kozlova
485137a5a2 [kotlin] k2: move lambda outside parentheses (KTIJ-26914)
GitOrigin-RevId: 6888d59949adc7abb234670aeabe358c5c5367d4
2023-10-24 15:38:07 +00:00
Nikolay Chashnikov
fa7595bbcc [kotlin] mark for removal API which was deprecated in 2023.1 or earlier and has no external usages (IDEA-322162)
GitOrigin-RevId: 2921afa7a455960c573923a46c19da89403f37d4
2023-10-20 22:20:52 +00:00
Alexey Belkov
5ee4dfe473 Apply Kotlin inspection "Redundant empty primary constructor"
GitOrigin-RevId: 7f798d7f84c8f9c85f6ee5abcba7ddff26b83f4f
2023-08-23 17:45:45 +00:00
Bart van Helvert
55e378549e [kotlin] Support bindToElement for KDoc references in K2
#KTIJ-26328 Fixed

GitOrigin-RevId: d723184b11ef626459f9a2b9de400e260dde6538
2023-07-28 12:58:20 +00:00
Anna Kozlova
03d71824c5 [kotlin] k2: kotlin aware java getter rename
when getter of a synthetic java property is renamed, mark setters & getter usages, so setter's usages would be expanded to `setOldName` and getter usages would become just `newName`

^ KTIJ-25158

GitOrigin-RevId: f729952d3e06e668bea34c91f8f0efbca5d44161
2023-07-18 04:39:57 +00:00
Anna Kozlova
50e2af215c [kotlin] k2 rename: support java synthetic properties (KTIJ-25158)
GitOrigin-RevId: cab0d5f2257351316457ed295b24300678f54107
2023-07-12 06:40:32 +00:00
Anna Kozlova
ccb7b332ff [kotlin] k2: fix default java annotation method rename
GitOrigin-RevId: e1d758f86c3d0b26806ddc44a1a4d0ec483d1c68
2023-07-06 11:21:15 +00:00
Andrei.Kuznetsov
0c387e2946 IDEA-320457: Rename GlobalFileTypeIndexingHint.globalFileTypeHintForIndex > GlobalIndexSpecificIndexingHint.globalInputFilterForIndex
GitOrigin-RevId: de804ecfa52b5d0e28743eebf1091839b5c3da12
2023-06-28 18:21:41 +00:00
Bart van Helvert
3097469943 [kotlin] Move bind to element methods to mutate service base class
GitOrigin-RevId: b9b6ef39bfdf6cc60010e9bef898462adf56d77d
2023-06-28 13:05:18 +00:00
Andrei.Kuznetsov
e2d375c46f IDEA-320457: introduce GlobalFileTypeIndexingHint
Now GlobalIndexFilter has an option to accept or reject files of particular filetype all together

GitOrigin-RevId: 019d424ec015782bb1cbb4c74a2b41651ac38759
2023-06-22 15:04:05 +00:00
Alexey Belkov
55f582d5d3 Apply Kotlin inspection "Redundant 'if' statement"
GitOrigin-RevId: 2f93c77e56d8519431e8cc94f4ca2354003806b6
2023-06-12 14:45:50 +00:00
Ilya Kirillov
8b0eeca8fd [Kotlin] adapt to changes in Java Resolution
^KT-58194

GitOrigin-RevId: d8f62e4078d86e9323ff33261b1b88add86833c0
2023-05-31 12:53:16 +00:00
Nikolay Chashnikov
3ec3172e99 [kotlin] API cleanup: remove unused deprecated API (IDEA-312594)
GitOrigin-RevId: 94f747384e1e345cf51366637276eb5a032fb769
2023-05-15 13:57:15 +00:00
Dmitrii Gridin
9f0e8125a4 Merge branch 'kt-master'
# Conflicts:
#	community/android/android-test-framework/testSrc/com/android/tools/idea/testing/AndroidGradleTestUtils.kt
#	community/plugins/kotlin/base/fir/analysis-api-providers/src/org/jetbrains/kotlin/idea/base/fir/analysisApiProviders/FirIdeKotlinModificationTrackerFactory.kt
#	community/plugins/kotlin/gradle/multiplatform-tests/test/org/jetbrains/kotlin/gradle/idea/importing/multiplatformTests/KotlinMppCompilerPluginImportingTests.kt
#	community/plugins/kotlin/gradle/multiplatform-tests/test/org/jetbrains/kotlin/gradle/idea/importing/multiplatformTests/KotlinMppTierOneCasesImportingTests.kt
#	community/plugins/kotlin/uast/uast-kotlin-base/tests/test/org/jetbrains/uast/test/common/kotlin/LightClassBehaviorTestBase.kt

GitOrigin-RevId: 979b640ee10f796e0263c5a724d383592670e77e
2023-04-19 10:22:53 +00:00
Vladimir Dolzhenko
cb08454adb [kotlin] Reduce memory allocations on non kotlin projects
#KTIJ-25201 Fixed

GitOrigin-RevId: d28fc012fc8264ba78f9089c31566491d3fc5961
2023-04-09 21:59:01 +00:00
Dmitrii Gridin
879160af53 [kotlin][k2] add syntax highlighting to decompiled kotlin_builtins
^KTIJ-25189 Fixed

GitOrigin-RevId: 24423c31cfc2b42f47a80940fc30c57cdbd136bd
2023-04-06 17:17:27 +00:00
Artem Vasilev
f875ce8e4b [kotlin] move a utility function to another module
To avoid cyclic dependencies between modules

GitOrigin-RevId: bb32c2cb1368fc03f28a881370e43553ba6b6e43
2023-02-28 19:54:50 +00:00
Artem Vasilev
60798e8aac [kotlin] introduce KotlinSuppressionChecker to extract K1/K2-specific suppression functionality
GitOrigin-RevId: 58bc47ac8f1f124e349d2d8d3478e114fe411ac7
2023-02-28 19:54:45 +00:00
Roman Golyshev
5c057d3e2e [kotlin] KTIJ-24812 Move KDoc references' rename logic to KtReferenceMutateServiceBase
The logic is same for K1 and K2 plugin

^KTIJ-24812 Fixed

GitOrigin-RevId: b6c17c481eadd04f651283f40fc3c3e2254b3c44
2023-02-28 17:40:33 +00:00
Vladimir Dolzhenko
a343d5bfc5 [kotlin] Handle dumb mode
#KTIJ-23204 Fixed

GitOrigin-RevId: eda61dba64dc7d475963aed85d61693fe874eb9c
2023-02-24 23:48:39 +00:00
Toshiaki Kameyama
e58d5278ba [kotlin] Redundant suppression: fix wrong applicability range with comments
^KTIJ-24678 Fixed

closes https://github.com/JetBrains/intellij-community/pull/2328

GitOrigin-RevId: 357a033509e7e6620c4e37bd7132f78cd58c9a3b
2023-02-17 16:24:10 +00:00
Vladimir Dolzhenko
f32bfe06cf [kotlin] Use better workspace model API
#KTIJ-21664

GitOrigin-RevId: 09393eabed5f6746693753a16ad9739569d52b53
2023-02-16 07:11:57 +00:00
Yan Zhulanow
7eb120ad05 [kotlin] Make 'KotlinOverridableInternalMembersShortNameIndex' a class (KTIJ-24475)
Extensions are instantiated by the platform, breaking the objects' singleton contract.

GitOrigin-RevId: efac8551b8c82333a4780b5456b2eec15e13a53f
2023-02-15 08:06:44 +00:00
Yan Zhulanow
99b9367650 [kotlin] Make 'KotlinTypeAliasByExpansionShortNameIndex' a class (KTIJ-24475)
Extensions are instantiated by the platform, breaking the objects' singleton contract.

GitOrigin-RevId: ecb49bf3423de931ad5686ab30969e9374b5e236
2023-02-15 08:06:41 +00:00
Yan Zhulanow
f6ab980426 [kotlin] Make 'KotlinScriptFqnIndex' a class (KTIJ-24475)
Extensions are instantiated by the platform, breaking the objects' singleton contract.

GitOrigin-RevId: 0282872b3c3bb539cd6ec075eda4542e63fbf795
2023-02-15 08:06:38 +00:00
Yan Zhulanow
d7e06076d6 [kotlin] Make 'KotlinMultiFileClassPartIndex' a class (KTIJ-24475)
Extensions are instantiated by the platform, breaking the objects' singleton contract.

GitOrigin-RevId: bf2d64bf06eaaa1dd6f7f1756fc1d76129624296
2023-02-15 08:06:35 +00:00
Yan Zhulanow
469c9b9872 [kotlin] Make 'KotlinFileFacadeShortNameIndex' a class (KTIJ-24475)
Extensions are instantiated by the platform, breaking the objects' singleton contract.

GitOrigin-RevId: 968cc917fc1334fc7ec64bdcdf617a4285a896cf
2023-02-15 08:06:32 +00:00
Yan Zhulanow
bf20e0dbde [kotlin] Make 'KotlinFileFacadeClassByPackageIndex' a class (KTIJ-24475)
Extensions are instantiated by the platform, breaking the objects' singleton contract.

GitOrigin-RevId: d8517639fc721cc469700451cf7392a14a04e171
2023-02-15 08:06:29 +00:00
Yan Zhulanow
a4361b2e26 [kotlin] Make 'KotlinFilePartClassIndex' a class (KTIJ-24475)
Extensions are instantiated by the platform, breaking the objects' singleton contract.

GitOrigin-RevId: 21f55d396db7eb1f9b1188a84899dc8025246cb5
2023-02-15 08:06:26 +00:00
Yan Zhulanow
137853bed2 [kotlin] Make 'KotlinFileFacadeFqNameIndex' a class (KTIJ-24475)
Extensions are instantiated by the platform, breaking the objects' singleton contract.

GitOrigin-RevId: 87db440addd7ee94283b7a86537654dc5caa356a
2023-02-15 08:06:23 +00:00
Yan Zhulanow
638b92a588 [kotlin] Make 'KotlinProbablyContractedFunctionShortNameIndex' a class (KTIJ-24475)
Extensions are instantiated by the platform, breaking the objects' singleton contract.

GitOrigin-RevId: 3d24100312bcdb84189814eefa9ff3738ee68fae
2023-02-15 08:06:20 +00:00
Yan Zhulanow
c7bfe9e56d [kotlin] Make 'KotlinProbablyNothingPropertyShortNameIndex' a class (KTIJ-24475)
Extensions are instantiated by the platform, breaking the objects' singleton contract.

GitOrigin-RevId: c5776b6a332b1e6e11781bcc25fecdb4433b829b
2023-02-15 08:06:17 +00:00
Yan Zhulanow
300d5f49a8 [kotlin] Make 'KotlinProbablyNothingFunctionShortNameIndex' a class (KTIJ-24475)
Extensions are instantiated by the platform, breaking the objects' singleton contract.

GitOrigin-RevId: 90edd04c3a887af2741a76e91b7db02720bdbd6a
2023-02-15 08:06:14 +00:00
Yan Zhulanow
5bebff5d17 [kotlin] Make 'CommonLibraryType' a class (KTIJ-24475)
Extensions are instantiated by the platform, breaking the objects' singleton contract.

GitOrigin-RevId: ded4d0fcd82473156de65f3ba8da7e06287290b5
2023-02-15 08:06:11 +00:00
Yan Zhulanow
df7aff3ba6 [kotlin] Make 'KotlinInnerTypeAliasClassIdIndex' a class (KTIJ-24475)
Extensions are instantiated by the platform, breaking the objects' singleton contract.

GitOrigin-RevId: e35a23d0dc2742b9b0963bbcafadc604b0651126
2023-02-14 18:16:52 +00:00
Yan Zhulanow
1c67d8a114 [kotlin] Make 'KotlinPrimeSymbolNameIndex' a class (KTIJ-24475)
Extensions are instantiated by the platform, breaking the objects' singleton contract.

GitOrigin-RevId: 2ac5d1e982a9e10e9e98ea1ce431300bc54cb283
2023-02-14 18:16:47 +00:00
Yan Zhulanow
fb88134cbf [kotlin] Make descendants of 'KotlinStringStubIndexExtension' classes (KTIJ-24475)
Extensions are instantiated by the platform, breaking the objects' singleton contract.

GitOrigin-RevId: e0072735cdd5aa54ffc1663c1ec2a5936d4cb14f
2023-02-14 18:16:43 +00:00
Yan Zhulanow
7d78efa05c [kotlin] Make 'KotlinExactPackagesIndex' a class (KTIJ-24475)
Extensions are instantiated by the platform, breaking the objects' singleton contract.

GitOrigin-RevId: 2bf662f4de853ddeb078da02c2e48efa8b0f971e
2023-02-14 18:16:38 +00:00
Nikolay Chashnikov
c2540cd10a API: mark for removal APIs which were deprecated and have no external and internal usages (IDEA-305637)
GitOrigin-RevId: 8f4ee08f99f30456e0c0105ae4f28dc7cd8ad9b0
2023-02-06 19:59:10 +00:00
Vladimir Dolzhenko
0ca3fa063b [kotlin] Eliminate usage of ResolutionFacade.getFrontendService(ModuleDescriptor, Class)
IdeaResolverForProject could be recreated under memory pressure, and therefore it creates new ModuleDescriptorImpl for moduleInfos
Using getFrontendService(ModuleDescriptor, Class) means of having effectively outdated ModuleDescriptor that does not comply with actual (recreated) IdeaResolverForProject

#KTIJ-17649
#EA-725255

GitOrigin-RevId: 9d02ba046695d073ed923c16c87d25a95ee2cf41
2023-01-20 16:56:48 +00:00
Vladimir Dolzhenko
190583b658 [kotlin] Support JvmName annotation nested in file annotation list
#KTIJ-24266 Fixed

GitOrigin-RevId: 76468cd4e2808167b61eedfc80ac7b29eabab09a
2023-01-16 16:14:57 +00:00
Roman Golyshev
a2cec2d168 [kotlin] KTIJ-24123 Extract OperatorToFunctionConverter from OperatorToFunctionIntention
Put it into the common module so it can be used from
any other module without any classloading issues

^KTIJ-24123 Fixed

GitOrigin-RevId: 961600131f26e2635ee19222523c26b351d7f1ce
2023-01-10 15:09:46 +00:00
Roman Golyshev
5db2d4eaa3 [kotlin] KTIJ-24054 Handle invoke and get/set operators renaming
Move `renameImplicitConventionalCall` to the common base

^KTIJ-24054 Fixed

GitOrigin-RevId: 015288ae2d3c284510c32baa7d111a0b7fe9d4ec
2022-12-28 19:38:00 +00:00