Commit Graph

1184 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
andrew.kozlov
6d3ff7512b [kotlin] KTIJ-29028 KotlinQuickFixFactory implementation for Intentions
GitOrigin-RevId: daf38b1714fd31bc895294b7ba9e66da1aa898b8
2024-03-12 20:51:15 +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
Vladimir Dolzhenko
b71bba3c51 [kotlin] Enforce kotlin.plugin.k2 dependency for k2 modules
GitOrigin-RevId: cd8ae3ce77a9cabfa2629de4022b3fbbbb8cdac5
2024-01-19 23:34:50 +00:00
Dmitrii Gridin
bf49f9e21d [kotlin] regenerate tests for 2024
GitOrigin-RevId: 48215f9ecb7d1a85481bcfad203e8c73e0c5a907
2024-01-01 11:38:00 +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
Roman Golyshev
57763417b6 KTIJ-23992 [kotlin] Remove redundant FE10 dependency from compiler-plugin-support modules related to Maven
Since we want to enable maven support modules in the K2 plugin,
it's a good idea to make sure that those modules do not in fact
depend on FE10.

`kotlinx-serialization.maven` still has a dependency on FE10,
but it should not be an issue since it does not seem to
actually use any FE10-specific APIs

Similar Gradle EPs (`GradleProjectImportHandler`) are not
enabled because gradle projects seem to work fine without it
(see KTIJ-28200 for the further investigation details)

GitOrigin-RevId: 008063946589c16e4529752645c92fc9a250e7e4
2023-12-14 11:42:48 +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
Aleksei.Cherepanov
9ad48354c8 KTIJ-24647 Update usages of compiler arguments according to Workspace Model
Avoid altering copies of compiler arguments. Instead, the upstream function is now utilised. In addition, it ensures any changes made to these arguments are persisted as needed to the workspace entity. These changes fix the compiler arguments for storage in the entity structure.

GitOrigin-RevId: 0b98f1d84b816afec06dea0dc422285eac92e652
2023-12-08 23:34:05 +00:00
Aleksei.Cherepanov
0eec0e902e IDEA-333730 Adapt Lombok Gradle Project resolver for persistent compiler plugins model in data nodes
Fix compilation for 6ea8099a
https://github.com/JetBrains/intellij-community/pull/2582
Relates KTIJ-27235

GitOrigin-RevId: 63247b65d799457ce40384ac37bbd87abb6a35d2
2023-10-27 12:37:44 +00:00
Ivan Gavrilovic
ef29e034b1 IDEA-333730 Persist compiler plugins model in data nodes
... to allow data importers to always produce the same
result, even if data nodes are retrieved from cache.

Also, variant switching in Android Studio relies on this.
It restores data nodes from the cache, to avoid invoking
full Gradle sync.

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

#KTIJ-27235 Fixed

GitOrigin-RevId: c03227a1c6cd3177ed9f7f5438075ac482743878
2023-10-27 12:37:39 +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
Alexey Belkov
29d9c97c52 [kotlin] Apply devkit inspection "Companion object in extensions" in some places
Simple cases with private members.

GitOrigin-RevId: 0751472052aff122462bf8768ad98570895d0e6d
2023-10-20 14:42:11 +00:00
Pavel Kirpichenkov
e5921c9631 [Kotlin] Merge 'kt-master' to 'master'
Corresponding kotlin.git build: 2.0.0-dev-4824
kotlin.git master@bae8b283c76772c3154dfd8aa6c4581c88b5c723
intellij.git kt-master@fd755017492802373cd2d167ab91f82a13393ac5

GitOrigin-RevId: 78c6fedf16bd08e921a9ba1571daccb2ee46e139
2023-10-12 11:05:04 +03:00
Vladimir Dolzhenko
7ed289789a [kotlin] Fix read access from EDT
#KTIJ-27303

GitOrigin-RevId: e6be13867e986e903eed4691b2ff93c67ee8623d
2023-10-09 13:51:19 +00:00
Aleksei.Cherepanov
42f762354f [Kotlin maven importer] Avoid using Kotlin facet during import of plugin configuration
Use KotlinFacetSettings instead. This change is needed because new workspace model does not provide facet.

#KTIJ-24647 In Progress

GitOrigin-RevId: 2b4bd46438404e518b780acc0b3e3c5bae8030db
2023-10-06 12:53:04 +02:00
aleksandrina-streltsova
7badf97e80 [kotlin] k2: refactor auto-import, use KotlinPositionContext
^KTIJ-27228 Fixed

