Commit Graph

94 Commits

Author SHA1 Message Date
Dmitrii Gridin
bb34856143 [kotlin] adopt isExpectDeclaration from compiler
^KT-70165

GitOrigin-RevId: 7e875973dab1bafc424d89f86f7cd6862409e6c7
2024-08-19 11:42:28 +00:00
aleksandrina-streltsova
c433a4c2b1 [kotlin] Port InitializePropertyQuickFixFactory to K2
^KTIJ-29621 Fixed

GitOrigin-RevId: 6c3d594880b4afce2f8ef2f7f1df5ec9ea601e52
2024-07-29 10:03:19 +00:00
aleksandrina-streltsova
672a37f814 [kotlin] k2 Copy-paste: add basic implementation
^KTIJ-26145 Fixed

GitOrigin-RevId: 872190ea223a6702e7bf7c86c6c8943b3295a939
2024-06-16 15:03:44 +00:00
aleksandrina-streltsova
8a38974c97 [kotlin] k2: introduce utility function for filtering out references that can't be used in imports
GitOrigin-RevId: d7b3abc4e9ed395a7a954f9755cfacb042aa9e1f
2024-06-16 15:03:44 +00:00
Andrew Kozlov
3edb541d0d [kotlin] KTIJ-28619, KTIJ-28628 excess dependencies removed
GitOrigin-RevId: 04004287e5f664d1c4fa10ac0b7a7d07f5ab59be
2024-06-07 15:38:51 +00:00
Maksim Zuev
577cf8a834 [kotlin] IDEA-353736 Use util method
GitOrigin-RevId: a88b96f6cc7ad013b4e7f9e367c4c46884e2d97e
2024-05-23 22:07:03 +00:00
Maksim Zuev
07f2e467ca [kotlin] IDEA-353736 Move line range check to the util function
GitOrigin-RevId: fe0303a6153fedb4b3fa85c2e93d1d678fcf9f18
2024-05-22 17:27:25 +00:00
Dmitrii Gridin
73e117f62a [kotlin] drop 'kotlinc.kotlin-compiler-fe10' from base modules
A few modules are still left due to a complex dependency on fe10,
so the issue cannot be marked as fixed yet

^KTIJ-29898

GitOrigin-RevId: 66bb3d0e332c1d76727c395cd0464c35f20df6b3
2024-05-15 12:53:25 +00:00
Andrey Cherkasov
c166567e02 [kotlin] Move the typeArguments extension function to the kotlin.base.psi module
^KTIJ-29484

GitOrigin-RevId: d0ed5bffc0a69c828c6f641e75fce4fa15f51c31
2024-04-26 12:38:52 +00:00
aleksandrina-streltsova
10960866f0 [kotlin] port IfThenToElvisInspection to k2
^KTIJ-29052 Fixed

GitOrigin-RevId: 3c28a6169b8e49c7d29a949f6bc7ed185507168e
2024-04-26 09:01:31 +00:00
Victoria.Petrakovich
a108505ec4 [kotlin] Port Can be parameter inspection to shared
^KTIJ-16556 Fixed Quick-fix "Constructor parameter is never used as a property" changes behavior with the same named property
^KTIJ-28410 Fixed K2 IDE: port CanBeParameterInspection

Co-authored-by: Roman Golyshev <anstreth@gmail.com>

Merge-request: IJ-MR-130406
Merged-by: Victoria Petrakovich <Victoria.Petrakovich@jetbrains.com>

GitOrigin-RevId: 4fc7b99d046bcb239362b5c13c40e3043b290a89
2024-04-24 17:37:45 +00:00
Alexey Belkov
f66c4b33d3 [kotlin] K2 J2K: Support diagnostic-based processings
^KTIJ-29681 Fixed

GitOrigin-RevId: 4fdbf7e04c1061945b8f5618083eb1ea1cdc18bc
2024-04-23 14:59:21 +00:00
Alexey Belkov
84f279f662 [kotlin] Remove hyphen from "SAM-constructor" phrase
"SAM constructor" is more consistent with "SAM interface" and
"SAM conversions" used in the docs:
https://kotlinlang.org/docs/java-interop.html#sam-conversions

