Commit Graph

135 Commits

Author SHA1 Message Date
Bart van Helvert
9652c5a2f1 [kotlin] Move K2 fixes into a new module
GitOrigin-RevId: e8001ccd6e80b535ae165acba449d6b16cd27910
2024-03-13 00:27:06 +00:00
Mikhail Shagvaliev
930a5c3beb [qodana] QD-8218 Add kotlin.jsr223 module – to extract common logic of kotlin plugin(repl module) and scripting plugin
(cherry picked from commit 3b3921917c7b759f1a870c2f29f2e43ee6663db0)

IJ-CR-126053

GitOrigin-RevId: 26b32239a7c34aa71ed9bf7a5a1635537890fe27
2024-03-08 11:15:05 +00:00
Alexey Belkov
827a8b60d9 [kotlin] J2K: rename module kotlin.j2k.k1.shared" to "kotlin.j2k.shared"
This module will contain all code that can be shared between K1 (old/new) and K2 J2K.

KTIJ-28529

GitOrigin-RevId: c9984fafbac199a858956ac4a3c6728289114c4d
2024-02-22 20:37:02 +00:00
Alexey Belkov
61526cdc74 [kotlin] J2K: create a stub K2 J2K module
Create a K2 implementation of J2kConverterExtension
and adjust other infrastructure.

KTIJ-28529

GitOrigin-RevId: b5e56343ed865ea40c055260e269d77261e357d8
2024-02-22 20:36:59 +00:00
Vladimir Dolzhenko
2c5a48c4d7 [kotlin] Align k2 module names with naming convention
#KTIJ-28562

GitOrigin-RevId: 689120c48d4ff0a8b0acba381a0da24ec8992c3d
2024-01-23 17:52:15 +00:00
Alexey Belkov
7d321928c6 [kotlin] J2K: rename module "kotlin.j2k.old" to "kotlin.j2k.k1.old"
KTIJ-28473

GitOrigin-RevId: 76223e85d96dad92d8dd4c97ed13d4642276b4fd
2024-01-16 15:00:33 +00:00
Alexey Belkov
cd501f2477 [kotlin] J2K: rename module "kotlin.j2k.old.post-processing" to "kotlin.j2k.k1.old.post-processing"
KTIJ-28473

GitOrigin-RevId: caeba90d63cd7e8c2df7414e979f1ca046a08b95
2024-01-16 15:00:19 +00:00
Alexey Belkov
a5ad058fb1 [kotlin] J2K: rename module "kotlin.j2k.new" to "kotlin.j2k.k1.new"
KTIJ-28473

GitOrigin-RevId: ff38e4c4a71e1976ee098e5d8d5ada96f78c2573
2024-01-16 15:00:11 +00:00
Alexey Belkov
5307389992 [kotlin] J2K: rename module "kotlin.j2k.post-processing" to "kotlin.j2k.k1.new.post-processing"
KTIJ-28473

GitOrigin-RevId: de3c122c319de86f48335084c45c0be31b70b88d
2024-01-16 14:59:56 +00:00
Alexey Belkov
2107b812e6 [kotlin] J2K: rename module "kotlin.j2k.common" to "kotlin.j2k.k1.shared"
KTIJ-28473

GitOrigin-RevId: 9839816ab6cfc5850353049ebc68a1406242bf47
2024-01-16 14:59:49 +00:00
Alexey Belkov
d5e542f6f4 [kotlin] J2K: Extract a common module between old and new J2K
* Break the dependency of new J2K modules on old J2K modules
* Remove "kotlin.j2k.idea" module as redundant
* ...

^KTIJ-28473 Fixed

GitOrigin-RevId: acd421b96d6d6c0099cf2d29e150268d8dd08134
2024-01-16 14:59:42 +00:00
Anna Kozlova
70910a1bf9 [kotlin] extract frontend agnostic kotlin.ide module
it supposed to contain ide/ui specific actions which are shared between k1 and k2

