diff --git a/build.gradle.kts b/build.gradle.kts
index 5fa33db6..855bbbea 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -7,14 +7,16 @@ val ideaType: String by project
val pluginVersion: String by project
plugins {
- id("org.jetbrains.kotlin.jvm") version "1.9.0-RC"
+ id("org.jetbrains.kotlin.jvm") version "1.9.20"
id("org.jetbrains.intellij") version "1.16.0"
id("org.jetbrains.kotlin.plugin.serialization") version "1.9.20-RC"
+ idea
}
group = "shop.itbug"
version = pluginVersion
repositories {
+ mavenLocal()
mavenCentral()
google()
maven { url = uri("https://maven.pkg.jetbrains.space/public/p/compose/dev") }
@@ -57,7 +59,6 @@ dependencies {
implementation("com.alibaba.fastjson2:fastjson2:latest.release")
implementation("com.alibaba.fastjson2:fastjson2-kotlin:latest.release")
implementation("com.google.code.gson:gson:latest.release")
- implementation("org.xerial:sqlite-jdbc:latest.release")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:latest.release")
}
@@ -82,6 +83,20 @@ tasks {
untilBuild.set(untilBuildVersion)
changeNotes.set(
"""
+
+
3.8.4.Iguana
+
+ - Add the ability to set default values (freezed)
+
+
+
+
3.8.3
+
+ - Removed the context menu: "Covert to By Flutterx", which didn't help much
+ - Removed the "Favorite Plugins" tool window and its related functions.
+ - Fix the problem that "SP" can not be displayed
+
+
3.8.0
diff --git a/gradle.properties b/gradle.properties
index 6eab72c8..155c5d98 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,25 +1,32 @@
kotlin.stdlib.default.dependency=true
kotlin.incremental.useClasspathSnapshot=false
kotlin.experimental.tryK2=true
-pluginVersion=3.8.0
-# AS release version : https://plugins.jetbrains.com/docs/intellij/android-studio-releases-list.html
-dartVersion=223.8950
-flutterVersion=75.1.2
+kapt.use.k2=true
+pluginVersion=3.8.4.iguana
+#===============================> 223 AS release version : https://plugins.jetbrains.com/docs/intellij/android-studio-releases-list.html
+#===============================> 正式版本最新 Giraffe
+dartVersion=223.8977
+flutterVersion=76.3.2
sinceBuildVersion=223
untilBuildVersion=223.*
ideaVersion=2022.3.1.18
ideaType=AI
-# AS Canary version : https://plugins.jetbrains.com/docs/intellij/android-studio-releases-list.html
-#dartVersion=232.9559.10
-#flutterVersion=75.1.4
-#sinceBuildVersion=232
-#untilBuildVersion=232.*
-#ideaVersion=2023.2.1.7
+#===============================> 231 AS Hedgehog version : https://plugins.jetbrains.com/docs/intellij/android-studio-releases-list.html
+#dartVersion=231.9402
+#flutterVersion=76.3.3
+#sinceBuildVersion=231
+#untilBuildVersion=231.*
+#ideaVersion=2023.1.1.24
#ideaType=AI
-# idea eap
-#dartVersion=232.9559.10
-#flutterVersion=75.1.4
+#===============================> 232 AS iguana
+#dartVersion=232.10248
+#flutterVersion=76.3.4
#sinceBuildVersion=232
#untilBuildVersion=232.*
-#ideaVersion=LATEST-EAP-SNAPSHOT
-#ideaType=IC
\ No newline at end of file
+#ideaVersion=2023.2.1.11
+#ideaType=AI
+#===============================================
+systemProp.http.proxyHost=127.0.0.1
+systemProp.http.proxyPort=7890
+systemProp.https.proxyHost=127.0.0.1
+systemProp.https.proxyPort=7890
\ No newline at end of file
diff --git a/rebel.xml b/rebel.xml
new file mode 100644
index 00000000..ef89017f
--- /dev/null
+++ b/rebel.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+ dd_flutter_idea_plugin
+
+
diff --git a/settings.gradle.kts b/settings.gradle.kts
index 37a640c5..98fcca15 100644
--- a/settings.gradle.kts
+++ b/settings.gradle.kts
@@ -1,7 +1,7 @@
-rootProject.name = "FlutterCheckVersionX"
+rootProject.name = "FlutterX"
pluginManagement {
repositories {
- maven ("https://oss.sonatype.org/content/repositories/snapshots/")
+ maven("https://oss.sonatype.org/content/repositories/snapshots/")
gradlePluginPortal()
}
}
diff --git a/src/main/kotlin/note/jdbc/FlutterCollectService.kt b/src/main/kotlin/note/jdbc/FlutterCollectService.kt
deleted file mode 100644
index f780baff..00000000
--- a/src/main/kotlin/note/jdbc/FlutterCollectService.kt
+++ /dev/null
@@ -1,133 +0,0 @@
-package note.jdbc
-
-import cn.hutool.core.date.DateUtil
-import cn.hutool.db.Entity
-import cn.hutool.db.handler.EntityListHandler
-import cn.hutool.db.sql.SqlExecutor
-import shop.itbug.fluttercheckversionx.bus.FlutterPluginCollectEvent
-import shop.itbug.fluttercheckversionx.bus.FlutterPluginCollectEventType
-
-val defaultAddToCollect = listOf("cupertino_icons", "dd_js_util", "provider", "riverpod", "freezed")
-
-object FlutterCollectService {
-
-
- /**
- * 操作前先检查表是否存在,不存在先创建表再进行下一步操作
- */
- private fun check(call: () -> Unit) {
-
- ///表不存在,先创建
- if (!hasTable()) {
- val success = SqliteConnectManager.createFlutterPluginTable()
- if (success.not()) {
- println("警告⚠️: 表创建失败了.!请检查sql语句是否正确")
- return
- } else {
- ///设置默认收藏
- defaultAddToCollect.forEach { add(it) }
- }
- }
- call.invoke()
- }
-
- /**
- * 判断插件收藏表是否存在
- * true : 存在
- */
- private fun hasTable(): Boolean {
- return SqliteConnectManager.isExits(SqliteConnectManager.FlutterPluginTableName)
- }
-
- ///添加收藏
- fun add(pluginName: String): Boolean {
- var success = false
- check {
- success = try {
- val result = SqlExecutor.execute(
- SqliteConnectManager.connect, """
- insert into ${SqliteConnectManager.FlutterPluginTableName} (name,time) values ('${pluginName}','${DateUtil.now()}')
- """.trimIndent()
- )
- result >= 1
- } catch (e: Exception) {
- println("警告: ⚠️添加收藏失败:$e")
- false
- }
- }
- if(success){
- FlutterPluginCollectEvent.fire(FlutterPluginCollectEventType.add,pluginName)
- }
- return success
- }
-
-
- /**
- * 判断是否存在
- * @return true : 已存在, false: 不存在
- */
-
- fun exits(pluginName: String): Boolean {
- var success = false
- check {
- success = try {
-
- val sql = """
- select name from ${SqliteConnectManager.FlutterPluginTableName} where name=?;
- """.trimIndent()
- val query = SqlExecutor.query(SqliteConnectManager.connect, sql, EntityListHandler(), pluginName)
- query.isNotEmpty()
- } catch (e: Exception) {
- false
- }
- }
- return success
- }
-
-
- /**
- * 删除
- * @return true : 删除成功
- */
- fun remove(pluginName: String): Boolean {
- var success = false
- check {
- success = try {
-
- val sql = """
- delete from ${SqliteConnectManager.FlutterPluginTableName} where name='$pluginName'
- """.trimIndent()
- val execute = SqlExecutor.execute(SqliteConnectManager.connect, sql)
- println("删除结果:$execute")
- execute > 0
- } catch (e: Exception) {
- println("警告: ⚠️删除失败:$e")
- false
- }
- }
- if(success){
- FlutterPluginCollectEvent.fire(FlutterPluginCollectEventType.remove,pluginName)
- }
- return success
- }
-
-
- /**
- * 查询所有已经收藏的插件列表
- */
- fun selectAll(): List {
-
- var list = emptyList()
-
- check {
- val sql = """
- select * from ${SqliteConnectManager.FlutterPluginTableName}
- """.trimIndent()
- val query = SqlExecutor.query(SqliteConnectManager.connect, sql, EntityListHandler())
- list = query.toList()
- }
- return list
-
- }
-
-}
\ No newline at end of file
diff --git a/src/main/kotlin/note/jdbc/SqliteConnect.kt b/src/main/kotlin/note/jdbc/SqliteConnect.kt
deleted file mode 100644
index 62aface3..00000000
--- a/src/main/kotlin/note/jdbc/SqliteConnect.kt
+++ /dev/null
@@ -1,92 +0,0 @@
-package note.jdbc
-
-import cn.hutool.db.handler.EntityListHandler
-import cn.hutool.db.sql.SqlExecutor
-import shop.itbug.fluttercheckversionx.util.Util
-import java.io.File
-import java.sql.Connection
-import java.sql.DriverManager
-import java.sql.SQLException
-
-object SqliteConnectManager {
-
- lateinit var connect: Connection
- const val FlutterPluginTableName = "FlutterPluginsCollect"
-
-
- init {
- initConnect()
- }
-
-
- /**
- * 创建表
- */
- fun createFlutterPluginTable() : Boolean {
- try{
- if (!isExits(FlutterPluginTableName)) {
- val createTableSql = """
- create table $FlutterPluginTableName(
- id INTEGER PRIMARY KEY AUTOINCREMENT,
- name varchat(64) NOT NULL,
- time varchat(64) NOT NULL,
- icon varchat(64) DEFAULT '/icons/collect.svg',
- type varchat(64) DEFAULT '',
- ext varchat(64) DEFAULT '',
- ext2 varchat(64) DEFAULT ''
- );
- """.trimIndent()
- SqlExecutor.execute(connect, createTableSql)
- println("flutter插件表创建成功")
- return true
- }
- }catch (e: Exception){
- return false
- }
- return false
-
- }
-
- /**
- * 初始化连接jdbc
- */
- private fun initConnect() {
- try {
- val initDbName = "FlutterCheckVersionXNote.db"
- val homePath = Util.userHomePath
- val filePath = homePath + File.separator + initDbName
- val file = File(filePath)
- if (!file.exists()) {
- val isCreate = file.createNewFile()
- if (isCreate) {
- println("创建成功")
- }
- }
- Class.forName("org.sqlite.JDBC")
- connect = DriverManager.getConnection("jdbc:sqlite:$filePath")
- } catch (e: SQLException) {
- println("连接sql失败:$e")
- }
-
- }
-
- /**
- *
- * 检测表是否已经存在
- *
- * @return true -> 表已经存在
- */
- fun isExits(tableName: String): Boolean {
- try {
- val sql = """
- SELECT name FROM sqlite_master WHERE type='table' AND name=?;
- """.trimIndent()
- val result = SqlExecutor.query(connect, sql, EntityListHandler(), tableName)
- return result.isNotEmpty()
- } catch (e: Exception) {
- println("检测表失败")
- e.printStackTrace()
- }
- return false
- }
-}
\ No newline at end of file
diff --git a/src/main/kotlin/note/setting/InitFlutterPluginSettingDialog.kt b/src/main/kotlin/note/setting/InitFlutterPluginSettingDialog.kt
deleted file mode 100644
index ebcd00ff..00000000
--- a/src/main/kotlin/note/setting/InitFlutterPluginSettingDialog.kt
+++ /dev/null
@@ -1,31 +0,0 @@
-package note.setting
-
-import com.intellij.execution.filters.TextConsoleBuilderFactory
-import com.intellij.execution.ui.ConsoleViewContentType
-import com.intellij.openapi.project.Project
-import com.intellij.ui.dsl.builder.panel
-import note.jdbc.SqliteConnectManager
-import shop.itbug.fluttercheckversionx.common.MyDialogWrapper
-import javax.swing.JComponent
-
-
-///设置flutter plugin 收藏面板
-class InitFlutterPluginSettingDialog( override val project: Project) : MyDialogWrapper(project) {
-
- init {
- super.init()
- title = "插件收藏"
-
- }
-
- override fun createCenterPanel(): JComponent {
- return panel {
- row ("状态") {
- button("初始化表") {
- SqliteConnectManager.createFlutterPluginTable()
- }
- }
- }
- }
-
-}
\ No newline at end of file
diff --git a/src/main/kotlin/shop/itbug/fluttercheckversionx/actions/FunctionParamsToFreezed.kt b/src/main/kotlin/shop/itbug/fluttercheckversionx/actions/FunctionParamsToFreezed.kt
index 7b69ad39..10299405 100644
--- a/src/main/kotlin/shop/itbug/fluttercheckversionx/actions/FunctionParamsToFreezed.kt
+++ b/src/main/kotlin/shop/itbug/fluttercheckversionx/actions/FunctionParamsToFreezed.kt
@@ -6,6 +6,7 @@ import com.intellij.psi.util.PsiTreeUtil
import com.jetbrains.lang.dart.psi.impl.*
import shop.itbug.fluttercheckversionx.common.MyAction
import shop.itbug.fluttercheckversionx.dialog.FreezedCovertDialog
+import shop.itbug.fluttercheckversionx.i18n.PluginBundle
import shop.itbug.fluttercheckversionx.model.DartClassProperty
import shop.itbug.fluttercheckversionx.model.FreezedCovertModel
import shop.itbug.fluttercheckversionx.util.firstChatToUpper
@@ -69,6 +70,7 @@ class FunctionParamsToFreezed : MyAction() {
override fun update(e: AnActionEvent) {
e.presentation.isEnabled = e.selectTextIsDartMethodElement()
+ e.presentation.text = PluginBundle.get("editor.freezed.fun.param.to.class")
super.update(e)
}
diff --git a/src/main/kotlin/shop/itbug/fluttercheckversionx/actions/FxModelToFreezedModel.kt b/src/main/kotlin/shop/itbug/fluttercheckversionx/actions/FxModelToFreezedModel.kt
index 4cda9303..cdc5a467 100644
--- a/src/main/kotlin/shop/itbug/fluttercheckversionx/actions/FxModelToFreezedModel.kt
+++ b/src/main/kotlin/shop/itbug/fluttercheckversionx/actions/FxModelToFreezedModel.kt
@@ -4,6 +4,7 @@ import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnActionEvent
import shop.itbug.fluttercheckversionx.common.MyAction
import shop.itbug.fluttercheckversionx.dialog.FreezedCovertDialog
+import shop.itbug.fluttercheckversionx.i18n.PluginBundle
import shop.itbug.fluttercheckversionx.services.impl.ModelToFreezedModelServiceImpl
import shop.itbug.fluttercheckversionx.util.DartPsiElementUtil
import shop.itbug.fluttercheckversionx.util.getDartClassDefinition
@@ -20,7 +21,11 @@ class FxModelToFreezedModel : MyAction() {
}
override fun update(e: AnActionEvent) {
- e.presentation.isEnabled = e.getDartClassDefinition() != null && DartPsiElementUtil.getClassProperties(e.getDartClassDefinition()!!).isNotEmpty()
+ e.presentation.isEnabled =
+ e.getDartClassDefinition() != null && DartPsiElementUtil.getClassProperties(e.getDartClassDefinition()!!)
+ .isNotEmpty()
+
+ e.presentation.text = PluginBundle.get("class.to.object")
super.update(e)
}
diff --git a/src/main/kotlin/shop/itbug/fluttercheckversionx/actions/GenerateFunctionDocument.kt b/src/main/kotlin/shop/itbug/fluttercheckversionx/actions/GenerateFunctionDocument.kt
index b9962998..bf7dfecf 100644
--- a/src/main/kotlin/shop/itbug/fluttercheckversionx/actions/GenerateFunctionDocument.kt
+++ b/src/main/kotlin/shop/itbug/fluttercheckversionx/actions/GenerateFunctionDocument.kt
@@ -11,14 +11,23 @@ import com.intellij.psi.PsiFile
import com.intellij.psi.PsiFileFactory
import com.intellij.psi.codeStyle.CodeStyleManager
import com.intellij.psi.util.PsiTreeUtil
+import com.intellij.psi.util.prevLeaf
import com.jetbrains.lang.dart.DartLanguage
import com.jetbrains.lang.dart.psi.impl.DartComponentNameImpl
import com.jetbrains.lang.dart.psi.impl.DartFormalParameterListImpl
import com.jetbrains.lang.dart.psi.impl.DartNormalFormalParameterImpl
import shop.itbug.fluttercheckversionx.common.MyAction
+import shop.itbug.fluttercheckversionx.i18n.PluginBundle
///生成方法的函数文档操作
class GenerateFunctionDocument : MyAction() {
+
+
+ override fun update(e: AnActionEvent) {
+ e.presentation.text = PluginBundle.get("generate.fun.comment")
+ super.update(e)
+ }
+
override fun actionPerformed(e: AnActionEvent) {
val data = e.getData(CommonDataKeys.PSI_ELEMENT)
if (data is DartComponentNameImpl) {
@@ -30,13 +39,14 @@ class GenerateFunctionDocument : MyAction() {
val sb = StringBuilder()
sb.append("///\n")
psis.forEach {
+
val name = it.firstChild.lastChild.text
- sb.append("/// [$name] - \n")
+ sb.append("/// [$name] - ${if (psis.last() == it) "" else "\n"}")
}.takeIf { psis.isNotEmpty() }
e.project?.let {
val psiFile = e.getData(CommonDataKeys.PSI_FILE)
val document = e.getData(CommonDataKeys.EDITOR)?.document
- createDartDocPsiElement(it, data.parent, sb.toString(), psiFile, document)
+ createDartDocPsiElement(it, data, sb.toString(), psiFile, document)
}
}
}
@@ -49,10 +59,9 @@ class GenerateFunctionDocument : MyAction() {
file: PsiFile?,
doc: Document?
) {
- println(text)
val psiFile = PsiFileFactory.getInstance(project).createFileFromText(DartLanguage.INSTANCE, text)
WriteCommandAction.runWriteCommandAction(project) {
- element.addBefore(psiFile.navigationElement, element.originalElement)
+ element.addBefore(psiFile, element.parent.prevLeaf()?.nextSibling)
doc?.let {
PsiDocumentManager.getInstance(project).doPostponedOperationsAndUnblockDocument(doc)
file?.let {
diff --git a/src/main/kotlin/shop/itbug/fluttercheckversionx/actions/context/CovertToActionsGroup.kt b/src/main/kotlin/shop/itbug/fluttercheckversionx/actions/context/CovertToActionsGroup.kt
deleted file mode 100644
index f6a2bfb8..00000000
--- a/src/main/kotlin/shop/itbug/fluttercheckversionx/actions/context/CovertToActionsGroup.kt
+++ /dev/null
@@ -1,9 +0,0 @@
-package shop.itbug.fluttercheckversionx.actions.context
-
-import com.intellij.openapi.actionSystem.AnAction
-import com.intellij.openapi.actionSystem.AnActionEvent
-
-class CovertToActionsGroup : AnAction() {
- override fun actionPerformed(e: AnActionEvent) {
- }
-}
diff --git a/src/main/kotlin/shop/itbug/fluttercheckversionx/actions/freezed/FreezedClassToSimpleClass.kt b/src/main/kotlin/shop/itbug/fluttercheckversionx/actions/freezed/FreezedClassToSimpleClass.kt
new file mode 100644
index 00000000..c13473c8
--- /dev/null
+++ b/src/main/kotlin/shop/itbug/fluttercheckversionx/actions/freezed/FreezedClassToSimpleClass.kt
@@ -0,0 +1,109 @@
+package shop.itbug.fluttercheckversionx.actions.freezed
+
+import com.intellij.openapi.actionSystem.ActionUpdateThread
+import com.intellij.openapi.actionSystem.AnAction
+import com.intellij.openapi.actionSystem.AnActionEvent
+import com.intellij.openapi.project.Project
+import com.intellij.ui.dsl.builder.bindText
+import com.intellij.ui.dsl.builder.panel
+import com.intellij.util.ui.components.BorderLayoutPanel
+import com.jetbrains.lang.dart.psi.impl.DartFactoryConstructorDeclarationImpl
+import shop.itbug.fluttercheckversionx.common.MyDialogWrapper
+import shop.itbug.fluttercheckversionx.common.scroll
+import shop.itbug.fluttercheckversionx.manager.DartDefaultFormalNamedParameterActionManager
+import shop.itbug.fluttercheckversionx.manager.DartFactoryConstructorDeclarationImplManager
+import shop.itbug.fluttercheckversionx.widget.DartEditorTextPanel
+import java.awt.Dimension
+import javax.swing.JComponent
+
+
+private data class SettingModel(var className: String = "", var generateClass: String = "")
+
+/**
+ * freezed 转成 简单的 class
+ */
+class FreezedClassToSimpleClass : AnAction() {
+
+
+ override fun actionPerformed(e: AnActionEvent) {
+ val factoryPsiElement = e.getFactoryPsiElement()!!
+ e.project?.let {
+ FreezedClassToSimpleClassDialog(it, factoryPsiElement).show()
+ }
+ }
+
+ override fun update(e: AnActionEvent) {
+ e.presentation.isEnabled = e.getFactoryPsiElement() != null
+ super.update(e)
+ }
+
+ override fun getActionUpdateThread(): ActionUpdateThread {
+ return ActionUpdateThread.BGT
+ }
+}
+
+
+///生成对于的 class类
+fun List.generateClassString(className: String): String {
+ return """
+ class $className {
+ ${
+ joinToString(
+ separator = ";\n\t", postfix = ";"
+ ) { "final ${it.typeString}${if (it.isRequired) "" else "?"} ${it.name}" }
+ }
+ Test({${joinToString(separator = ",") { if (it.isRequired) "required this.${it.name}" else "this.${it.name}" }}});
+ }
+ """.trimIndent()
+}
+
+///转换的弹窗
+private class FreezedClassToSimpleClassDialog(project: Project, val psiElement: DartFactoryConstructorDeclarationImpl) :
+ MyDialogWrapper(project) {
+
+ private val editor = DartEditorTextPanel(project)
+ private val manager: DartFactoryConstructorDeclarationImplManager
+ get() = DartFactoryConstructorDeclarationImplManager(psiElement)
+
+ private val args: List =
+ manager.getPropertiesWrapper
+ private val setting = SettingModel(
+ className = manager.getClassName ?: "", generateClass = args.generateClassString(manager.getClassName ?: "Root")
+ )
+
+
+ init {
+
+ super.init()
+ super.setTitle("freezed to simple class")
+ println("参数:$args")
+ editor.text = setting.generateClass
+ editor.reformat()
+ }
+
+ override fun createCenterPanel(): JComponent {
+ return Layout()
+ }
+
+
+ override fun getPreferredSize(): Dimension {
+ return Dimension(500, super.getPreferredSize().height)
+ }
+
+
+ ///布局
+ private inner class Layout : BorderLayoutPanel() {
+
+
+
+ init {
+ addToCenter(editor.scroll())
+ addToLeft(panel {
+ row {
+ textField().bindText(setting::className)
+ }
+ })
+ }
+ }
+}
+
diff --git a/src/main/kotlin/shop/itbug/fluttercheckversionx/actions/freezed/FreezedFactoryAddDefaultValue.kt b/src/main/kotlin/shop/itbug/fluttercheckversionx/actions/freezed/FreezedFactoryAddDefaultValue.kt
new file mode 100644
index 00000000..09755f16
--- /dev/null
+++ b/src/main/kotlin/shop/itbug/fluttercheckversionx/actions/freezed/FreezedFactoryAddDefaultValue.kt
@@ -0,0 +1,38 @@
+package shop.itbug.fluttercheckversionx.actions.freezed
+
+import com.intellij.openapi.actionSystem.ActionUpdateThread
+import com.intellij.openapi.actionSystem.AnAction
+import com.intellij.openapi.actionSystem.AnActionEvent
+import com.intellij.openapi.actionSystem.CommonDataKeys
+import com.jetbrains.lang.dart.psi.impl.DartFactoryConstructorDeclarationImpl
+import shop.itbug.fluttercheckversionx.i18n.PluginBundle
+import shop.itbug.fluttercheckversionx.manager.DartFactoryConstructorDeclarationImplManager
+
+
+fun AnActionEvent.getFactoryPsiElement(): DartFactoryConstructorDeclarationImpl? {
+ val psiElement = getData(CommonDataKeys.PSI_ELEMENT)
+ val isFactoryName = psiElement?.parent is DartFactoryConstructorDeclarationImpl
+ return if (isFactoryName) psiElement?.parent as DartFactoryConstructorDeclarationImpl else null
+}
+
+
+///给属性设置默认值
+class FreezedFactoryAddDefaultValue : AnAction() {
+
+
+ override fun actionPerformed(e: AnActionEvent) {
+ val manager = DartFactoryConstructorDeclarationImplManager(e.getFactoryPsiElement()!!)
+ manager.setAllPropertiesToDefaultValue()
+ }
+
+
+ override fun update(e: AnActionEvent) {
+ e.presentation.isEnabled = e.getFactoryPsiElement() != null
+ e.presentation.text = PluginBundle.get("set.as.freezed.default.value")
+ super.update(e)
+ }
+
+ override fun getActionUpdateThread(): ActionUpdateThread {
+ return ActionUpdateThread.BGT
+ }
+}
diff --git a/src/main/kotlin/shop/itbug/fluttercheckversionx/cache/DartPluginIgnoreConfig.kt b/src/main/kotlin/shop/itbug/fluttercheckversionx/cache/DartPluginIgnoreConfig.kt
index 597aca67..92470060 100644
--- a/src/main/kotlin/shop/itbug/fluttercheckversionx/cache/DartPluginIgnoreConfig.kt
+++ b/src/main/kotlin/shop/itbug/fluttercheckversionx/cache/DartPluginIgnoreConfig.kt
@@ -1,16 +1,18 @@
package shop.itbug.fluttercheckversionx.cache
import com.intellij.openapi.components.PersistentStateComponent
+import com.intellij.openapi.components.Service
import com.intellij.openapi.components.State
import com.intellij.openapi.components.Storage
import com.intellij.openapi.project.Project
import com.intellij.util.xmlb.XmlSerializerUtil
@State(name = "DartPluginIgnoreConfig", storages = [Storage("DartPluginIgnoreConfig.xml")])
-class DartPluginIgnoreConfig private constructor() : PersistentStateComponent{
+@Service(Service.Level.PROJECT)
+class DartPluginIgnoreConfig private constructor() : PersistentStateComponent {
- var names = mutableListOf() //忽略的插件名字
+ var names = mutableListOf() //忽略的插件名字
override fun getState(): DartPluginIgnoreConfig {
return this
@@ -22,10 +24,10 @@ class DartPluginIgnoreConfig private constructor() : PersistentStateComponent {
return JSON.isValid(it)
diff --git a/src/main/kotlin/shop/itbug/fluttercheckversionx/inlay/dartfile/AddPartInlay.kt b/src/main/kotlin/shop/itbug/fluttercheckversionx/inlay/dartfile/AddPartInlay.kt
new file mode 100644
index 00000000..b6027b4c
--- /dev/null
+++ b/src/main/kotlin/shop/itbug/fluttercheckversionx/inlay/dartfile/AddPartInlay.kt
@@ -0,0 +1,137 @@
+package shop.itbug.fluttercheckversionx.inlay.dartfile
+
+import com.intellij.codeInsight.hints.*
+import com.intellij.openapi.command.WriteCommandAction
+import com.intellij.openapi.editor.Editor
+import com.intellij.openapi.project.Project
+import com.intellij.psi.PsiElement
+import com.intellij.psi.PsiFile
+import com.intellij.psi.PsiManager
+import com.intellij.psi.util.PsiTreeUtil
+import com.intellij.refactoring.suggested.endOffset
+import com.intellij.ui.dsl.builder.bindSelected
+import com.intellij.ui.dsl.builder.panel
+import com.jetbrains.lang.dart.psi.impl.DartPartOfStatementImpl
+import com.jetbrains.lang.dart.psi.impl.DartPartStatementImpl
+import shop.itbug.fluttercheckversionx.inlay.HintsInlayPresentationFactory
+import shop.itbug.fluttercheckversionx.util.MyDartPsiElementUtil
+import java.nio.file.Paths
+import javax.swing.JComponent
+
+
+/// part 操作
+class AddPartInlay : InlayHintsProvider {
+
+
+ data class AddPartInlaySetting(var show: Boolean = true)
+
+ override val key: SettingsKey
+ get() = SettingsKey("part action inlay")
+ override val name: String
+ get() = "part action"
+ override val previewText: String
+ get() = """
+ part of "test.dart"
+ """.trimIndent()
+
+ override fun createSettings(): AddPartInlaySetting = AddPartInlaySetting()
+
+ override fun getCollectorFor(
+ file: PsiFile,
+ editor: Editor,
+ settings: AddPartInlaySetting,
+ sink: InlayHintsSink
+ ): InlayHintsCollector {
+ return object : FactoryInlayHintsCollector(editor) {
+ override fun collect(element: PsiElement, editor: Editor, sink: InlayHintsSink): Boolean {
+ val myFactory = HintsInlayPresentationFactory(factory)
+ if (element is DartPartOfStatementImpl) {
+
+
+ val files = element.libraryFiles
+ if (files.isNotEmpty()) {
+ val first = files.first()
+ val libFilePsi: PsiFile? = PsiManager.getInstance(element.project).findFile(first)
+ if (libFilePsi != null) {
+ val parts =
+ PsiTreeUtil.findChildrenOfAnyType(libFilePsi, DartPartStatementImpl::class.java)
+ if (parts.isNotEmpty()) {
+ val lastPart = parts.last() ///最后一个 part
+ val p1 = lastPart.containingFile.virtualFile.path
+ val p2 = element.containingFile.virtualFile.path
+ println("目标:${p1}")
+ println("当前:${p2}")
+ val rl = getRelativeOrFileName(p1, p2)
+ println("输出:$rl")
+ val createPartOf = createPartOf("$rl", project = element.project)
+
+ ///如果存在了就不要显示了
+ val findPart =
+ PsiTreeUtil.findChildrenOfAnyType(libFilePsi, DartPartStatementImpl::class.java)
+ .find { it.text == createPartOf?.text }
+ if (findPart == null) {
+ val inlayPresentation = myFactory.simpleText(
+ "FlutterX: inset part \"${rl}\" to library ${element.libraryName}",
+ null
+ ) { p1, p2 ->
+ createPartOf?.let {
+ WriteCommandAction.runWriteCommandAction(element.project) {
+ lastPart.addAfter(createPartOf, null)
+ }
+ }
+ }
+ sink.addInlineElement(element.endOffset, true, inlayPresentation, true)
+ }
+ }
+ }
+
+ }
+ }
+ return true
+ }
+
+ private fun createPartOf(s: String, project: Project): DartPartStatementImpl? {
+ return MyDartPsiElementUtil.createDartPart("part '$s';", project)
+ }
+ }
+ }
+
+ override fun createConfigurable(settings: AddPartInlaySetting): ImmediateConfigurable {
+ return object : ImmediateConfigurable {
+ override fun createComponent(listener: ChangeListener): JComponent {
+ return panel {
+ row("action") {
+ checkBox("enable").bindSelected(settings::show)
+ }
+ }
+ }
+
+ }
+ }
+}
+
+
+/**
+ *
+ * 获取相对路径
+ * ```kotlin
+ * fun main() {
+ * val basePath = "/lib/abc"
+ * val targetPath = "/lib/bac/file.txt"
+ *
+ * val relativePath = getRelativePath(basePath, targetPath)
+ * println(relativePath)
+ * }
+ * ```
+ */
+fun getRelativeOrFileName(path1: String, path2: String): String {
+ val basePath = Paths.get(path1).parent
+ val targetPath = Paths.get(path2)
+
+ if (basePath == targetPath.parent) {
+ return targetPath.fileName.toString()
+ } else {
+ val relativePath = basePath.relativize(targetPath).toString()
+ return if (relativePath.isNotEmpty()) relativePath else "./${targetPath.fileName}"
+ }
+}
\ No newline at end of file
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 e648aaee..58a558f8 100644
--- a/src/main/kotlin/shop/itbug/fluttercheckversionx/inlay/freezed/FreezedInlay.kt
+++ b/src/main/kotlin/shop/itbug/fluttercheckversionx/inlay/freezed/FreezedInlay.kt
@@ -30,7 +30,6 @@ import java.awt.event.MouseEvent
import javax.swing.JComponent
-
class FreezedInlay : InlayHintsProvider {
override val key: SettingsKey
get() = SettingsKey("freezed inlay")
@@ -174,7 +173,7 @@ class FreezedInlayCollector(val edit: Editor) : FactoryInlayHintsCollector(edit)
})
add(object : MyAction({ "Run build runner" }) {
override fun actionPerformed(e: AnActionEvent) {
- RunUtil.runCommand(psiElement.project,"FlutterCheckVersionX","flutter pub run build_runner build")
+ RunUtil.runCommand(psiElement.project, "FlutterX", "flutter pub run build_runner build")
}
})
diff --git a/src/main/kotlin/shop/itbug/fluttercheckversionx/linemark/PluginDartIconLineMark.kt b/src/main/kotlin/shop/itbug/fluttercheckversionx/linemark/PluginDartIconLineMark.kt
index b30603a7..78cb6ee0 100644
--- a/src/main/kotlin/shop/itbug/fluttercheckversionx/linemark/PluginDartIconLineMark.kt
+++ b/src/main/kotlin/shop/itbug/fluttercheckversionx/linemark/PluginDartIconLineMark.kt
@@ -1,6 +1,5 @@
package shop.itbug.fluttercheckversionx.linemark
-import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer
import com.intellij.codeInsight.daemon.GutterIconNavigationHandler
import com.intellij.codeInsight.daemon.LineMarkerInfo
import com.intellij.codeInsight.daemon.LineMarkerProvider
@@ -12,8 +11,6 @@ import com.intellij.openapi.ui.popup.PopupStep
import com.intellij.openapi.ui.popup.util.BaseListPopupStep
import com.intellij.psi.PsiElement
import com.intellij.ui.awt.RelativePoint
-import note.jdbc.FlutterCollectService
-import note.jdbc.SqliteConnectManager
import org.jetbrains.yaml.psi.impl.YAMLKeyValueImpl
import shop.itbug.fluttercheckversionx.actions.PUB_URL
import shop.itbug.fluttercheckversionx.cache.DartPluginIgnoreConfig
@@ -22,7 +19,6 @@ import shop.itbug.fluttercheckversionx.icons.MyIcons
import shop.itbug.fluttercheckversionx.util.getPluginName
import shop.itbug.fluttercheckversionx.util.isDartPluginElement
import shop.itbug.fluttercheckversionx.util.restartAnalyzer
-import shop.itbug.fluttercheckversionx.util.toast
import java.awt.event.MouseEvent
import javax.swing.Icon
@@ -31,10 +27,13 @@ class PluginDartIconLineMark : LineMarkerProvider {
override fun getLineMarkerInfo(element: PsiElement): LineMarkerInfo? {
if (element.isDartPluginElement() && element is YAMLKeyValueImpl) {
- val isExits = FlutterCollectService.exits(element.getPluginName()) //是否已经收藏了
+// val isExits = FlutterCollectService.exits(element.getPluginName()) //是否已经收藏了
return LineMarkerInfo(
- element.firstChild, element.firstChild.textRange,
- if(isExits) MyIcons.collect else MyIcons.dartPackageIcon, { element.text }, PluginDartIconLineMarkNavHandler(element),
+ element.firstChild,
+ element.firstChild.textRange,
+ MyIcons.dartPackageIcon,
+ { element.text },
+ PluginDartIconLineMarkNavHandler(element),
GutterIconRenderer.Alignment.LEFT
) { "" }
}
@@ -46,7 +45,8 @@ class PluginDartIconLineMark : LineMarkerProvider {
class PluginDartIconLineMarkNavHandler(val element: PsiElement) : GutterIconNavigationHandler {
override fun navigate(e: MouseEvent?, elt: PsiElement?) {
if ((e != null) && (e.clickCount == 1)) {
- JBPopupFactory.getInstance().createListPopup(PluginDartIconActioinMenuList(element = element)).show(RelativePoint(e.locationOnScreen))
+ JBPopupFactory.getInstance().createListPopup(PluginDartIconActioinMenuList(element = element))
+ .show(RelativePoint(e.locationOnScreen))
}
}
}
@@ -55,7 +55,6 @@ data class PluginDartIconActionMenuItem(val title: String, val type: String, val
class PluginDartIconActioinMenuList(val element: PsiElement) : BaseListPopupStep() {
- private val isExites = FlutterCollectService.exits(element.getPluginName()) //是否已经收藏
private val menus
get() = listOf(
@@ -64,12 +63,7 @@ class PluginDartIconActioinMenuList(val element: PsiElement) : BaseListPopupStep
type = "navToPub",
icon = AllIcons.Toolwindows.WebToolWindow
),
- PluginDartIconActionMenuItem(
- PluginBundle.get("plugin.collect"),
- "collect",
- if (isExites) MyIcons.collect else MyIcons.collectUn
- ),
- PluginDartIconActionMenuItem(PluginBundle.get("ig.version.check"),"ig-check", icon = AllIcons.General.Beta)
+ PluginDartIconActionMenuItem(PluginBundle.get("ig.version.check"), "ig-check", icon = AllIcons.General.Beta)
)
init {
@@ -87,9 +81,6 @@ class PluginDartIconActioinMenuList(val element: PsiElement) : BaseListPopupStep
BrowserUtil.browse("$PUB_URL${element.getPluginName()}")
}
- menus[1].type -> {
- addToCollect()
- }
menus[2].type -> {
DartPluginIgnoreConfig.getInstance(element.project).add(element.getPluginName())
element.project.restartAnalyzer()
@@ -99,32 +90,4 @@ class PluginDartIconActioinMenuList(val element: PsiElement) : BaseListPopupStep
}
- ///添加收藏
- private fun addToCollect() {
- if (isExites) {
- removeCollect()
- return
- }
- SqliteConnectManager.createFlutterPluginTable()
- FlutterCollectService.add(element.getPluginName())
- /// update the icon
- DaemonCodeAnalyzer.getInstance(element.project).restart()
- }
-
-
- ///移除收藏
- private fun removeCollect() {
- val success = FlutterCollectService.remove(element.getPluginName())
- if (success) {
- element.project.toast("Delete succeeded")
-
- /// update the icon
- DaemonCodeAnalyzer.getInstance(element.project).restart()
- } else {
- element.project.toast("Delete failed")
- }
-
-
-
- }
}
\ No newline at end of file
diff --git a/src/main/kotlin/shop/itbug/fluttercheckversionx/manager/DartFactoryConstructorDeclarationImplManager.kt b/src/main/kotlin/shop/itbug/fluttercheckversionx/manager/DartFactoryConstructorDeclarationImplManager.kt
index 74eca5ab..2c46b316 100644
--- a/src/main/kotlin/shop/itbug/fluttercheckversionx/manager/DartFactoryConstructorDeclarationImplManager.kt
+++ b/src/main/kotlin/shop/itbug/fluttercheckversionx/manager/DartFactoryConstructorDeclarationImplManager.kt
@@ -1,9 +1,17 @@
package shop.itbug.fluttercheckversionx.manager
-import com.jetbrains.lang.dart.psi.DartDefaultFormalNamedParameter
-import com.jetbrains.lang.dart.psi.DartMetadata
-import com.jetbrains.lang.dart.psi.DartNormalFormalParameter
+import com.intellij.openapi.command.WriteCommandAction
+import com.intellij.psi.PsiElement
+import com.intellij.psi.impl.source.tree.LeafPsiElement
+import com.intellij.psi.util.PsiTreeUtil
+import com.intellij.psi.util.childrenOfType
+import com.jetbrains.lang.dart.psi.*
+import com.jetbrains.lang.dart.psi.impl.DartArgumentsImpl
import com.jetbrains.lang.dart.psi.impl.DartFactoryConstructorDeclarationImpl
+import com.jetbrains.lang.dart.psi.impl.DartMetadataImpl
+import com.jetbrains.lang.dart.psi.impl.DartStringLiteralExpressionImpl
+import shop.itbug.fluttercheckversionx.util.MyDartPsiElementUtil
+
/**
* 封装自己的属性节点
@@ -18,10 +26,17 @@ data class ConstructorProperties(
val option: Boolean
)
+sealed interface ReplaceElementActionResult
+data object ReplaceElementIgnore : ReplaceElementActionResult //不做任何操作
+data class ReplaceElementDoAction(val newElement: PsiElement) : ReplaceElementActionResult //替换节点
+
+
+typealias ReplaceElementAction = (oldElement: DartDefaultFormalNamedParameter) -> ReplaceElementActionResult
+
/**
* 构造函数的相关操作
*/
-class DartFactoryConstructorDeclarationImplManager(val psiElement: DartFactoryConstructorDeclarationImpl) {
+class DartFactoryConstructorDeclarationImplManager(private val psiElement: DartFactoryConstructorDeclarationImpl) {
/**
@@ -32,6 +47,29 @@ class DartFactoryConstructorDeclarationImplManager(val psiElement: DartFactoryCo
}
+ /**
+ * 获取类名
+ */
+ val getClassName get() : String? = psiElement.componentName?.text
+
+
+ /**
+ * 获取参数列表
+ */
+ private val getFactoryParams
+ get() = psiElement.formalParameterList?.optionalFormalParameters?.defaultFormalNamedParameterList ?: emptyList()
+
+
+ /**
+ * 获取参数列表
+ */
+ val getPropertiesWrapper: List
+ get() = getFactoryParams.map {
+ DartDefaultFormalNamedParameterActionManager(
+ it
+ ).getPropertiesWrapper
+ }
+
/**
* 是否有HiveType注解
*/
@@ -45,8 +83,6 @@ class DartFactoryConstructorDeclarationImplManager(val psiElement: DartFactoryCo
fun getAllProperties(): List {
val result = mutableListOf()
val normalParameters = psiElement.formalParameterList?.normalFormalParameterList ?: emptyList()
- val defaultFormalParameters =
- psiElement.formalParameterList?.optionalFormalParameters?.defaultFormalNamedParameterList ?: emptyList()
normalParameters.forEachIndexed { index, it ->
@@ -61,7 +97,7 @@ class DartFactoryConstructorDeclarationImplManager(val psiElement: DartFactoryCo
)
}
- defaultFormalParameters.forEach {
+ getFactoryParams.forEach {
result.add(
ConstructorProperties(
name = it.normalFormalParameter.simpleFormalParameter?.componentName?.text ?: "",
@@ -76,4 +112,246 @@ class DartFactoryConstructorDeclarationImplManager(val psiElement: DartFactoryCo
return result
}
-}
\ No newline at end of file
+
+
+ ///替换某个属性到新的节点
+ private fun replaceOptionParameterTo(action: ReplaceElementAction) {
+ getFactoryParams.let {
+ val params = it
+ params.forEach { oldParam ->
+ when (val result = action(oldParam)) {
+ is ReplaceElementDoAction -> {
+ oldParam.replace(result.newElement)
+ }
+
+ ReplaceElementIgnore -> {
+ }
+ }
+ }
+ }
+ }
+
+
+ ///重置为默认值,,,set as default value
+ fun setAllPropertiesToDefaultValue() {
+ replaceOptionParameterTo {
+ val manager = DartDefaultFormalNamedParameterActionManager(it)
+ if ((manager.isOption || manager.firstIsRequiredTag) && !manager.hasMetadata("Default")) {
+
+
+ manager.handleTypeElement { typePsiElement ->
+ typePsiElement?.let { _ ->
+ val type = manager.typeManager.getMyDartType()
+ type?.apply {
+ val genMetadata = MyDartPsiElementUtil.generateDartMetadata(
+ "Default(${this.defaultValueString})", psiElement.project
+ )
+
+ manager.findRequiredPsiElementAndAction { requiredElement ->
+ WriteCommandAction.runWriteCommandAction(it.project) {
+ requiredElement.replace(genMetadata)
+ }
+ }
+
+
+ }
+
+ }
+ }
+ }
+ ReplaceElementIgnore
+ }
+ }
+
+
+}
+
+
+///对属性的操作
+class DartDefaultFormalNamedParameterActionManager(val element: DartDefaultFormalNamedParameter) {
+
+
+ private val finalElement: DartSimpleFormalParameter? = element.normalFormalParameter.simpleFormalParameter
+
+
+ ///参数是否标记有 required 标识
+ val firstIsRequiredTag = finalElement?.firstChild?.text == "required"
+
+ ///参数的类型
+ val type = finalElement?.type?.simpleType
+
+ ///是否为可选参数
+ val isOption = type?.lastChild?.text == "?"
+
+ ///类型管理
+ val typeManager = TypeManager(type)
+
+ ///字段名字
+ private val filedName = finalElement?.componentName?.name ?: ""
+
+
+ ///注解列表
+ val getMetadataList: MutableCollection
+ get() = PsiTreeUtil.findChildrenOfType(
+ finalElement,
+ DartMetadataImpl::class.java
+ )
+
+ val getPropertiesWrapper
+ get() = MyPropertiesWrapper(
+ name = filedName,
+ isRequired = !isOption,
+ typeString = finalElement?.type?.simpleType?.text ?: "",
+ jsonKeyName = getJsonKeyName ?: ""
+ )
+
+
+ ///查找 required element,并替换
+ fun findRequiredPsiElementAndAction(handle: (ele: PsiElement) -> Unit) {
+ val findChildrenOfType = PsiTreeUtil.findChildrenOfType(finalElement, LeafPsiElement::class.java)
+ val find = findChildrenOfType.find { it.text == "required" }
+ find?.let {
+ handle.invoke(it)
+ }
+ }
+
+
+ ///是否有[name]这个名字的注解,不带“@”符号
+ fun hasMetadata(name: String): Boolean {
+ val metadatas = finalElement?.childrenOfType() ?: emptyList()
+ return metadatas.find { it.firstChild.nextSibling.text == name } != null
+ }
+
+
+ ///操作属性名字节点
+ fun handleTypeElement(handle: (ele: DartSimpleType?) -> Unit) {
+ handle.invoke(type)
+ }
+
+
+ ///创建一个注解
+ fun createMetedata(name: String): DartMetadataImpl {
+ return MyDartPsiElementUtil.generateDartMetadata(name, element.project)
+ }
+
+
+ ///获取 json key 里面的 name 值
+ private val getJsonKeyName
+ get() : String? {
+ var name: String? = null
+ processMetadata({
+ println(it.name)
+ it.name == "JsonKey"
+ }) {
+ val psiElementByNameKey = it.getPsiElementByNameKey("name")
+ if (psiElementByNameKey?.isString == true) {
+ name = psiElementByNameKey.stringValue
+ } else {
+ name = filedName
+ }
+ }
+ return name
+ }
+
+ ///循环处理注解列表
+ private fun processMetadata(
+ filter: (manager: MyMetadataManger) -> Boolean,
+ action: (manager: MyMetadataManger) -> Unit
+ ) {
+ getMetadataList.forEach {
+ val mg = MyMetadataManger(it)
+ val isHandle = filter.invoke(mg)
+ if (isHandle) {
+ action.invoke(mg)
+ }
+ }
+ }
+
+ inner class TypeManager(dType: DartSimpleType?) {
+
+ private val dartType = dType?.firstChild?.reference?.element?.text
+
+ ///获取 dart 类型
+ fun getMyDartType(): MyDartType? {
+ return MyDartType.entries.find { it.dartType == dartType }
+ }
+
+ }
+
+ inner class MyMetadataManger(metadata: DartMetadataImpl) {
+ ///注解名
+ val name: String = metadata.referenceExpression.text
+
+ ///参数列表psi
+ private val argPsiement = metadata.referenceExpression.nextSibling as DartArgumentsImpl
+
+ ///参数列表
+ private val args = argPsiement.argumentList?.namedArgumentList ?: emptyList()
+
+
+ fun getPsiElementByNameKey(findName: String): MetaDataValueWrapper? {
+ val findEle = args.find { it.parameterReferenceExpression.name == findName }
+ if (findEle != null) {
+ val isStringValue = findEle.lastChild is DartStringLiteralExpressionImpl
+ return MetaDataValueWrapper(
+ isString = isStringValue,
+ stringValue = if (isStringValue) (findEle.lastChild as DartStringLiteralExpressionImpl).name else null
+ )
+ }
+ return null
+ }
+
+
+ }
+
+ data class MetaDataValueWrapper(val isString: Boolean, val stringValue: String?)
+
+
+ data class MyPropertiesWrapper(
+// 字段姓名
+ var name: String = "",
+ //是否必须的
+ var isRequired: Boolean = false,
+ // json字段属性
+ var jsonKeyName: String = "",
+ //类型
+ var typeString: String = ""
+ )
+
+}
+
+
+///几种常见的类型
+enum class MyDartType(val dartType: String, val defaultValueString: String) {
+ NumType("num", "0"), DoubleType("double", "0"), IntType("int", "0"), StringType("String", "''"), MapType(
+ "Map",
+ "{}"
+ ),
+ MapType2(
+ "Map",
+ "{}"
+ ),
+ ListType("List", "[]"), BoolType("bool", "false"), SetType("Set", "[]"), IListType("IList", "const IListConst([])"),
+
+ IMapType("IMap", "const IMap({})"), ISetType("ISet", "const ISet([])")
+}
+
+
+///对注解的一些操作
+class DartMetaActionManager(private val dartMetadata: DartMetadataImpl) {
+
+
+ /**
+ * 根据一个字符串来生成一个注解 PsiElement
+ * 注意:[string] 不要携带@
+ * 例子:
+ * ```kotlin
+ * @Default(0) -> string 传入`Default(0)`就行
+ *
+ * ```
+ */
+ fun generateForStringText(string: String): DartMetadataImpl {
+ return MyDartPsiElementUtil.generateDartMetadata(string, dartMetadata.project)
+ }
+}
+
diff --git a/src/main/kotlin/shop/itbug/fluttercheckversionx/services/MyUserBarFactory.kt b/src/main/kotlin/shop/itbug/fluttercheckversionx/services/MyUserBarFactory.kt
index 5b9b0936..e5d00b53 100644
--- a/src/main/kotlin/shop/itbug/fluttercheckversionx/services/MyUserBarFactory.kt
+++ b/src/main/kotlin/shop/itbug/fluttercheckversionx/services/MyUserBarFactory.kt
@@ -40,7 +40,7 @@ class MyUserBarFactory : StatusBarWidgetFactory {
}
override fun getDisplayName(): String {
- return "FlutterCheckVersionX"
+ return "FlutterX"
}
override fun isAvailable(project: Project): Boolean {
@@ -137,6 +137,7 @@ class MyUserAccountBar(var project: Project) : CustomStatusBarWidget {
SearchPlugin -> {
SearchDialog(project).show()
}
+
RunBuilder -> runCommand("flutter pub run build_runner build")
FlutterClan -> runCommand("flutter clean")
FlutterPushPlugin -> runCommand(" dart pub publish")
@@ -155,7 +156,7 @@ class MyUserAccountBar(var project: Project) : CustomStatusBarWidget {
}
private fun runCommand(code: String) {
- RunUtil.runCommand(project,"FlutterCheckVersionX",code)
+ RunUtil.runCommand(project, "FlutterX", code)
}
}
\ No newline at end of file
diff --git a/src/main/kotlin/shop/itbug/fluttercheckversionx/services/cache/UserRunStartService.kt b/src/main/kotlin/shop/itbug/fluttercheckversionx/services/cache/UserRunStartService.kt
deleted file mode 100644
index ff018a71..00000000
--- a/src/main/kotlin/shop/itbug/fluttercheckversionx/services/cache/UserRunStartService.kt
+++ /dev/null
@@ -1,14 +0,0 @@
-package shop.itbug.fluttercheckversionx.services.cache
-
-import com.intellij.openapi.components.service
-import shop.itbug.fluttercheckversionx.socket.service.AppService
-
-/**
- * 在idea启动的时候,实现自动登录的功能
- */
-class UserRunStartService: Runnable {
-
- override fun run() {
- service().login()
- }
-}
\ No newline at end of file
diff --git a/src/main/kotlin/shop/itbug/fluttercheckversionx/socket/service/AppService.kt b/src/main/kotlin/shop/itbug/fluttercheckversionx/socket/service/AppService.kt
index 0bd9a9dd..ad3f0a25 100644
--- a/src/main/kotlin/shop/itbug/fluttercheckversionx/socket/service/AppService.kt
+++ b/src/main/kotlin/shop/itbug/fluttercheckversionx/socket/service/AppService.kt
@@ -18,7 +18,6 @@ import shop.itbug.fluttercheckversionx.model.user.User
import shop.itbug.fluttercheckversionx.services.ItbugService
import shop.itbug.fluttercheckversionx.services.JSONResult
import shop.itbug.fluttercheckversionx.services.SERVICE
-import shop.itbug.fluttercheckversionx.services.cache.UserRunStartService
import shop.itbug.fluttercheckversionx.services.event.UserLoginStatusEvent
import shop.itbug.fluttercheckversionx.socket.ProjectSocketService
import shop.itbug.fluttercheckversionx.util.CredentialUtil
@@ -78,14 +77,9 @@ class AppService : DioApiService.HandleFlutterApiModel {
val flutterProjects get() = requestsList.groupBy { it.projectName }
- private val userRunStartManager = Thread(UserRunStartService())
- private val chatRoomLoadManager = Thread(ChatRoomsLoadThread())
lateinit var dioThread: Thread
init {
- userRunStartManager.start()
- chatRoomLoadManager.start()
- note.jdbc.SqliteConnectManager
register()
}
diff --git a/src/main/kotlin/shop/itbug/fluttercheckversionx/util/DartJavaCovertUtil.kt b/src/main/kotlin/shop/itbug/fluttercheckversionx/util/DartJavaCovertUtil.kt
index ba1209fb..aef2a9d8 100644
--- a/src/main/kotlin/shop/itbug/fluttercheckversionx/util/DartJavaCovertUtil.kt
+++ b/src/main/kotlin/shop/itbug/fluttercheckversionx/util/DartJavaCovertUtil.kt
@@ -5,11 +5,11 @@ import com.alibaba.fastjson2.JSONObject
import java.math.BigDecimal
-fun JSONArray.findPropertiesMaxLenObject() : JSONObject {
- var obj = first() as JSONObject
- forEach {
- if(it is JSONObject) {
- if(it.keys.size > obj.keys.size) {
+fun JSONArray.findPropertiesMaxLenObject(): JSONObject {
+ var obj = JSONObject()
+ for (it in this) {
+ if (it is JSONObject) {
+ if (it.keys.size > obj.keys.size) {
obj = it
}
}
@@ -17,40 +17,47 @@ fun JSONArray.findPropertiesMaxLenObject() : JSONObject {
return obj
}
+
object DartJavaCovertUtil {
- fun getDartType(obj: Any,key: String) : String {
- if(obj is Boolean) {
+ fun getDartType(obj: Any, key: String): String {
+ if (obj is Boolean) {
return "bool"
}
- return when(obj::class.java){
+ return when (obj::class.java) {
Integer::class.java -> {
"int"
}
+
String::class.java -> {
"String"
}
+
BigDecimal::class.java -> {
"double"
}
+
Boolean::class.java -> {
"bool"
}
+
JSONObject::class.java -> {
key.formatDartName()
}
+
JSONArray::class.java -> {
val arr = obj as JSONArray
- if(arr.isNotEmpty()) {
- if(arr.first() is JSONObject){
+ if (arr.isNotEmpty()) {
+ if (arr.first() is JSONObject) {
"List<${key.formatDartName()}>"
}
}
- "List<${ if(arr.isEmpty()) "dynamic" else getDartType(arr.first(),key)}>"
+ "List<${if (arr.isEmpty()) "dynamic" else getDartType(arr.first(), key)}>"
}
+
else -> {
"dynamic"
}
diff --git a/src/main/kotlin/shop/itbug/fluttercheckversionx/util/DartPsiElementUtil.kt b/src/main/kotlin/shop/itbug/fluttercheckversionx/util/DartPsiElementUtil.kt
index 66e28ee9..2fbad957 100644
--- a/src/main/kotlin/shop/itbug/fluttercheckversionx/util/DartPsiElementUtil.kt
+++ b/src/main/kotlin/shop/itbug/fluttercheckversionx/util/DartPsiElementUtil.kt
@@ -28,13 +28,13 @@ fun AnActionEvent.getDartClassDefinition(): DartClassDefinitionImpl? {
return null
}
-fun DartClassDefinitionImpl.addAnnotation(name: String,project: Project):DartClassDefinitionImpl{
- DartPsiElementUtil.classAddAnnotation(this,name,project)
+fun DartClassDefinitionImpl.addAnnotation(name: String, project: Project): DartClassDefinitionImpl {
+ DartPsiElementUtil.classAddAnnotation(this, name, project)
return this
}
-fun DartClassDefinitionImpl.addMixin(name: String,project: Project):DartClassDefinitionImpl{
- DartPsiElementUtil.classAddMixin(this,name, project)
+fun DartClassDefinitionImpl.addMixin(name: String, project: Project): DartClassDefinitionImpl {
+ DartPsiElementUtil.classAddMixin(this, name, project)
return this
}
@@ -70,29 +70,29 @@ object DartPsiElementUtil {
return getTypeWithVar(element).findLast { it == '?' } != null
}
- fun getModels(list: List) : List {
- return list.map { it.covertDartClassPropertyModel() }
+ fun getModels(list: List): List {
+ return list.map { it.covertDartClassPropertyModel() }
}
/**
* 给class添加注解
*/
- fun classAddAnnotation(classElement: DartClassDefinitionImpl,name: String,project: Project) {
+ fun classAddAnnotation(classElement: DartClassDefinitionImpl, name: String, project: Project) {
val metadata = MyDartPsiElementUtil.generateDartMetadata(name, project)
val generateSpace = MyDartPsiElementUtil.generateSpace(project)
runWriteAction {
- classElement.addAfter(generateSpace,classElement.prevSibling)
- classElement.addAfter(metadata,classElement.prevSibling)
+ classElement.addAfter(generateSpace, classElement.prevSibling)
+ classElement.addAfter(metadata, classElement.prevSibling)
}
}
- fun classAddMixin(classElement: DartClassDefinitionImpl,name: String,project: Project) {
+ fun classAddMixin(classElement: DartClassDefinitionImpl, name: String, project: Project) {
val generateSpace = MyDartPsiElementUtil.generateSpace(project, " ")
val generateMixins = MyDartPsiElementUtil.generateMixins(project, name)
val nameElement = PsiTreeUtil.findChildOfType(classElement, DartComponentNameImpl::class.java)!!
runWriteAction {
- nameElement.addBefore(generateSpace,classElement.nextSibling)
- nameElement.addBefore(generateMixins,classElement.nextSibling)
+ nameElement.addBefore(generateSpace, classElement.nextSibling)
+ nameElement.addBefore(generateMixins, classElement.nextSibling)
}
}
@@ -107,4 +107,6 @@ object DartPsiElementUtil {
}
-}
\ 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 c7584adb..d1f85864 100644
--- a/src/main/kotlin/shop/itbug/fluttercheckversionx/util/Util.kt
+++ b/src/main/kotlin/shop/itbug/fluttercheckversionx/util/Util.kt
@@ -31,13 +31,13 @@ fun Color.toHexString(): String {
return Util.toHexFromColor(this)
}
-fun String.formatDartName() : String {
+fun String.formatDartName(): String {
return Util.removeSpecialCharacters(this)
}
-fun String.firstChatToUpper() : String {
- return CaseFormat.LOWER_HYPHEN.to(CaseFormat.UPPER_CAMEL, this)
+fun String.firstChatToUpper(): String {
+ return CaseFormat.LOWER_HYPHEN.to(CaseFormat.UPPER_CAMEL, this)
}
/**
@@ -51,18 +51,18 @@ fun PsiElement.reformatText() {
fun PsiElement.runWriteCommandAction(runnable: Runnable) {
- WriteCommandAction.runWriteCommandAction(project,runnable)
+ WriteCommandAction.runWriteCommandAction(project, runnable)
}
/**
* 根据文本查找psi节点
* @param findText 要查找的文本
*/
-fun PsiFile.findPsiElementByText(findText: String) : PsiElement? {
- val c = MyPsiElementUtil.findAllMatchingElements(this){ text: String, _: PsiElement ->
+fun PsiFile.findPsiElementByText(findText: String): PsiElement? {
+ val c = MyPsiElementUtil.findAllMatchingElements(this) { text: String, _: PsiElement ->
return@findAllMatchingElements findText == text
}
- return if(c.isNotEmpty()) c.first() else null
+ return if (c.isNotEmpty()) c.first() else null
}
fun PsiElement.getRelativePoint(editor: Editor): RelativePoint {
@@ -76,7 +76,7 @@ fun PsiElement.getRelativePoint(editor: Editor): RelativePoint {
/**
* 根据psi节点获取文件名
*/
-fun PsiElement.getFileName() : String {
+fun PsiElement.getFileName(): String {
return FileUtilRt.getNameWithoutExtension(this.containingFile.name)
}
@@ -84,18 +84,14 @@ fun PsiElement.getFileName() : String {
fun DartFactoryConstructorDeclarationImpl.manager() = DartFactoryConstructorDeclarationImplManager(this)
-
class Util {
companion object {
- val userHomePath: String get() = System.getProperty("user.home")
-
- fun toHexFromColor(color: Color): String {
+ fun toHexFromColor(color: Color): String {
return UIUtil.colorToHex(color)
}
-
fun removeSpecialCharacters(string: String): String {
var str1: String = CaseFormat.LOWER_HYPHEN.to(CaseFormat.UPPER_CAMEL, string)
@@ -133,7 +129,7 @@ class Util {
if (ip.contains(":")) return true
if (ip.startsWith("127.")) return true
if (ip.startsWith("169.254.")) return true
- if(ip.split(".").size == 4 && ip.split(".")[2].toString() === "0") return false
+ if (ip.split(".").size == 4 && ip.split(".")[2].toString() === "0") return false
return ip == "255.255.255.255"
}
@@ -223,8 +219,7 @@ class Util {
}
-
- fun addStringToLineStart(text:String, value:String) : String {
+ fun addStringToLineStart(text: String, value: String): String {
val bufferedReader = BufferedReader(InputStreamReader(ByteArrayInputStream(text.toByteArray())))
val sb = StringBuilder()
bufferedReader.forEachLine {
diff --git a/src/main/kotlin/shop/itbug/fluttercheckversionx/widget/EditorTextPanel.kt b/src/main/kotlin/shop/itbug/fluttercheckversionx/widget/EditorTextPanel.kt
index b420e0f4..e8c6468f 100644
--- a/src/main/kotlin/shop/itbug/fluttercheckversionx/widget/EditorTextPanel.kt
+++ b/src/main/kotlin/shop/itbug/fluttercheckversionx/widget/EditorTextPanel.kt
@@ -3,8 +3,10 @@ package shop.itbug.fluttercheckversionx.widget
import com.intellij.json.JsonLanguage
import com.intellij.openapi.editor.ex.EditorEx
import com.intellij.openapi.project.Project
+import com.intellij.psi.PsiDocumentManager
import com.intellij.ui.LanguageTextField
import com.jetbrains.lang.dart.DartLanguage
+import shop.itbug.fluttercheckversionx.util.reformatText
open class JsonEditorTextPanel(project: Project) : LanguageTextField(JsonLanguage.INSTANCE, project, "", false) {
@@ -29,6 +31,16 @@ class DartEditorTextPanel(project: Project) : LanguageTextField(DartLanguage.INS
override fun createEditor(): EditorEx {
return myCreateEditor(super.createEditor())
}
+
+ fun reformat() {
+ val instance = PsiDocumentManager.getInstance(project)
+ val psiFile = instance.getPsiFile(document)
+ psiFile?.let {
+ it.reformatText()
+ }
+
+
+ }
}
diff --git a/src/main/kotlin/shop/itbug/fluttercheckversionx/window/DartPluginsWindow.kt b/src/main/kotlin/shop/itbug/fluttercheckversionx/window/DartPluginsWindow.kt
deleted file mode 100644
index 319763eb..00000000
--- a/src/main/kotlin/shop/itbug/fluttercheckversionx/window/DartPluginsWindow.kt
+++ /dev/null
@@ -1,138 +0,0 @@
-package shop.itbug.fluttercheckversionx.window
-
-import cn.hutool.db.Entity
-import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer
-import com.intellij.icons.AllIcons
-import com.intellij.openapi.actionSystem.ActionManager
-import com.intellij.openapi.actionSystem.AnActionEvent
-import com.intellij.openapi.actionSystem.DefaultActionGroup
-import com.intellij.openapi.project.Project
-import com.intellij.openapi.wm.ToolWindow
-import com.intellij.ui.components.JBLabel
-import com.intellij.ui.components.JBList
-import com.intellij.ui.components.JBScrollPane
-import com.intellij.util.ui.components.BorderLayoutPanel
-import note.jdbc.FlutterCollectService
-import shop.itbug.fluttercheckversionx.bus.FlutterPluginCollectEvent
-import shop.itbug.fluttercheckversionx.bus.FlutterPluginCollectEventType
-import shop.itbug.fluttercheckversionx.common.MyDumbAwareAction
-import shop.itbug.fluttercheckversionx.dialog.MyPluginAddToPubspecFileDialog
-import java.awt.Component
-import javax.swing.DefaultListModel
-import javax.swing.JList
-import javax.swing.ListCellRenderer
-
-class DartPluginsWindow(private val toolwindow: ToolWindow, val project: Project) : BorderLayoutPanel() {
-
- val list = DartPluginList(project)
-
- fun isSelect(): Boolean = list.selectedIndex >= 0
-
- private val toolbar =
- ActionManager.getInstance().createActionToolbar("dart-plugin-toolwindow", createActions().apply {
- }, true).apply {
- targetComponent = toolwindow.component
- }
-
- ///操作
- private fun createActions(): DefaultActionGroup = DefaultActionGroup().apply {
-
-
- //刷新列表
- add(object : MyDumbAwareAction("Refresh", "Refresh", AllIcons.Actions.Refresh) {
- override fun actionPerformed(e: AnActionEvent) {
- list.refresh()
- }
- })
-
- //删除
- add(object : MyDumbAwareAction("Remove", "Remove Collection", AllIcons.General.Remove) {
- override fun actionPerformed(e: AnActionEvent) {
- //删除错误
- list.remove()
- DaemonCodeAnalyzer.getInstance(project).restart()
- }
-
- override fun update(e: AnActionEvent) {
- super.update(e)
- e.presentation.isEnabled = isSelect()
- }
- })
-
- //添加到依赖文件
- add(object : MyDumbAwareAction("Add to pubspec.yaml file", "", AllIcons.Actions.AddList) {
- override fun actionPerformed(e: AnActionEvent) {
- MyPluginAddToPubspecFileDialog(project, list.selectedValue).show()
- }
-
- override fun update(e: AnActionEvent) {
- super.update(e)
- e.presentation.isEnabled = isSelect()
- }
- })
- }
-
- init {
- addToCenter(JBScrollPane(list).apply { border = null })
- addToTop(toolbar.component)
- }
-
-}
-
-
-class DartPluginList(val project: Project) : JBList() {
- private fun all(): List = FlutterCollectService.selectAll()
-
- init {
- model = DefaultListModel().apply {
- addAll(all())
- }
- cellRenderer = DartPluginNameCellRender()
-
- FlutterPluginCollectEvent.listen { type, _ ->
- when (type) {
- FlutterPluginCollectEventType.add -> refresh()
- FlutterPluginCollectEventType.remove -> refresh()
- }
- }
- border = null
- }
-
-
- fun refresh() {
- (model as DefaultListModel).apply {
- clear()
- addAll(all())
- }
- }
-
- ///删除某个项目
- fun remove() {
- if (selectedIndex >= 0) {
- //删除选中
- val remove = FlutterCollectService.remove(selectedValue.getStr("name"))
- DaemonCodeAnalyzer.getInstance(project).restart()
- if (remove && selectedIndex >= 0) {
- (model as DefaultListModel).remove(selectedIndex)
- }
- }
- }
-}
-
-
-///行渲染
-class DartPluginNameCellRender : JBLabel(), ListCellRenderer {
-
- override fun getListCellRendererComponent(
- list: JList?,
- value: Entity?,
- index: Int,
- isSelected: Boolean,
- cellHasFocus: Boolean
- ): Component {
- text = value?.getStr("name")
- return this
- }
-
-
-}
\ No newline at end of file
diff --git a/src/main/kotlin/shop/itbug/fluttercheckversionx/window/SocketWindow.kt b/src/main/kotlin/shop/itbug/fluttercheckversionx/window/SocketWindow.kt
index ded6e876..72ce30c9 100644
--- a/src/main/kotlin/shop/itbug/fluttercheckversionx/window/SocketWindow.kt
+++ b/src/main/kotlin/shop/itbug/fluttercheckversionx/window/SocketWindow.kt
@@ -74,12 +74,6 @@ class SocketWindow : ToolWindowFactory {
// val apiIndexContent = instance.createContent(apiIndexWindow,"接口管理",false)
// p1.contentManager.addContent(apiIndexContent)
- //flutter收藏窗口
- val dartPluginWindow = DartPluginsWindow(p1, p0)
- val dartPluginContent =
- instance.createContent(dartPluginWindow, PluginBundle.get("plugin.collects.title"), false)
- p1.contentManager.addContent(dartPluginContent)
-
// sp工具
val spWindow = SpWindow(p0, p1)
diff --git a/src/main/kotlin/shop/itbug/fluttercheckversionx/window/sp/SpWindow.kt b/src/main/kotlin/shop/itbug/fluttercheckversionx/window/sp/SpWindow.kt
index cdf606c9..3fa9081b 100644
--- a/src/main/kotlin/shop/itbug/fluttercheckversionx/window/sp/SpWindow.kt
+++ b/src/main/kotlin/shop/itbug/fluttercheckversionx/window/sp/SpWindow.kt
@@ -6,9 +6,11 @@ import com.intellij.openapi.actionSystem.*
import com.intellij.openapi.project.DumbAwareAction
import com.intellij.openapi.project.Project
import com.intellij.openapi.wm.ToolWindow
+import com.intellij.ui.JBColor
import com.intellij.ui.OnePixelSplitter
import com.intellij.ui.components.JBList
import com.intellij.ui.components.JBScrollPane
+import com.intellij.util.ui.JBUI
import com.intellij.util.ui.components.BorderLayoutPanel
import org.smartboot.socket.transport.AioSession
import shop.itbug.fluttercheckversionx.form.sub.JsonValueRender
@@ -37,6 +39,7 @@ class SpWindow(project: Project, private val toolWindow: ToolWindow) : BorderLay
}
init {
+ register()
getAllKeys()
addToTop(createToolbar().component)
addToCenter(content)
@@ -91,7 +94,7 @@ class SpWindowRight(project: Project) : BorderLayoutPanel() {
SpManagerListen.listen(null) {
jsonView.changeValue(it?.value)
}
- border = null
+ border = JBUI.Borders.customLine(JBColor.border(), 1, 0, 0, 0)
}
@@ -107,7 +110,7 @@ class SpWindowLeft : JBList(), ListSelectionListener {
}
}, valueHandle = null)
addListSelectionListener(this)
- border = null
+ border = JBUI.Borders.customLine(JBColor.border(), 1, 0, 0, 0)
}
diff --git a/src/main/resources/META-INF/actions.xml b/src/main/resources/META-INF/actions.xml
index eea085e7..b0c45adc 100644
--- a/src/main/resources/META-INF/actions.xml
+++ b/src/main/resources/META-INF/actions.xml
@@ -17,7 +17,7 @@
-
+
@@ -27,13 +27,21 @@
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -62,6 +70,7 @@
+
diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml
index 09efb821..c347c4e2 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
Dart
io.flutter
- Git4Idea
org.jetbrains.kotlin
org.intellij.plugins.markdown
org.jetbrains.plugins.terminal
@@ -112,6 +111,10 @@
implementationClass="shop.itbug.fluttercheckversionx.inlay.dartfile.DartTypeInlayHintsProvider"
language="Dart"/>
+
+
+
@@ -149,12 +152,10 @@
-
-
-
-
+
@@ -181,14 +182,9 @@
-
-
-
+ text="SocketConnectComboxAction" description="Socket connect list" popup="true"/>
@@ -251,6 +247,12 @@
+
+
diff --git a/src/main/resources/messages/pluginBundle.properties b/src/main/resources/messages/pluginBundle.properties
index bb30af25..9178f889 100644
--- a/src/main/resources/messages/pluginBundle.properties
+++ b/src/main/resources/messages/pluginBundle.properties
@@ -62,7 +62,7 @@ version.tip.2=更新时间
clean.cache=清理缓存
search.pub.plugin=搜索pub.dev插件
check.flutter.plugin=检查依赖版本信息
-w.t=典典的工具
+w.t=梁典典的工具
add=添加
search=搜索
name.plugin=插件名
@@ -122,4 +122,9 @@ ui.render=UI样式
dio.setting.project.name.show.option=显示项目名字
plugin.collects.title=插件收藏
tool=工具
-dio.search.empty.text=输入URL关键字来搜索
\ No newline at end of file
+dio.search.empty.text=输入URL关键字来搜索
+set.as.freezed.default.value=将required设置为默认值 (freezed)
+window.idea.dio.view.detail=
+editor.freezed.fun.param.to.class=根据方法参数生成对象 (freezed)
+class.to.object=class 生成 freezed 对象
+generate.fun.comment=生成带有参数的注释
\ No newline at end of file
diff --git a/src/main/resources/messages/pluginBundle_en.properties b/src/main/resources/messages/pluginBundle_en.properties
index a125d637..b659b8a2 100644
--- a/src/main/resources/messages/pluginBundle_en.properties
+++ b/src/main/resources/messages/pluginBundle_en.properties
@@ -62,7 +62,7 @@ version.tip.2=Update time
clean.cache=Clean cache
search.pub.plugin=Search pub.dev plug-in
check.flutter.plugin=Check Plug-in dependency Version
-w.t=FlutterCheckVersionX Tool
+w.t=FlutterX Tool
add=Add
search=Search
name.plugin=Plugin Name
@@ -102,7 +102,7 @@ name=Name
required=Required
location=Location
element=Element
-br.title=FlutterCheckVersionX Tools
+br.title=FlutterX Tools
run.build_runner.build=Execute command: build_runner build
flutter.clean=Execute command: flutter clean
dart.pub.publish=Execute command: dart pub publish
@@ -125,3 +125,7 @@ dio.setting.project.name.show.option=Display project name
plugin.collects.title=Plugin Collection
tool=tool
dio.search.empty.text=输入URL关键字来搜索
+set.as.freezed.default.value=Set required as default (freezed)
+editor.freezed.fun.param.to.class=Generate Objects Based on Method Parameters (freezed)
+class.to.object='class' generates a 'freezed' object
+generate.fun.comment=Generate annotations with parameters
diff --git a/src/main/resources/messages/pluginBundle_hk.properties b/src/main/resources/messages/pluginBundle_hk.properties
index 189c03e7..2f106cd4 100644
--- a/src/main/resources/messages/pluginBundle_hk.properties
+++ b/src/main/resources/messages/pluginBundle_hk.properties
@@ -62,7 +62,7 @@ version.tip.2=更新時間
clean.cache=清理緩存
search.pub.plugin=搜索 pub.dev 插件
check.flutter.plugin=檢查插件依賴版本
-w.t=FlutterCheckVersionX 工具
+w.t=FlutterX 工具
add=添加
search=搜索
name.plugin=插件名稱
@@ -102,7 +102,7 @@ name=名字
required=必填
location=位置
element=元素
-br.title=FlutterCheckVersionX 工具
+br.title=FlutterX 工具
run.build_runner.build=執行命令: build_runner build
flutter.clean=執行命令: flutter clean
dart.pub.publish=執行命令: dart pub publish
@@ -125,3 +125,7 @@ dio.setting.project.name.show.option=顯示項目名字
plugin.collects.title=挿件收藏
tool=工具
dio.search.empty.text=輸入URL關鍵字來搜索
+set.as.freezed.default.value=將required設定為預設值 (freezed)
+editor.freezed.fun.param.to.class=根據方法參數產生class (freezed)
+class.to.object='class' 生成 'freezed' 对象
+generate.fun.comment=生成帶有參數的註釋
diff --git a/src/main/resources/messages/pluginBundle_ja.properties b/src/main/resources/messages/pluginBundle_ja.properties
index 89895996..a4db812b 100644
--- a/src/main/resources/messages/pluginBundle_ja.properties
+++ b/src/main/resources/messages/pluginBundle_ja.properties
@@ -66,7 +66,7 @@ version.tip.2=更新日時
clean.cache=キャッシュのクリーンアップ
search.pub.plugin=pub.devプラグインの検索
check.flutter.plugin=依存バージョン情報のチェック
-w.t=FlutterCheckVersionX ツール
+w.t=FlutterX ツール
add=追加
search=検索けんさく
name.plugin=プラグイン名
@@ -106,7 +106,7 @@ name=の名前をあげる
required=必須
location=位置
element=ノード
-br.title=FlutterCheckVersionX ツール
+br.title=FlutterX ツール
run.build_runner.build=コマンドの実行: build_runner build
flutter.clean=コマンドの実行: flutter clean
dart.pub.publish=コマンドの実行: dart pub publish
@@ -125,4 +125,9 @@ ui.render=UIスタイル
dio.setting.project.name.show.option=アイテム名を表示
plugin.collects.title=プラグインコレクション
tool=道具
-dio.search.empty.text=検索する URL キーワードを入力します
\ No newline at end of file
+dio.search.empty.text=検索する URL キーワードを入力します
+set.as.freezed.default.value=required をデフォルトとして設定する (freezed)
+set.as.freezed.default.value=required をデフォルトとして設定する (freezed)
+editor.freezed.fun.param.to.class=メソッド パラメーターに基づくオブジェクトの生成 (freezed)
+class.to.object='class' は 'freezed' オブジェクトを生成します
+generate.fun.comment=パラメーターを使用した注釈の生成
\ No newline at end of file
diff --git a/src/main/resources/messages/pluginBundle_ko.properties b/src/main/resources/messages/pluginBundle_ko.properties
index a35e3abb..9a490471 100644
--- a/src/main/resources/messages/pluginBundle_ko.properties
+++ b/src/main/resources/messages/pluginBundle_ko.properties
@@ -66,7 +66,7 @@ version.tip.2=업데이트 시간
clean.cache=캐시 정리
search.pub.plugin=pub.dev 플러그인 검색
check.flutter.plugin=종속 버전 정보 확인
-w.t=FlutterCheckVersionX 도구
+w.t=FlutterX 도구
add=추가
search=검색
name.plugin=플러그인 이름
@@ -106,7 +106,7 @@ name=이름
required=필수
location=위치
element=노드
-br.title=FlutterCheckVersionX 도구
+br.title=FlutterX 도구
run.build_runner.build=명령 실행: build_runner build
flutter.clean=명령 실행: flutter clean
dart.pub.publish=명령 실행: dart pub publish
@@ -125,4 +125,8 @@ ui.render=UI 스타일
dio.setting.project.name.show.option=항목 이름 표시
plugin.collects.title=플러그인 모음
tool=도구
-dio.search.empty.text=검색할 URL 키워드를 입력합니다
\ No newline at end of file
+dio.search.empty.text=검색할 URL 키워드를 입력합니다
+set.as.freezed.default.value=required를 기본값으로 설정(freezed)
+editor.freezed.fun.param.to.class=메서드 파라미터를 기반으로 객체 생성하기(freezed)
+class.to.object='class'는 'freezed' 객체를 생성합니다.
+generate.fun.comment=매개변수로 주석 생성
\ No newline at end of file
diff --git "a/\346\233\264\346\226\260\346\227\245\345\277\227log.md" "b/\346\233\264\346\226\260\346\227\245\345\277\227log.md"
index 5585af12..76800161 100644
--- "a/\346\233\264\346\226\260\346\227\245\345\277\227log.md"
+++ "b/\346\233\264\346\226\260\346\227\245\345\277\227log.md"
@@ -1,5 +1,3 @@
-
-
# 1.9.0
`StatefulWidget`中的`createState`函数在flutter3中会有一个`Avoid using private types in public APIs`