Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed the plugin for intellij 2019.3+ #134

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -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 : ''
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
kotlin.code.style=official
pluginVersion=1.1.2
ideaVersionPrefix=181
ideaVersionPrefix=193
ideaVersion=
9 changes: 9 additions & 0 deletions product-matrix.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.*"
}
}
Original file line number Diff line number Diff line change
@@ -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)
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
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
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<ProblemDescriptor>? {
if (file.fileType == DartFileType.INSTANCE) {
val analysisService = DartAnalysisServerService.getInstance(file.project).getErrors(file.virtualFile)
Expand Down
Original file line number Diff line number Diff line change
@@ -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<Class<*>> = arrayOf(
CreateStringInspector::class.java,
JsonKeysInspector::class.java
)

override fun getInspectionClasses(): Array<Class<out LocalInspectionTool>> =
arrayOf(JsonKeysInspector::class.java, CreateStringInspector::class.java)
}
Original file line number Diff line number Diff line change
@@ -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<ProblemDescriptor>? {
if (!isOnTheFly) return null
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
</change-notes>


<idea-version since-build="181" until-build="181.*"/>
<idea-version since-build="193" until-build="193.*"/>

<extensions defaultExtensionNs="com.intellij">
<postStartupActivity implementation="eu.long1.flutter.i18n.workers.Initializer"/>
Expand Down