part of KTIJ-28142

GitOrigin-RevId: 9ee0d5808a80ab36d9c0aa4176a1633f48e482c4
2024-01-12 20:55:16 +00:00
Anna Kozlova
c197e8472b [kotlin]: extract formatter.minimal module for remote-dev
RDCT-828

GitOrigin-RevId: 457b8ebf599c61b852ed0b545664caa7d7eee68e
2023-12-21 19:27:07 +00:00
Roman Golyshev
245d4e4f20 KTIJ-23992 [kotlin] Rename allopen.common to allopen.common-k1
This better reflects the fact that all the services
from that module are actually strictly for K1

Note how the common module was not actually
used by corresponding `gradle` or `maven`
modules, so its common-ness is more about
plugin support required both for Gradle
and Maven projects

Also rename the test module because it seems
to be K1-specific also

This was a "low-hanging fruit" rename; the other
modules in the compiler plugins support are
more convoluted and require more work to be
properly organized

GitOrigin-RevId: 3f071ea918890a3f576d4e3f5a7fee7ee34bfecf
2023-12-14 11:42:52 +00:00
Anna Kozlova
c1bf96bd02 [kotlin] extract modules in preparation for kotlin specific features on remote-dev client
- `code-insight-minimal` and `highlighting-minimal` added
- `line-indent-provider` removed
- add dependency on `platform.lang.impl` explicitly where needed

RDCT-828

GitOrigin-RevId: 21c2e18e038641dbbeef21ab70c651cfb7c38351
2023-12-13 12:06:59 +00:00
Frederik Haselmeier
af07791174 [kotlin] Added Kotlin onboarding state to track new Kotlin users
^KTIJ-26957 fixed


Merge-request: IJ-MR-115198
Merged-by: Frederik Haselmeier <Frederik.Haselmeier@jetbrains.com>

GitOrigin-RevId: 8ce86d044e56c20fee480712693cb16699538f7d
2023-10-23 10:22:53 +00:00
Ilya Kirillov
a8c9fa047f [kotlin] adapt project model changes in injection modules
^KTIJ-21127

GitOrigin-RevId: fcc2b5f66fd0336bdbcd6aeb382eb6b0c48370a3
2023-10-11 09:13:44 +00:00
Justin Paupore
33c566fc43 [kotlin] Port NamingConventionInspections to K2
Port the inspections in NamingConventionInspections to K2. The bulk of
these inspections are PSI-only, but FunctionNameInspection requires
resolve, so it has been split into a base class to handle the PSI-only
portions of the inspection, and two concrete implementations (one each
for K1 and K2), to handle the analysis.

To more cleanly distinguish between ported and unported inspections, add
an inspections-k1 module to accompany inspections-shared and
inspections-k2.

^KTIJ-22913 Fixed

GitOrigin-RevId: 14572f52efba68406394c41503af241da85e18c9
2023-09-21 16:32:23 +00: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
Roman Golyshev
a89b802b06 KTIJ-26685 [kotlin] Create a separate kotlin.code-insight.k1 module
Move K1OptimizeImportsFacility implementation there

GitOrigin-RevId: d19a573a35e771cb0a67baeb131622ceda2ae921
2023-08-17 14:13:57 +00:00
Vladimir Dolzhenko
d920606d1a [kotlin] Regroup highlighting modules, p.2
GitOrigin-RevId: 01caec663d11e19deec0e0e71072376ef5588367
2023-08-15 04:13:16 +00:00
Vladimir Dolzhenko
212b4c1a47 [kotlin] Regroup highlighting modules
GitOrigin-RevId: 85a48fd2aec4fb321cec2d0c24d032274dc98b28
2023-08-02 07:43:51 +00:00
Marco Pennekamp
7cbf567b5f [kotlin] KT-58257 Establish an order between library info cache and module state modification workspace model listeners
This commit fixes two problems:

1. Previously, it wasn't guaranteed that `LibraryInfoCache` would be the last component to receive "before change" events. If, for example, `KotlinModuleStateModificationService` receives the event after `LibraryInfoCache`, a situation as outlined in `FirOrderedWorkspaceModelChangeListener` might occur. The ordered workspace model change listener avoids this, because it is registered as a single listener and delegates the events to the other components in a clear order.
2. Previously, `LibraryInfoCache` couldn't be accessed for the first time from a workspace model listener (such as the listener in `KotlinModuleStateModificationService`), because this could lead to cache inconsistencies.
  - Reason: Subscribing to workspace model events (during initialization from first-time access) while a workspace model event is being processed means that that event won't be propagated to the new subscription. Hence, for exactly that event, `LibraryInfoCache` would not be invalidated, as its workspace model listener wouldn't be called, leading to a cache entry whose changes weren't picked up.
  - In more detail:
    1. A root "before change" event for a library `L1` is published.
    2. `KotlinModuleStateModificationService` calls `LibraryInfoCache` with `L1`.
    3. `LibraryInfoCache` is initialized, the workspace model subscription is initialized, and `L1` is added to the cache with the root BEFORE the change because the event is a "before change" event.
    4. The root change event skips `LibraryInfoCache`'s listener because the subscription was added during the event handling.
    5. `L1` is still part of the cache, but now `LibraryInfoInnerCache.cache` contains a library `L1` with the new root (once the `LibraryBridge` has been updated), while `deduplicationCache` still contains the old root.
  - The solution is quite simple: the workspace model listener has to be registered before events might need to be handled. The combined listener is registered via XML, which guarantees this.

GitOrigin-RevId: f31e7bda0ed1e7b9ea4aaebad757db6af54d4d8b
2023-07-31 15:58:31 +00:00
Anna Kozlova
9723823ff1 [kotlin] support properties completion without extensions (KTIJ-26414)
GitOrigin-RevId: ef500abbe0df20e46c9b80df6417ebb51388b2fc
2023-07-28 12:58:34 +00:00
Andrey Cherkasov
aec4f8719d FIR IDE: Implement introduce variable refactoring
^KTIJ-21135

GitOrigin-RevId: 2fbb39691414f3424e23e0b37656d0a86b355a61
2023-06-29 11:47:58 +00:00
Bart van Helvert
d9cec9bfbc [kotlin] Implement structural search and replace for K2
#KTIJ-25962 Fixed

GitOrigin-RevId: 14fcd35d064364be7fe3d5d6e953dbb50467e177
2023-06-23 17:26:32 +00:00
Vladimir Dolzhenko
afe8092dc2 Merge commit '2ccf2bb0272952071b7d6caa67ff5d0f4b130515'
GitOrigin-RevId: d8334ba56c825499bb63c1aa391dfc91c1cf2361
2023-05-30 17:01:19 +00:00
Justin Paupore
b1feb40fa6 Add PSI-only quickfixes for K2.
For quickfixes that do not rely on analysis (everything except
ParcelMigrateToParcelizeQuickFix), register those quickfixes against the
diagnostics generated by the K2 Parcelize plugin.

^KTIJ-25177

GitOrigin-RevId: 9a11c28db219459adc4bbe5895faf21e46d38d4a
2023-05-25 19:52:38 +00:00
Justin Paupore
85a1e7a26a Split out K1 manifest.
Create a new `kotlin.compiler-plugins.parcelize.k1` module, wire it up
to be loaded under the K1 plugin, and move some K1-specific classes
there. Note that we can't yet get rid of the FE1.0 dependencies from the
common module - the quickfix factories depend on them, and need to be
refactored.

^KTIJ-25177

