Skip to content

Commit

Permalink
release 3.5.1.as
Browse files Browse the repository at this point in the history
  • Loading branch information
mdddj committed Jul 27, 2023
1 parent 368fa38 commit 59786eb
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 34 deletions.
19 changes: 12 additions & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
id("org.jetbrains.kotlin.plugin.serialization") version "1.8.21"
}
group = "shop.itbug"
version = "3.5.0.as"
version = "3.5.1.as"
repositories {
mavenCentral()
google()
Expand All @@ -17,13 +17,13 @@ repositories {


intellij {
version.set("2022.2.1.18")
version.set("2022.3.1.18")
type.set("AI")
plugins.set(
listOf(
"yaml",
"Dart:222.4582",
"io.flutter:74.0.2",
"Dart:223.8950",
"io.flutter:74.0.3",
"org.intellij.plugins.markdown",
"terminal"
)
Expand Down Expand Up @@ -76,12 +76,17 @@ tasks {
}

patchPluginXml {
sinceBuild.set("222")
untilBuild.set("222.*")
sinceBuild.set("223")
untilBuild.set("223.*")
changeNotes.set(
"""
<div>
<h1>3.5.0.as (2023-07-25)</h1>
<h1>3.5.1.as (2023-07-27)</h1>
<ul>
<li>Add Freezed Shortcut Menu</li>
<li>Added multiple languages such as Korean, Japanese, and Traditional Chinese</li>
<li>Optimization of other details</li>
</ul>
<ul>
<li>添加freezed快捷操作菜单</li>
<li>新增韩语,日语,繁体等多国语言</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,23 @@ import javax.swing.event.ListSelectionListener
*/
class ApiListPanel(val project: Project) : JBList<Request>(), ListSelectionListener {

fun createPopupMenu(): ListPopup {
return JBPopupFactory.getInstance()
.createActionGroupPopup(PluginBundle.get("menu"), myActionGroup, myDataContext, true, { dispose() }, 10)

}
private val myDataContext: AsyncDataContext = object : AsyncDataContext {
override fun getData(dataId: String): Any? {
if (dataId == "select-api") {
return this@ApiListPanel.selectedValue
} else if (dataId == PROJECT_KEY) {
return project
}
return null
}
}


private val appService = service<AppService>()
private fun listModel(): DefaultListModel<Request> = model as DefaultListModel

Expand Down Expand Up @@ -70,30 +87,10 @@ class ApiListPanel(val project: Project) : JBList<Request>(), ListSelectionListe
}


/**
* 查看菜单
*/
fun createPopupMenu(): ListPopup {
return JBPopupFactory.getInstance()
.createActionGroupPopup(PluginBundle.get("menu"), myActionGroup, myDataContext, true, { dispose() }, 10)

}

private val myActionGroup: ActionGroup
get() = ActionManager.getInstance().getAction("dio-window-view-params") as ActionGroup


private val myDataContext: AsyncDataContext = object : AsyncDataContext {
override fun getData(dataId: String): Any? {
if (dataId == "select-api") {
return this@ApiListPanel.selectedValue
} else if (dataId == PROJECT_KEY) {
return project
}
return null
}
}

/**
* 菜单销毁回调
*/
Expand Down Expand Up @@ -197,7 +194,13 @@ class ApiListPanel(val project: Project) : JBList<Request>(), ListSelectionListe
) {
BrowserUtil.open("https://github.com/mdddj/dd_flutter_idea_plugin/issues")
}
appendLine("IP:${Util.resolveLocalAddresses().filter { it.hostAddress.split('.').size == 4 && it.hostAddress.split(".")[2] != "0" }.map { it.hostAddress }}", SimpleTextAttributes.GRAYED_ATTRIBUTES){}
appendLine(
"IP:${
Util.resolveLocalAddresses()
.filter { it.hostAddress.split('.').size == 4 && it.hostAddress.split(".")[2] != "0" }
.map { it.hostAddress }
}", SimpleTextAttributes.GRAYED_ATTRIBUTES
) {}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,6 @@ class FreezedInlayCollector(val edit: Editor) : FactoryInlayHintsCollector(edit)
val isFreezedClass =
DartClassUtil.hasMetadata(element, "freezed") || DartClassUtil.hasMetadata(element, "Freezed")
if (isFreezedClass) {
// val lineStart = editor.getLineStart(element)
// val inlayPresentation =
// inlayFactory.iconText(AllIcons.General.ChevronDown, "Freezed Actions ", false) { mouseEvent, point ->
// showFreezedActionMenu(mouseEvent, point, element)
// }
// sink.addBlockElement(lineStart, true, true, 0, inlayPresentation)
val manager = DartClassManager(psiElement = element as DartClassDefinitionImpl)
val freezedElement = manager.findMataDataByText("freezed") ?: manager.findMataDataByText("Freezed")
freezedElement?.let {
Expand Down

0 comments on commit 59786eb

Please sign in to comment.