Curiously, we don't seem to officially use the phrase "SAM constructor" anywhere.
The docs only call it "an adapter function that converts a lambda to a specific SAM type."

GitOrigin-RevId: c701ee5a4c5b2ddb68e98cbcc0612be5f38bffe2
2024-03-26 14:01:41 +00:00
Andrey Cherkasov
605cc19834 [kotlin] Move the findParameterWithName extension function to the kotlin.base.psi module
^KTIJ-26890

GitOrigin-RevId: 395975ee76ffb6204fc7029d633927fe0755832c
2024-03-24 23:20:48 +00:00
Andrey Cherkasov
5321ce0e9d [kotlin] Rename method
^KTIJ-26890

GitOrigin-RevId: 970a698cb3294cbe0fc90a8afb2b5e1be1a26374
2024-03-21 11:09:37 +00:00
Andrey Cherkasov
5dd50b7da6 [kotlin] Move some functions to the kotlin.base.psi module
^KTIJ-26890

GitOrigin-RevId: a77403f46324a870c6b95a51841af3bffe6cce65
2024-03-21 11:09:33 +00:00
Vladislav.Yaroshchuk
7d67abe183 Revert "[kotlin] Move some functions to the kotlin.base.psi module"
This reverts commit 2cb72a2f89f5afe9db5c2a8da6f5ef3dcff3f0b8.

GitOrigin-RevId: 8113bb1696de8ed42b61ccaab7a1ea7486d66f53
2024-03-21 09:39:34 +04:00
Vladislav.Yaroshchuk
420e6c6788 Revert "[kotlin] Rename method"
This reverts commit eb56d77334856b33f175fb2cd0661e98211b6f07.

GitOrigin-RevId: 5c4986d51a7b8abfb45f6339c681975dc9534a5c
2024-03-21 09:39:17 +04:00
Andrey Cherkasov
78fcccc1a7 [kotlin] Rename method
^KTIJ-26890

GitOrigin-RevId: eb56d77334856b33f175fb2cd0661e98211b6f07
2024-03-21 01:10:19 +00:00
Andrey Cherkasov
c66bbbb1b1 [kotlin] Move some functions to the kotlin.base.psi module
^KTIJ-26890

GitOrigin-RevId: 2cb72a2f89f5afe9db5c2a8da6f5ef3dcff3f0b8
2024-03-21 01:10:16 +00:00
Vlad Koshkin
bf9312f047 [kotlin] IfToWhenIntention in k2
^KTIJ-22988 Fixed

GitOrigin-RevId: 58a248f336fb7fc3f91b5ec039f3d7b523b8188d
2024-03-13 21:29:05 +00:00
Roman Golyshev
e23937ffab KTIJ-22971 [kotlin] Move getParentLambdaLabelName function to the kotlin.base.psi module
Also add a little KDoc about its purpose

GitOrigin-RevId: 6d5197f1b3666391086fece1488f01b6f2858b74
2024-03-13 00:32:26 +00:00
Alexey Belkov
669b5084c8 [kotlin] INVISIBLE_MEMBER quickfix: remove redundant primary constructor
^KTIJ-28872 Fixed

GitOrigin-RevId: 3c149e5964e2a04541f8a641cdb48b0e0d71502d
2024-02-22 20:37:48 +00:00
aleksandrina-streltsova
73b43a5acb [kotlin] K2 Psi Unifier: match calls without receivers
KTIJ-28786

GitOrigin-RevId: 07e924a79b2bc4cfc3a3cbaebc40799b306c2472
2024-02-18 22:12:22 +00:00
Anna Kozlova
b78de39243 [kotlin] k2: support safe delete for kmp projects (KTIJ-28466)
`getElementsToSearch` returns `expect` and all `actual` declarations; to report conflicts against this group together, declaration is replaced with `expect` counter-part in UsageInfo's referencedElement