GitOrigin-RevId: 005cf692a2b031f408b186a01bc8cafd4b577027
2023-05-25 19:52:18 +00:00
Daniil Ovchinnikov
675b19fb2c IJPL-130 rename library kotlin-coroutines-jdk8 -> kotlin-coroutines-core
GitOrigin-RevId: e987a9f48391d74e401c860a57f99634ccc21a4a
2023-05-18 22:52:00 +00:00
Bart van Helvert
a2cf62cbb2 [kotlin] Add K2 move refactoring implementation module
^KTIJ-23273

GitOrigin-RevId: 0d0715f7590141a1b3fa44f7d81c72152a493536
2023-05-10 12:06:24 +00:00
Andrei Klunnyi
77c3d9eee3 [kotlin] KTIJ-24390: intellij.kotlin.plugin.community.main should include new module
GitOrigin-RevId: fb26d45a70258ee1f9c7ee1c9b824bfd31aa59a2
2023-04-28 12:31:41 +00:00
Andrei Klunnyi
deffb78794 [kotlin] KTIJ-24390 Assignment plugin: imports are not recognized
Note that this commit depends on changes made for KT-57468.

The problem affected `ImportOptimizer` (correct import statement was
recognized as unused) and `Import[Quick]Fix` (missing import was not
suggested). Both were mostly caused by the inability to provide
a `Name` of the function for overridden assignment [1].

This commit introduces the following changes:
1. Module `kotlin.compiler-plugins.assignment.common` was split to
   manage K1 and K2 dependencies properly. Extensions we re-registered
   accordingly [2].
