From 7152a9e7ab0da2abfe3a65db4e792969e9b020d9 Mon Sep 17 00:00:00 2001 From: Abraham Makovetsky Date: Mon, 6 Jan 2020 12:03:42 +0200 Subject: [PATCH] fixed the plugin for intellij 2019.3+ --- build.gradle | 4 ++-- build.sh | 2 +- gradle.properties | 2 +- product-matrix.json | 9 +++++++++ .../eu/long1/flutter/i18n/arb/ArbFileTypeFactory.kt | 4 ++-- .../flutter/i18n/inspections/CreateStringInspector.kt | 4 ++-- .../i18n/inspections/FlutterI18nInspectionProvider.kt | 8 ++++---- .../long1/flutter/i18n/inspections/JsonKeysInspector.kt | 4 ++-- src/main/resources/META-INF/plugin.xml | 2 +- 9 files changed, 24 insertions(+), 15 deletions(-) diff --git a/build.gradle b/build.gradle index 10ac2fc..860c7d9 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ plugins { - id 'org.jetbrains.intellij' version '0.4.7' - id 'org.jetbrains.kotlin.jvm' version '1.3.21' + id 'org.jetbrains.intellij' version '0.4.15' + id 'org.jetbrains.kotlin.jvm' version '1.3.61' } def pluginVersionSuffix = ideaVersionPrefix != '' ? '-' + ideaVersionPrefix : '' diff --git a/build.sh b/build.sh index dbc0c68..cf0dba9 100644 --- a/build.sh +++ b/build.sh @@ -15,7 +15,7 @@ if [ "x$1" = "x" ]; then fi # Supported platform versions. -VERSIONS="181 182 183 191 192" +VERSIONS="181 182 183 191 192 193" # Requested version to build. PLUGIN_VERSION=$1 diff --git a/gradle.properties b/gradle.properties index 393ca6c..a2088da 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ kotlin.code.style=official pluginVersion=1.1.2 -ideaVersionPrefix=181 +ideaVersionPrefix=193 ideaVersion= diff --git a/product-matrix.json b/product-matrix.json index b065612..7d3cdf5 100644 --- a/product-matrix.json +++ b/product-matrix.json @@ -42,5 +42,14 @@ "flutterPluginVersion": "38.1.4", "sinceBuild": "192.0", "untilBuild": "192.*" + }, + + "193.5662.53": { + "comments": "2019.3", + "ideaVersion": "193.5662.53", + "dartPluginVersion": "193.5731", + "flutterPluginVersion": "42.1.4", + "sinceBuild": "193.0", + "untilBuild": "193.*" } } diff --git a/src/main/kotlin/eu/long1/flutter/i18n/arb/ArbFileTypeFactory.kt b/src/main/kotlin/eu/long1/flutter/i18n/arb/ArbFileTypeFactory.kt index 14aa829..af8bc7a 100644 --- a/src/main/kotlin/eu/long1/flutter/i18n/arb/ArbFileTypeFactory.kt +++ b/src/main/kotlin/eu/long1/flutter/i18n/arb/ArbFileTypeFactory.kt @@ -1,9 +1,9 @@ package eu.long1.flutter.i18n.arb -import com.intellij.json.JsonFileTypeFactory +import com.intellij.openapi.fileTypes.FileTypeFactory import com.intellij.openapi.fileTypes.FileTypeConsumer -class ArbFileTypeFactory : JsonFileTypeFactory() { +class ArbFileTypeFactory : FileTypeFactory() { override fun createFileTypes(consumer: FileTypeConsumer) = consumer.consume(ArbFileType, ArbFileType.defaultExtension) } \ No newline at end of file diff --git a/src/main/kotlin/eu/long1/flutter/i18n/inspections/CreateStringInspector.kt b/src/main/kotlin/eu/long1/flutter/i18n/inspections/CreateStringInspector.kt index cbe793b..44323fc 100644 --- a/src/main/kotlin/eu/long1/flutter/i18n/inspections/CreateStringInspector.kt +++ b/src/main/kotlin/eu/long1/flutter/i18n/inspections/CreateStringInspector.kt @@ -1,9 +1,9 @@ package eu.long1.flutter.i18n.inspections import com.intellij.codeInspection.InspectionManager +import com.intellij.codeInspection.LocalInspectionTool import com.intellij.codeInspection.ProblemDescriptor import com.intellij.codeInspection.ProblemHighlightType -import com.intellij.codeInspection.ex.BaseLocalInspectionTool import com.intellij.psi.PsiFile import com.intellij.psi.util.PsiTreeUtil import com.jetbrains.lang.dart.DartFileType @@ -11,7 +11,7 @@ import com.jetbrains.lang.dart.analyzer.DartAnalysisServerService import com.jetbrains.lang.dart.psi.DartReferenceExpression import eu.long1.flutter.i18n.inspections.quickfix.CreateStringResourceQuickFix -class CreateStringInspector : BaseLocalInspectionTool() { +class CreateStringInspector : LocalInspectionTool() { override fun checkFile(file: PsiFile, manager: InspectionManager, isOnTheFly: Boolean): Array? { if (file.fileType == DartFileType.INSTANCE) { val analysisService = DartAnalysisServerService.getInstance(file.project).getErrors(file.virtualFile) diff --git a/src/main/kotlin/eu/long1/flutter/i18n/inspections/FlutterI18nInspectionProvider.kt b/src/main/kotlin/eu/long1/flutter/i18n/inspections/FlutterI18nInspectionProvider.kt index fb03f96..062bd7f 100644 --- a/src/main/kotlin/eu/long1/flutter/i18n/inspections/FlutterI18nInspectionProvider.kt +++ b/src/main/kotlin/eu/long1/flutter/i18n/inspections/FlutterI18nInspectionProvider.kt @@ -1,10 +1,10 @@ package eu.long1.flutter.i18n.inspections import com.intellij.codeInspection.InspectionToolProvider +import com.intellij.codeInspection.LocalInspectionTool class FlutterI18nInspectionProvider : InspectionToolProvider { - override fun getInspectionClasses(): Array> = arrayOf( - CreateStringInspector::class.java, - JsonKeysInspector::class.java - ) + + override fun getInspectionClasses(): Array> = + arrayOf(JsonKeysInspector::class.java, CreateStringInspector::class.java) } \ No newline at end of file diff --git a/src/main/kotlin/eu/long1/flutter/i18n/inspections/JsonKeysInspector.kt b/src/main/kotlin/eu/long1/flutter/i18n/inspections/JsonKeysInspector.kt index b9aaf93..83aaa85 100644 --- a/src/main/kotlin/eu/long1/flutter/i18n/inspections/JsonKeysInspector.kt +++ b/src/main/kotlin/eu/long1/flutter/i18n/inspections/JsonKeysInspector.kt @@ -1,15 +1,15 @@ package eu.long1.flutter.i18n.inspections import com.intellij.codeInspection.InspectionManager +import com.intellij.codeInspection.LocalInspectionTool import com.intellij.codeInspection.ProblemDescriptor import com.intellij.codeInspection.ProblemHighlightType -import com.intellij.codeInspection.ex.BaseLocalInspectionTool import com.intellij.json.psi.JsonProperty import com.intellij.json.psi.JsonStringLiteral import com.intellij.psi.PsiFile import eu.long1.flutter.i18n.arb.ArbFileType -class JsonKeysInspector : BaseLocalInspectionTool() { +class JsonKeysInspector : LocalInspectionTool() { override fun checkFile(file: PsiFile, manager: InspectionManager, isOnTheFly: Boolean): Array? { if (!isOnTheFly) return null diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index 9b3e7a1..557aacc 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -95,7 +95,7 @@ - +