GitOrigin-RevId: db24fba4314546b070525a79bf5168872622319c
2023-10-02 10:46:39 +00:00
aleksandrina-streltsova
7f730f5884 [kotlin] k2: move import fix to separate package
KTIJ-27228

GitOrigin-RevId: 635558fa1d9e78a40d1e3c9732608d31931b7201
2023-10-02 10:46:32 +00:00
Daniil Ovchinnikov
27e155fc21 IJPL-167 bump language and API version 1.8 -> 1.9
GitOrigin-RevId: 5204df1784bbbba550476415e4ceff7368ab5fd4
2023-09-19 19:52:47 +00:00
aleksandrina-streltsova
78737e3e7d [kotlin] K2: filter out names excluded from auto-import
^KTIJ-26338 Fixed

GitOrigin-RevId: f2e817b0c0e248638660083ef1d46c6603456f50
2023-08-24 19:17:30 +00:00
Ilya Kirillov
d79dac7972 [kotlin] migrate KtAnalysisSession extension receiver to context receive as this is the proper way to use Analysis API
GitOrigin-RevId: 8caf2fd44779c9bd80fe06f4ee6ec0cc362c9737
2023-07-28 12:58:47 +00:00
Vladimir Dolzhenko
bab54c6d29 [kotlin] Improve test coverage of collected FUS quickfixes data
#KTIJ-389

GitOrigin-RevId: c8554b77a988a77484d1dada64353345b7a1fa35
2023-07-20 05:59:17 +00:00
aleksandrina-streltsova
c7b8abcac5 [kotlin k2] Save scope into property in SymbolFromIndexProvider
KTIJ-24162

GitOrigin-RevId: 2f0f6c20aebcd219bb26c2a94d7b278efc91c415
2023-07-06 09:17:26 +00:00
Andrey Cherkasov
4505864cc8 Migrate the chooseContainerElementIfNecessary method to common refactoring module
^KTIJ-21135

GitOrigin-RevId: c699473ede0628f9732545483ffe18c9ef8937ec
2023-06-29 11:47:42 +00:00
Roman Golyshev
7c5c02614e KT-59098 [kotlin] Migrate to nullable resolveCall method
GitOrigin-RevId: ef0ac2f779775a16e734b5236918909f2d8b0511
2023-06-21 20:40:49 +00:00
Ilya Muradyan
9ccf3cf44c KTIJ, KTNB-251: Add extension point for checking if serialization plugin is enabled
IDE Serialization plugin basic logic is to find serialization plugin JAR in the plugins classpath determined by the current module's compiler options.
This logic isn't applicable for scripting modules. In particular, `unwrapModuleSourceInfo` returns null for `ScriptModuleInfo`, and it's reasonable.
So solution is to add an extension point to support determining "enable-ness" of serialization plugin by scripting configuration option.

GitOrigin-RevId: 41bf6d8a66c2c682a4a00375dcabf0a1ffc7ccc3
2023-06-10 20:51:48 +00:00
Vladimir Dolzhenko
afe8092dc2 Merge commit '2ccf2bb0272952071b7d6caa67ff5d0f4b130515'
GitOrigin-RevId: d8334ba56c825499bb63c1aa391dfc91c1cf2361
2023-05-30 17:01:19 +00:00
Alexey Belkov
110db7053a Apply Kotlin inspection "Unnecessary '@OptIn' annotation" on whole project
GitOrigin-RevId: 08826c356323606bead3c87ed0133ddb6d172ce5
2023-05-27 14:22:26 +00:00
Alexey Belkov
4467dc883b Apply Kotlin inspection "Unnecessary type argument" on whole project
GitOrigin-RevId: 70a38b512309685d57bb5eddf2fc5068f14fe481
2023-05-27 14:22:18 +00:00
Ilya Kirillov
96106ce106 [kotlin] fix module structure issues after new modules are introduced in the intellij-community
GitOrigin-RevId: 2784a198d729b1a9489594911d772705255dbfba
2023-05-25 19:52:51 +00:00
Justin Paupore
b749b4ce85 Port ParcelMigrateToParcelizeQuickFix to K2.
This is the only quickfix that requires analysis. The analysis-related
code has been split out into a resolver object that, given a context
object (BindingContext for K1, KtAnalysisSession for K2), answers
analysis queries.

^KTIJ-25177

GitOrigin-RevId: 42f68cebbc9bb62d8435d0d86720f97a4d05bba3
2023-05-25 19:52:45 +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
7157b08ea9 Split K1 Parcelize tests into module.
This is in preparation for adding K2 tests.

^KTIJ-25177