2. K1- and K2- plugin specific import quick fixes introduced [3]
3. K2 plugin added to bundled (so far, it's the way to make it active) [4]
4. Support for `KtCompilerPluginsProvider` extension [5]
5. Tests for import quick fixes and unused import inspection.

--------------------------------------------------------------------
[1]: KtSimpleNameReference.getResolvesByNames
[2]: IdeAssignPluginResolutionAltererExtension and
     IdeAssignmentContainerContributor
[3]: AssignmentPluginImportFix, FirAssignmentPluginQuickFixRegistrar
[4]: KotlinK2BundledCompilerPlugins
[5]: KtCompilerPluginsProviderIdeImpl, KtFe10CompilerPluginsProvider

^KTIJ-24390 fixed

GitOrigin-RevId: 8fec44b5c43b11aa6741c3d9cac1549886645433
2023-04-27 14:23:30 +00:00
Nikolay Chashnikov
3358643291 [intellij project configuration] remove dependency on module with tests from intellij.kotlin.plugin.community.main
This is needed to avoid inconsistencies in runtime module descriptors (IJPL-109).

GitOrigin-RevId: 8202753aa43ed04df4108ea49ead35ede90f59e9
2023-04-11 13:55:41 +00:00
Roman Golyshev
a2707a367a [kotlin] KTIJ-24438 Add a separate module to depend on compiler plugins
GitOrigin-RevId: 849231d548d67b35c70c375df5612ef50f11dc39
2023-03-16 09:09:31 +00:00
Maxim.Kolmakov
a97ce03b8f Move Kotlin performance plugin to community since its functionality should be available there
GitOrigin-RevId: eadeb83cdb7fdc6ec4b589569ffbfcf8dffcfb2c
2023-03-09 11:05:32 +00:00
Vladimir Krivosheev
3b6878fb99 rename kotlinx-collections-immutable-jvm to kotlinx-collections-immutable - do not use -jvm suffix
GitOrigin-RevId: 0cd5459d5cdf53b0aba9437161d3d6470aa80e6f
2023-02-05 16:35:59 +00:00
Roman Efremov
be1da4cbee Revert "KTIJ-23777 Enable Enum.values() in Java inspection in new projects created in wizard"
This reverts commit bc999805

(cherry picked from commit 395d1a3a98dd50b59dcbb2c49e58945cc47a1f05)

IJ-MR-101836

GitOrigin-RevId: df04c1af128056272538aae8cafb6de2d59cfe67
2023-01-25 15:46:15 +00:00
Roman Efremov
0c17f20a0d KTIJ-23777 Enable Enum.values() in Java inspection in new projects created in wizard
New module "kotlin.project-wizard.idea-k2" created to support logic in k2.

(cherry picked from commit aa8d3d87a8ccd3aee2a650caf3cc66f52cfb7761)

IJ-MR-99313

GitOrigin-RevId: bc99980513803eaa50201b371c7afa0363781a1a
2022-12-07 23:00:31 +00:00
Ilya Kirillov
b37797528f [kotlin] fix exception invoking generate test action
The RemoveUnnecessaryParenthesesIntention class was placed into the module with the new plugin model.
J2KPostProcessingRegistrarImpl from the old J2K (which is used for the test generation) uses RemoveUnnecessaryParenthesesIntention
which violated the contract that modules which are not migrated to the new plugin model should not use functionality from the modules which were migrated.

This commit extracts J2KPostProcessingRegistrarImpl to a new-plugin style module to solve this issue.

^KTIJ-23593 fixed

GitOrigin-RevId: 2ac79947fa9afd231cae021fc2dc7f9ea633935a
2022-11-17 19:23:43 +00:00
Ilya Kirillov
ba965c63bc [kotlin] move shared find usages functionality to a separate module
GitOrigin-RevId: ddbfaa9b9572cb972b97e217c3b755e86edd4c1c
2022-11-11 07:51:20 +00:00
Ilya Kirillov
2825ec57f2 [kotlin] rename kotlin.search.k2 module directory to match module naming guide
GitOrigin-RevId: 0f872e10fd9b01905684ce5c8b79d6d47e7e508c
2022-11-07 18:08:22 +00:00
Anna Kozlova
122344ea60 [kotlin] rename kotlin.search to ensure k2 in the name
GitOrigin-RevId: c187a234d23055fc73fba3d0cacbf417c929293c
2022-10-21 17:52:25 +00:00
Anže Sodja
c39c23e4c8 [kotlin] Add support for Kotlin assignment compiler plugin (KTIJ-23292)
GitOrigin-RevId: 0026826914fd9819ac92455b9a2c5d99b7c57eb0
2022-10-18 09:43:37 +00:00
Anna Kozlova
d272b8acbc [kotlin] dedicated module for search functionality
currently works over light classes

GitOrigin-RevId: 6fe4c2e51e6582d4a214fa859907e40b6f06c6c1
2022-09-23 09:04:12 +00:00
Anna Kozlova
61d970e403 [kotlin] safe delete: extract common part to kotlin.refactorings.common (KTIJ-21136)
fix groovy when java type parameter is deleted as part of unification

GitOrigin-RevId: ce6c25bf5f8faad33f072496a316a3a61263e153
2022-09-22 20:32:10 +00:00
Yan Zhulanow
0f3f51b500 [kotlin] Implement 'suspend' line marker in K2 (KTIJ-22997)
GitOrigin-RevId: 6aedb452fdbe6a777db554f301ed903db234e676
2022-09-22 10:23:33 +00:00
Yan Zhulanow
756386931d [kotlin] Move 'KotlinRunLineMarkerContributor' to the 'kotlin.code-insight' module group (KTIJ-21112)
GitOrigin-RevId: 354155f6f34aadf20e12a9ea6e06acefe2adbd79
2022-09-22 10:23:30 +00:00
Anna Kozlova
874fbd72b3 [kotlin] safe delete: revert k2 implementation via light classes; empty fir implementation (KTIJ-21136)
GitOrigin-RevId: 3636b555ff986bb71724b8200a02dd9e1d464b0a
2022-09-19 11:29:50 +00:00
Yan Zhulanow
2119edab8a [kotlin] Implement postfix templates in K2 (KTIJ-21124)
GitOrigin-RevId: c73021bf481863c04cf3b7b85dd9e63d37d50b64
2022-09-02 08:39:33 +00:00