diff --git a/build.gradle.kts b/build.gradle.kts
index f4adef72..f48e94c4 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -4,7 +4,7 @@ plugins {
id("org.jetbrains.kotlin.plugin.serialization") version "1.8.21"
}
group = "shop.itbug"
-version = "3.5.0.eap"
+version = "3.5.0.as"
repositories {
mavenCentral()
google()
@@ -17,15 +17,15 @@ repositories {
intellij {
- version.set("LATEST-EAP-SNAPSHOT")
- type.set("IC")
+ version.set("2022.2.1.18")
+ type.set("AI")
plugins.set(
listOf(
"yaml",
- "Dart:232.8660.129",
- "io.flutter:74.0.5",
+ "Dart:222.4582",
+ "io.flutter:74.0.2",
"org.intellij.plugins.markdown",
- "terminal", "java", "maven"
+ "terminal"
)
)
}
@@ -77,20 +77,23 @@ tasks {
patchPluginXml {
sinceBuild.set("222")
+ untilBuild.set("222.*")
changeNotes.set(
"""
-
3.5.0.eap (2023-07-25)
+
3.5.0.as (2023-07-25)
- 添加freezed快捷操作菜单
- 新增韩语,日语,繁体等多国语言
- 其他若干细节优化
+
- freezedショートカットメニューの追加
- 韓国語、日本語、繁体字など多言語を追加
- その他の詳細の最適化
+
- freezed 바로 가기 메뉴 추가
- 한국어, 일본어, 번체 등 다국어 추가
diff --git a/src/main/kotlin/shop/itbug/fluttercheckversionx/activity/FlutterProjectOpenActivity.kt b/src/main/kotlin/shop/itbug/fluttercheckversionx/activity/FlutterProjectOpenActivity.kt
index bb91b0f8..f3c995f7 100644
--- a/src/main/kotlin/shop/itbug/fluttercheckversionx/activity/FlutterProjectOpenActivity.kt
+++ b/src/main/kotlin/shop/itbug/fluttercheckversionx/activity/FlutterProjectOpenActivity.kt
@@ -11,26 +11,26 @@ import com.intellij.openapi.progress.ProgressIndicator
import com.intellij.openapi.progress.ProgressManager
import com.intellij.openapi.progress.Task
import com.intellij.openapi.project.Project
-import com.intellij.openapi.startup.ProjectActivity
+import com.intellij.openapi.startup.StartupActivity
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.openapi.vfs.VirtualFileManager
import com.intellij.openapi.vfs.newvfs.BulkFileListener
import com.intellij.openapi.vfs.newvfs.events.VFileEvent
import io.flutter.sdk.FlutterSdk
-import org.jetbrains.plugins.terminal.TerminalToolWindowManager
import shop.itbug.fluttercheckversionx.config.GenerateAssetsClassConfig
import shop.itbug.fluttercheckversionx.icons.MyIcons
import shop.itbug.fluttercheckversionx.services.FlutterService
import shop.itbug.fluttercheckversionx.services.Release
import shop.itbug.fluttercheckversionx.util.CacheUtil
import shop.itbug.fluttercheckversionx.util.MyDartPsiElementUtil
+import shop.itbug.fluttercheckversionx.util.RunUtil
/**
* 梁典典
* 当项目打开的时候,会执行这个类的runActivity方法
* 在这里启动一个子线程去检测项目中的pubspec.yaml文件.并执行检测新版本
*/
-class FlutterProjectOpenActivity : ProjectActivity, Disposable {
+class FlutterProjectOpenActivity : StartupActivity, Disposable {
/**
* 项目在idea中打开时执行函数
@@ -85,10 +85,7 @@ class FlutterProjectOpenActivity : ProjectActivity, Disposable {
}
- override suspend fun execute(project: Project) {
- run(project)
- checkFlutterLastVersion(project)
- }
+
/**
@@ -128,22 +125,24 @@ class FlutterProjectOpenActivity : ProjectActivity, Disposable {
- createNotification.addAction(object : AnAction("Upgrade") {
- override fun actionPerformed(p0: AnActionEvent) {
- TerminalToolWindowManager.getInstance(project).createLocalShellWidget(project.basePath,"flutter upgrade").executeCommand("flutter upgrade")
- createNotification.hideBalloon()
- }
+ createNotification.addAction(
+ object : AnAction("Upgrade") {
+ override fun actionPerformed(p0: AnActionEvent) {
+ RunUtil.runCommand(project,"flutter upgrade","flutter upgrade")
+ createNotification.hideBalloon()
+ }
- override fun update(e: AnActionEvent) {
- e.presentation.icon = MyIcons.flutter
- super.update(e)
- }
+ override fun update(e: AnActionEvent) {
+ e.presentation.icon = MyIcons.flutter
+ super.update(e)
+ }
- override fun getActionUpdateThread(): ActionUpdateThread {
- return ActionUpdateThread.BGT
- }
+ override fun getActionUpdateThread(): ActionUpdateThread {
+ return ActionUpdateThread.BGT
+ }
- },)
+ },
+ )
createNotification.addAction(object : AnAction("Cancel"){
override fun actionPerformed(p0: AnActionEvent) {
createNotification.hideBalloon()
@@ -152,4 +151,9 @@ class FlutterProjectOpenActivity : ProjectActivity, Disposable {
})
createNotification.notify(project)
}
+
+ override fun runActivity(project: Project) {
+ run(project)
+ checkFlutterLastVersion(project)
+ }
}
\ No newline at end of file
diff --git a/src/main/kotlin/shop/itbug/fluttercheckversionx/dsl/SettingPanel.kt b/src/main/kotlin/shop/itbug/fluttercheckversionx/dsl/SettingPanel.kt
index 563da8ec..915dfdeb 100644
--- a/src/main/kotlin/shop/itbug/fluttercheckversionx/dsl/SettingPanel.kt
+++ b/src/main/kotlin/shop/itbug/fluttercheckversionx/dsl/SettingPanel.kt
@@ -50,6 +50,9 @@ fun settingPanel(
override fun afterChange(listener: (String) -> Unit) {
}
+ override fun afterChange(listener: (String) -> Unit, parentDisposable: Disposable) {
+ }
+
override fun get(): String {
return model.lang
}
diff --git a/src/main/kotlin/shop/itbug/fluttercheckversionx/inlay/freezed/FreezedInlay.kt b/src/main/kotlin/shop/itbug/fluttercheckversionx/inlay/freezed/FreezedInlay.kt
index 751bf82d..b2164aef 100644
--- a/src/main/kotlin/shop/itbug/fluttercheckversionx/inlay/freezed/FreezedInlay.kt
+++ b/src/main/kotlin/shop/itbug/fluttercheckversionx/inlay/freezed/FreezedInlay.kt
@@ -15,11 +15,11 @@ import com.intellij.ui.awt.RelativePoint
import com.intellij.ui.dsl.builder.panel
import com.jetbrains.lang.dart.psi.impl.DartClassDefinitionImpl
import com.jetbrains.lang.dart.psi.impl.DartFactoryConstructorDeclarationImpl
-import org.jetbrains.plugins.terminal.TerminalToolWindowManager
import shop.itbug.fluttercheckversionx.common.MyAction
import shop.itbug.fluttercheckversionx.dialog.JsonToFreezedInputDialog
import shop.itbug.fluttercheckversionx.inlay.HintsInlayPresentationFactory
import shop.itbug.fluttercheckversionx.manager.DartClassManager
+import shop.itbug.fluttercheckversionx.util.RunUtil
import shop.itbug.fluttercheckversionx.util.dart.DartClassUtil
import shop.itbug.fluttercheckversionx.util.exByModifyAllPsiElementText
import shop.itbug.fluttercheckversionx.util.toast
@@ -179,9 +179,7 @@ class FreezedInlayCollector(val edit: Editor) : FactoryInlayHintsCollector(edit)
})
add(object : MyAction({ "Run build runner" }) {
override fun actionPerformed(e: AnActionEvent) {
- TerminalToolWindowManager.getInstance(psiElement.project)
- .createLocalShellWidget(psiElement.project.basePath, "FlutterCheckVersionX")
- .executeCommand("flutter pub run build_runner build")
+ RunUtil.runCommand(psiElement.project,"FlutterCheckVersionX","flutter pub run build_runner build")
}
})
diff --git a/src/main/kotlin/shop/itbug/fluttercheckversionx/services/MyUserBarFactory.kt b/src/main/kotlin/shop/itbug/fluttercheckversionx/services/MyUserBarFactory.kt
index 16d25c79..eafba5d4 100644
--- a/src/main/kotlin/shop/itbug/fluttercheckversionx/services/MyUserBarFactory.kt
+++ b/src/main/kotlin/shop/itbug/fluttercheckversionx/services/MyUserBarFactory.kt
@@ -10,13 +10,13 @@ import com.intellij.openapi.wm.StatusBarWidget
import com.intellij.openapi.wm.StatusBarWidgetFactory
import com.intellij.ui.awt.RelativePoint
import com.intellij.ui.components.JBLabel
-import org.jetbrains.plugins.terminal.TerminalToolWindowManager
import shop.itbug.fluttercheckversionx.constance.discordUrl
import shop.itbug.fluttercheckversionx.dialog.JsonToFreezedInputDialog
import shop.itbug.fluttercheckversionx.dialog.SearchDialog
import shop.itbug.fluttercheckversionx.i18n.PluginBundle
import shop.itbug.fluttercheckversionx.icons.MyIcons
import shop.itbug.fluttercheckversionx.services.PluginActions.*
+import shop.itbug.fluttercheckversionx.util.RunUtil
import java.awt.Point
import java.awt.event.MouseAdapter
import java.awt.event.MouseEvent
@@ -115,7 +115,7 @@ class MyUserAccountBar(var project: Project) : CustomStatusBarWidget {
}
private fun createPop(): JBPopup {
- return JBPopupFactory.getInstance().createPopupChooserBuilder(values().asList())
+ return JBPopupFactory.getInstance().createPopupChooserBuilder(entries)
.setItemChosenCallback { doActions(it) }
.setRenderer { _, value, _, _, _ ->
return@setRenderer JBLabel(value.title).apply {
@@ -154,8 +154,7 @@ class MyUserAccountBar(var project: Project) : CustomStatusBarWidget {
}
private fun runCommand(code: String) {
- TerminalToolWindowManager.getInstance(project).createLocalShellWidget(project.basePath, "FlutterCheckVersionX")
- .executeCommand(code)
+ RunUtil.runCommand(project,"FlutterCheckVersionX",code)
}
}
\ No newline at end of file
diff --git a/src/main/kotlin/shop/itbug/fluttercheckversionx/util/RunUtil.kt b/src/main/kotlin/shop/itbug/fluttercheckversionx/util/RunUtil.kt
new file mode 100644
index 00000000..a9646648
--- /dev/null
+++ b/src/main/kotlin/shop/itbug/fluttercheckversionx/util/RunUtil.kt
@@ -0,0 +1,11 @@
+package shop.itbug.fluttercheckversionx.util
+
+import com.intellij.openapi.project.Project
+import org.jetbrains.plugins.terminal.TerminalView
+
+object RunUtil {
+
+ fun runCommand(project: Project,title: String,command: String){
+ TerminalView.getInstance(project).createLocalShellWidget(project.basePath,title).executeCommand(command)
+ }
+}
\ No newline at end of file
diff --git a/src/main/kotlin/shop/itbug/fluttercheckversionx/util/Util.kt b/src/main/kotlin/shop/itbug/fluttercheckversionx/util/Util.kt
index 285507f8..c7584adb 100644
--- a/src/main/kotlin/shop/itbug/fluttercheckversionx/util/Util.kt
+++ b/src/main/kotlin/shop/itbug/fluttercheckversionx/util/Util.kt
@@ -59,7 +59,7 @@ fun PsiElement.runWriteCommandAction(runnable: Runnable) {
* @param findText 要查找的文本
*/
fun PsiFile.findPsiElementByText(findText: String) : PsiElement? {
- val c = MyPsiElementUtil.findAllMatchingElements(this){ text: String, psiElement: PsiElement ->
+ val c = MyPsiElementUtil.findAllMatchingElements(this){ text: String, _: PsiElement ->
return@findAllMatchingElements findText == text
}
return if(c.isNotEmpty()) c.first() else null
diff --git a/src/main/kotlin/shop/itbug/fluttercheckversionx/widget/EditorTextPanel.kt b/src/main/kotlin/shop/itbug/fluttercheckversionx/widget/EditorTextPanel.kt
index a1cc6b62..c3af3dcf 100644
--- a/src/main/kotlin/shop/itbug/fluttercheckversionx/widget/EditorTextPanel.kt
+++ b/src/main/kotlin/shop/itbug/fluttercheckversionx/widget/EditorTextPanel.kt
@@ -482,11 +482,11 @@ open class EditorTextPanel @JvmOverloads constructor(
CellRendererPane::class.java as Class,
this as Component
) != null && (StartupUiUtil
- .isUnderDarcula || UIUtil.isUnderIntelliJLaF())
+ .isUnderDarcula() || UIUtil.isUnderIntelliJLaF())
) {
return parent.background
}
- if (StartupUiUtil.isUnderDarcula) return UIUtil.getTextFieldBackground()
+ if (StartupUiUtil.isUnderDarcula()) return UIUtil.getTextFieldBackground()
return if (enabled) colorsScheme.defaultBackground else UIUtil.getInactiveTextFieldBackgroundColor()
}
@@ -533,8 +533,8 @@ open class EditorTextPanel @JvmOverloads constructor(
val size: Dimension = JBUI.size(1, 10)
if (myEditor != null) {
size.height = myEditor!!.lineHeight
- if (UIUtil.isUnderDefaultMacTheme() || StartupUiUtil.isUnderDarcula || UIUtil.isUnderIntelliJLaF()) {
- size.height = Math.max(size.height, scale(16))
+ if (UIUtil.isUnderDefaultMacTheme() || StartupUiUtil.isUnderDarcula() || UIUtil.isUnderIntelliJLaF()) {
+ size.height = size.height.coerceAtLeast(scale(16))
}
JBInsets.addTo(size, insets)
JBInsets.addTo(size, myEditor!!.insets)
diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml
index 22b59b56..e1915898 100644
--- a/src/main/resources/META-INF/plugin.xml
+++ b/src/main/resources/META-INF/plugin.xml
@@ -47,7 +47,6 @@
com.intellij.modules.lang
com.intellij.modules.lang
Dart
- org.jetbrains.idea.maven
io.flutter
org.jetbrains.kotlin
org.intellij.plugins.markdown