GitOrigin-RevId: 13bfa3883b47a380e5028c99fbcc84205bab2662
2023-05-25 19:52:31 +00:00
Justin Paupore
f11b39eeee Make quickfix factories frontend-agnostic.
Remove AbstractQuickFixFactory and its subobjects, and use
a QuickFixesPsiBasedFactory instead. Add a factory() helper method that
handles the common parent-element lookup logic.

^KTIJ-25177

GitOrigin-RevId: 6e0501192e57edea85e903a028e8243ecbeb57f5
2023-05-25 19:52:25 +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
Justin Paupore
bedd7300cd Split out PSI-only quick fix base class.
The bulk of the existing Parcelize quick fixes only rely on PSI, not on
analysis (the exception being ParcelMigrateToParcelizeQuickFix). To
enable running these quick fixes on K2, create a base class derived from
KotlinPsiOnlyQuickFixAction, and change the PSI-only quick fixes to
derive from that base class.

In addition, change the shortenReferences extension function to use
ShortenReferencesFacility, so that it will work on K2.

^KTIJ-25177

GitOrigin-RevId: 8305fc4bfda786c8ed37efbee1c774d12f098403
2023-05-25 19:52:00 +00:00
Justin Paupore
334d857c8e Clean up stray ParcelizeQuickFixContributor copy.
The in-use version of this class lives in parcelize/common. The version
directly under the parcelize directory does not appear to even be
compiled, let alone used.

^KTIJ-25177

GitOrigin-RevId: 3120f60b7e978a460253a4d4f82ebae38c8d5518
2023-05-25 19:51:53 +00:00
Yan Zhulanow
538e6379a6 [kotlin] Migrate 'getKtModule()' usages with 'ProjectStructureProvider'
^KT-57559 Fixed

GitOrigin-RevId: cbaad6e87550f214992763659b7e125468a6349e
2023-05-16 10:42:07 +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
Yahor Berdnikau
2fbe3f960a [Kotlin][Gradle] Support import for unbundled compiler plugins
Update import to support separately published Kotlin compiler plugins that are not embedded into related Gradle/Maven plugins.

^KT-52811

GitOrigin-RevId: 5111708cd7bb6f363a34bafd7fafef5a95e2111a
2023-04-17 12:34:54 +00:00
Leonid Shalupov
a16b24fc6d kotlin: use new reflection-less functions to work with compiler arguments
see 7480befe32

GitOrigin-RevId: 2f2bd2ef343ff92d1df8f44c5ccda6994f97e554
2023-04-05 18:52:09 +00:00
Alexander Udalov
f9b587e7da [kotlin] Remove obsolete classBuilderFactoryInterceptorExtension
It was removed in
163a052f98.

GitOrigin-RevId: 99c546a6c4d261334149efc9b827961bc3bef83e
2023-03-16 09:08:31 +00:00
Alexander Udalov
7614419c2a [kotlin] Remove old JVM backend implementation of Parcelize
GitOrigin-RevId: dd684afc31338a1012a72a676283a7fb0b6069d6
2023-03-16 09:08:27 +00:00
Vladimir Dolzhenko
b83e134b48 [kotlin] Update copyright
GitOrigin-RevId: fdf5f33bc5b58b3dbcad58b8e5516871e014121f
2023-01-02 12:48:27 +00:00
Yan Zhulanow
d3bbeabd9b [kotlin] Move 'assignment' plugin caches to a single place (KTIJ-23292)
GitOrigin-RevId: d363d483e44fe9a878413c0a3f7134cc261c7032
2022-10-18 09:43:50 +00:00
Anže Sodja
adafc71d1c [kotlin] Correctly handle annotations for scripts in IdeAssignPluginResolutionAltererExtension (KTIJ-23292)
GitOrigin-RevId: 61f80857bc6882dd4524aff7100e0bfd2e3fbe0f
2022-10-18 09:43:44 +00:00
Anže Sodja
db5b90c8a5 [kotlin] Correctly parse compiler options in IdeAssignmentContainerContributor (KTIJ-23292)
GitOrigin-RevId: 2ba91d7ef24e42006256a008fa0a18772d2bc8c3
2022-10-18 09:43:40 +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
Steven Schäfer
236c885e5d Kotlin Parcelize: Fix type of CREATOR field in Parcelize ULC
closes https://github.com/JetBrains/intellij-community/pull/2182

GitOrigin-RevId: cc481f6526c9089fb7f41e1e32e850aa91ecf327
2022-10-06 17:04:31 +00:00
Vladimir Krivosheev
0af2e7b5c5 fix - reduce member visibility (public -> private)
GitOrigin-RevId: fe8a4740e27d192798a9fa55ff41112d1b633e49
2022-09-14 15:09:45 +00:00