From 0c3a4c735d4392ea3310a2bd46d97a07126aa92b Mon Sep 17 00:00:00 2001 From: Him188 Date: Tue, 10 Nov 2020 13:59:41 +0800 Subject: [PATCH] Support PluginMainServiceNotConfiguredInspection and ConfigurePluginMainServiceFix --- .../src/resolve/resolveTypes.kt | 3 +- .../resources/META-INF/plugin.xml | 6 ++ .../InspectionGadgetsBundle.properties | 9 +++ .../messages/InspectionsBundle.properties | 9 +++ .../org/example/myplugin/MyPluginMain.kt | 3 - ...luginMainServiceNotConfiguredInspection.kt | 77 +++++++++++++++++++ .../src/diagnostics/diagnosticsUtil.kt | 20 ++++- .../fix/ConfigurePluginMainServiceFix.kt | 44 +++++++++++ .../marker/PluginMainLineMarkerProvider.kt | 17 +--- .../src/resolve/resolveIdea.kt | 9 ++- 10 files changed, 172 insertions(+), 25 deletions(-) create mode 100644 tools/intellij-plugin/resources/messages/InspectionGadgetsBundle.properties create mode 100644 tools/intellij-plugin/resources/messages/InspectionsBundle.properties create mode 100644 tools/intellij-plugin/src/diagnostics/PluginMainServiceNotConfiguredInspection.kt create mode 100644 tools/intellij-plugin/src/diagnostics/fix/ConfigurePluginMainServiceFix.kt diff --git a/tools/compiler-common/src/resolve/resolveTypes.kt b/tools/compiler-common/src/resolve/resolveTypes.kt index 080f61ed4..c8d5bce00 100644 --- a/tools/compiler-common/src/resolve/resolveTypes.kt +++ b/tools/compiler-common/src/resolve/resolveTypes.kt @@ -19,10 +19,11 @@ import org.jetbrains.kotlin.resolve.constants.ArrayValue import org.jetbrains.kotlin.resolve.constants.EnumValue /////////////////////////////////////////////////////////////////////////// -// Serializer +// OTHERS /////////////////////////////////////////////////////////////////////////// val SERIALIZABLE_FQ_NAME = FqName("kotlinx.serialization.Serializable") +val AUTO_SERVICE = FqName("com.google.auto.service.AutoService") /////////////////////////////////////////////////////////////////////////// diff --git a/tools/intellij-plugin/resources/META-INF/plugin.xml b/tools/intellij-plugin/resources/META-INF/plugin.xml index 3dbd79325..4e7a1187d 100644 --- a/tools/intellij-plugin/resources/META-INF/plugin.xml +++ b/tools/intellij-plugin/resources/META-INF/plugin.xml @@ -32,6 +32,12 @@ + +