This module will contain all code that can be shared between K1 (old/new) and K2 J2K.
KTIJ-28529
GitOrigin-RevId: c9984fafbac199a858956ac4a3c6728289114c4d
Create a K2 implementation of J2kConverterExtension
and adjust other infrastructure.
KTIJ-28529
GitOrigin-RevId: b5e56343ed865ea40c055260e269d77261e357d8
* Break the dependency of new J2K modules on old J2K modules
* Remove "kotlin.j2k.idea" module as redundant
* ...
^KTIJ-28473 Fixed
GitOrigin-RevId: acd421b96d6d6c0099cf2d29e150268d8dd08134
it supposed to contain ide/ui specific actions which are shared between k1 and k2
part of KTIJ-28142
GitOrigin-RevId: 9ee0d5808a80ab36d9c0aa4176a1633f48e482c4
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
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
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
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
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
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
New module "kotlin.project-wizard.idea-k2" created to support logic in k2.
(cherry picked from commit aa8d3d87a8ccd3aee2a650caf3cc66f52cfb7761)
IJ-MR-99313
GitOrigin-RevId: bc99980513803eaa50201b371c7afa0363781a1a
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