for "broken" code with missed actual on constructors, `isEffectivelyActual` is used

Disabled tests:
- skipped test with super type reference of expected class (KT-65190)
- impossible to delete parameter in `actual` function without changing corresponding `expect` function (KTIJ-28569)
- `getExpectsForActual` doesn't return anything if declaration doesn't have `actual` modifier: doesn't work for slightly broken code (KT-65191)

GitOrigin-RevId: 08878c97bb3a196be8dbb663b6c7348b9352dd3a
2024-01-23 12:27:45 +00:00
Anna Kozlova
559a745bcc [kotlin] move navigation contributors to frontend agnostic module
- add tests (one disabled due to KT-64862)
- switch on go to related symbol: tests + and include actuals in "show implementations" of expected declaration
- restore search everywhere presentation with wrapped renderer

part of KTIJ-28142

GitOrigin-RevId: 76721133fd9857192f7272226b91b49660fe6018
2024-01-10 13:02:55 +00:00
Pavel Kirpichenkov
3ffacaccc0 [IDE] Move KotlinJavaScriptMetaFileDecompiler to kotlin.git
KTIJ-27752

GitOrigin-RevId: 4b599ed1e07fbbab8f97ab995172d6eb902277eb
2023-11-21 15:56:56 +02:00
Pavel Kirpichenkov
2a550a0751 [kotlin] Implement KotlinLabelProviderService for IDE
The service is used for FileType descriptions in kotlin.git.
Before the file type labels always used the fallback values
instead of bundle properties.

KTIJ-27755

GitOrigin-RevId: a7e82b0ba699df06d395d3a144d99db3bcf56c49
2023-11-21 15:56:55 +02:00
Anna Kozlova
5d1aca66db [kotlin] k2: RedundantUnitExpression inspection(KTIJ-27433)
GitOrigin-RevId: 24ed1d1ede93ba7df3c027d17d6f0d7d8d10e4d5
2023-10-26 13:18:59 +00:00
Ilya Kirillov
a2bbe4d318 Remove snapshot kotlin stdlib from Kotlin plugin
^KT-62510
^KTIJ-20529 fixed

GitOrigin-RevId: a49099902566abb23dfb56a578b368b4973e332f
2023-10-20 20:53:09 +00:00
Nikolay Lunyak
0cbefc4098 [kotlin] Replace old annotation ClassId references with new ones
^KT-54596 Fixed

GitOrigin-RevId: 1a85d738bc8bf2ca0774dafc369ccfdeaff726b6
2023-09-20 00:22:54 +03:00
Pavel Kirpichenkov
2b2021cb29 [Kotlin] KTIJ-26526 Move K/N decompilers and stub builders to kotlin.git
GitOrigin-RevId: f752104548589cae46942e12ad708f372d8ddcf7
2023-08-23 07:52:46 +00:00
Dmitrii Gridin
b8a44f941a [kotlin] use KtFile::hasImportAlias there it is possible
^KTIJ-26688

GitOrigin-RevId: bde9d5583526757416568fd19cfe8769fa05c3c9
2023-08-21 13:58:34 +00:00
Andrey Cherkasov
37b6433df2 [kotlin k2] Extract the shouldLambdaParameterBeNamed check from the moveInsideParenthesesAndReplaceWith method
^KTIJ-21135

GitOrigin-RevId: 007fbc46fbb55556eb95cd9d66d816cff50ce6b6
2023-08-10 16:26:19 +00:00
Andrey Cherkasov
fc497fabbc [kotlin k2] Make getValueArgumentName works for KtLambdaArgument
^KTIJ-21135

GitOrigin-RevId: c20d3f4e922d3580ad42edb994795c24ea728a0a
2023-08-08 10:30:19 +00:00
Anna Kozlova
5e067cd8a6 [kotlin] extract frontend independent formatter to formatter module
KTIJ-26147

GitOrigin-RevId: 3712d105faff744c027edee0f192f2cfc2a555b6
2023-08-07 06:57:30 +00:00
Anna Kozlova
f81d8eb6d3 [kotlin] k2: ensure breadcrumbs works (KTIJ-21121)
GitOrigin-RevId: ee45f0042cb64e05c5d1d6aab59fcd0c4312b93d
2023-07-28 12:56:51 +00:00
Bart van Helvert
463c9d498c [kotlin] Add documentation to PsiElement.deleteSingle
GitOrigin-RevId: 68e03eecd8bc3c35660540e02de855fc740140d5
2023-07-18 14:27:36 +00:00
Andrey Cherkasov
9935ab5a90 Migrate psiModificationUtils#moveInsideParenthesesAndReplaceWith to common module
^KTIJ-21135

GitOrigin-RevId: 36863dbc6f10e6752cdb784d6c65e5015c87b435
2023-06-29 11:47:21 +00:00
aleksandrina-streltsova
5050262224 Merge commit '77d71f8fea5675891810fc3b8cf9c72c64cfdf2a'
GitOrigin-RevId: 1a498795c741870e016adbd9c31082ae1e270655
2023-06-22 16:26:36 +00:00
aleksandrina-streltsova
735c4410ed [kotlin k2] Replace check for an annotation argument with the less permissive one
GitOrigin-RevId: 77d71f8fea5675891810fc3b8cf9c72c64cfdf2a
2023-06-22 13:03:21 +00:00
aleksandrina-streltsova
3c3b5f86e8 [kotlin k2] Completion: don't suggest inapplicable callables inside annotation entry argument list
^KTIJ-19863

GitOrigin-RevId: 9f27d6703e7c6c6745c9db2a647afc167c3e1a77
2023-06-22 13:03:18 +00:00
Bart van Helvert
c7a64abd85 [kotlin] Migrate psiModificationUtils#setDefaultValue to common module
GitOrigin-RevId: 8b18f12777e4eb315f7b3d0e792602b31181edcf
2023-06-15 20:24:18 +00:00
Bart van Helvert
bd9093ccb5 [kotlin] Migrate psiModificationUtils#addTypeParameter to common module
GitOrigin-RevId: 35038e84a5f178b4208c1ab70aba3d659c1d0ea9
2023-06-15 20:24:14 +00:00
Roman Golyshev
26b0570091 Merge branch 'kt-master' into fedochet/kt-master-merge
GitOrigin-RevId: 354d4e5385be06da1372876cd97af45d0cef56e2
2023-06-14 12:02:28 +00:00
Alexey Belkov
55f582d5d3 Apply Kotlin inspection "Redundant 'if' statement"
GitOrigin-RevId: 2f93c77e56d8519431e8cc94f4ca2354003806b6
2023-06-12 14:45:50 +00:00
Ilya Kirillov
8beaba507b [kotlin] make addImport function more discoverable by converting KtFile parameter to extension receiver
^KT-58992

GitOrigin-RevId: e9d8b1d8d923dac577b06cbb5507c71b27b08545
2023-06-09 15:12:27 +00:00
Ilya Kirillov
361636cf13 [kotlin] move import insertion functionality to the base module
^KT-58992

GitOrigin-RevId: 1dbf6cf640bebe4b3506b5c7235fd1d95973d5e5
2023-06-09 15:12:27 +00:00
Bart van Helvert
2c989a2303 [kotlin] Move Mover to common refactoring module
^KTIJ-23273 Also moves `deleteSingle` extension function.

GitOrigin-RevId: c64aef7886c2921eb9d22d1b6cd86d4598e521b3
2023-04-28 13:11:41 +00:00
Bart van Helvert
63e538d5bb [kotlin] Move KtClass#getOrCreateCompanionObject from core to PSI module
^KTIJ-23273

GitOrigin-RevId: 7de611e9759a62e6378036a22a1a4f74c9f506fb
2023-04-28 13:11:20 +00:00