Skip to content

Commit cc3ba47

Browse files
authored
合并拉取请求 #44
4.4.0
2 parents 7714f8e + af9f4f0 commit cc3ba47

8 files changed

Lines changed: 30 additions & 41 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
## Unreleased
44

5+
## [4.4.0] - 2024-05-25
6+
7+
- Fix the problem of stuck idea or Android studio
8+
- 修复as或者idea卡死的问题
9+
510
## [4.3.1] - 2024-05-24
611

712
- Optimize dart package version replacement logic

build.gradle.kts

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import org.jetbrains.changelog.Changelog
2+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
3+
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
24

35
val dartVersion: String by project
46
val sinceBuildVersion: String by project
@@ -9,15 +11,14 @@ val pluginVersion: String by project
911
val type: String by project
1012

1113
plugins {
12-
id("org.jetbrains.kotlin.jvm") version "1.9.20"
14+
id("org.jetbrains.kotlin.jvm") version "2.0.0"
1315
id("org.jetbrains.intellij") version "1.16.1"
1416
idea
1517
id("org.jetbrains.changelog") version "2.2.0"
1618
}
1719
group = "shop.itbug"
1820
version = pluginVersion + type
1921

20-
println(project.version)
2122
repositories {
2223
mavenLocal()
2324
mavenCentral()
@@ -60,8 +61,6 @@ dependencies {
6061
}
6162

6263
val pushToken: String? = System.getenv("idea_push_token")
63-
var javaVersion = "17"
64-
6564

6665
tasks {
6766

@@ -75,11 +74,10 @@ tasks {
7574
)
7675
}
7776
withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
78-
kotlinOptions.jvmTarget = javaVersion
79-
kotlinOptions.freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn"
80-
compilerOptions.languageVersion.set(org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9)
8177
compilerOptions {
82-
78+
languageVersion.set(KotlinVersion.KOTLIN_2_0)
79+
jvmTarget.set(JvmTarget.JVM_17)
80+
freeCompilerArgs.add("-opt-in=kotlin.RequiresOptIn")
8381
}
8482
}
8583

@@ -113,23 +111,19 @@ tasks {
113111
}
114112

115113
compileKotlin {
116-
kotlinOptions.jvmTarget = javaVersion
117-
}
118-
119-
compileTestKotlin {
120-
kotlinOptions.jvmTarget = javaVersion
114+
compilerOptions {
115+
jvmTarget.set(JvmTarget.JVM_17)
116+
}
121117
}
122118

123119
test {
124120
useJUnitPlatform()
125121
}
126122

127123
configurations.all {
128-
129124
}
130125

131126
verifyPlugin {
132-
133127
}
134128

135129
verifyPluginConfiguration {

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ kotlin.stdlib.default.dependency=true
22
kotlin.incremental.useClasspathSnapshot=false
33
#kotlin.experimental.tryK2=true
44
kapt.use.k2=true
5-
pluginVersion=4.3.1.
5+
pluginVersion=4.4.0.
66
#===============================> 231
77
#dartVersion=231.9411
88
#sinceBuildVersion=231
@@ -11,7 +11,7 @@ pluginVersion=4.3.1.
1111
#ideaType=
1212
#type=231
1313
#===============================> 232
14-
#dartVersion=232.10305
14+
#dartVersion=232.10313
1515
#sinceBuildVersion=232
1616
#untilBuildVersion=232.*
1717
#ideaVersion=2023.2.3

src/main/kotlin/shop/itbug/fluttercheckversionx/hive/component/HiveValueComponent.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class HiveValueComponent(project: Project) : BorderLayoutPanel(), DioApiService.
2020

2121

2222
///更新值
23-
private fun changeJsonValue(value: Any) {
23+
private fun changeJsonValue(value: Any?) {
2424
jsonEditor.changeValue(value)
2525
}
2626

src/main/kotlin/shop/itbug/fluttercheckversionx/linemark/PluginDartIconLineMark.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ import com.intellij.openapi.ui.popup.PopupStep
1111
import com.intellij.openapi.ui.popup.util.BaseListPopupStep
1212
import com.intellij.psi.PsiElement
1313
import com.intellij.ui.awt.RelativePoint
14-
import kotlinx.coroutines.runBlocking
15-
import org.jetbrains.yaml.psi.impl.YAMLKeyValueImpl
1614
import shop.itbug.fluttercheckversionx.actions.PUB_URL
1715
import shop.itbug.fluttercheckversionx.cache.DartPluginIgnoreConfig
1816
import shop.itbug.fluttercheckversionx.i18n.PluginBundle
@@ -27,8 +25,7 @@ import javax.swing.Icon
2725
class PluginDartIconLineMark : LineMarkerProvider {
2826

2927
override fun getLineMarkerInfo(element: PsiElement): LineMarkerInfo<PsiElement>? {
30-
val isDartPlugin = runBlocking { element.isDartPluginElement() }
31-
if (isDartPlugin && element is YAMLKeyValueImpl) {
28+
if (element.isDartPluginElement()) {
3229
return LineMarkerInfo(
3330
element.firstChild,
3431
element.firstChild.textRange,

src/main/kotlin/shop/itbug/fluttercheckversionx/setting/GeneraAssetsSettingPanel.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ import com.intellij.openapi.project.DumbAwareAction
77
import com.intellij.openapi.ui.DialogPanel
88
import com.intellij.openapi.util.Disposer
99
import com.intellij.ui.JBColor
10+
import com.intellij.ui.awt.RelativePoint
1011
import com.intellij.ui.components.JBList
1112
import com.intellij.ui.dsl.builder.bindSelected
1213
import com.intellij.ui.dsl.builder.bindText
1314
import com.intellij.ui.dsl.builder.panel
1415
import com.intellij.util.Alarm
1516
import com.intellij.util.ui.components.BorderLayoutPanel
16-
import com.intellij.vcsUtil.showAbove
1717
import shop.itbug.fluttercheckversionx.config.GenerateAssetsClassConfig
1818
import shop.itbug.fluttercheckversionx.config.GenerateAssetsClassConfigModel
1919
import shop.itbug.fluttercheckversionx.i18n.PluginBundle
@@ -68,7 +68,7 @@ class GeneraAssetsSettingPanel(
6868
object : DumbAwareAction(AllIcons.General.Add) {
6969
override fun actionPerformed(e: AnActionEvent) {
7070
WidgetUtil.getTextEditorPopup(PluginBundle.get("g.13"), "", {
71-
it.showAbove(igFilesWidget)
71+
it.show(RelativePoint.fromScreen(igFilesWidget.locationOnScreen))
7272
}) {
7373
this@GeneraAssetsSettingPanel.igFilesWidget.addItemString(it)
7474
}

src/main/kotlin/shop/itbug/fluttercheckversionx/tools/DartPluginVersionCheck.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ import com.intellij.openapi.util.TextRange
1515
import com.intellij.psi.PsiElement
1616
import com.intellij.psi.PsiFile
1717
import com.intellij.psi.PsiRecursiveElementWalkingVisitor
18-
import kotlinx.coroutines.*
18+
import kotlinx.coroutines.Deferred
19+
import kotlinx.coroutines.async
20+
import kotlinx.coroutines.awaitAll
21+
import kotlinx.coroutines.runBlocking
1922
import shop.itbug.fluttercheckversionx.cache.DartPluginIgnoreConfig
2023
import shop.itbug.fluttercheckversionx.i18n.PluginBundle
2124
import shop.itbug.fluttercheckversionx.listeners.MyLoggerEvent
@@ -62,7 +65,6 @@ class DartPluginVersionCheck : ExternalAnnotator<DartPluginVersionCheck.Input, L
6265
}
6366

6467
//执行长时间操作
65-
@OptIn(ExperimentalCoroutinesApi::class)
6668
override fun doAnnotate(collectedInfo: Input?): List<Problem> {
6769
val arr = mutableListOf<Problem>()
6870
collectedInfo?.let {
@@ -72,7 +74,7 @@ class DartPluginVersionCheck : ExternalAnnotator<DartPluginVersionCheck.Input, L
7274
key = LogKeys.checkPlugin
7375
)
7476
)
75-
val infos: List<PubVersionDataModel?> = runBlocking(Dispatchers.IO.limitedParallelism(100)) {
77+
val infos: List<PubVersionDataModel?> = runBlocking {
7678
val tasks = it.element.map { info ->
7779
val pluginName = info.packageInfo.name
7880
val r: Deferred<PubVersionDataModel?> = async {

src/main/kotlin/shop/itbug/fluttercheckversionx/util/MyPsiUtil.kt

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -192,20 +192,11 @@ fun PsiElement.exByModifyPsiElementText(newText: String) {
192192
/**
193193
* 判断此节点是否为flutter插件
194194
*/
195-
suspend fun PsiElement.isDartPluginElement(): Boolean {
196-
197-
if (this is YAMLKeyValueImpl) {
198-
val allPluginsMap = MyPsiElementUtil.getAllFlutters(project)
199-
val allPlugins = allPluginsMap.values.toList()
200-
var isin = false
201-
allPlugins.forEach { e1 ->
202-
try {
203-
e1.first { it.name == this.keyText }
204-
isin = true
205-
} catch (_: Exception) {
206-
}
207-
}
208-
return isin
195+
fun PsiElement.isDartPluginElement(): Boolean {
196+
if (this is YAMLKeyValueImpl && this.parent.parent is YAMLKeyValueImpl) {
197+
val p = this.parent.parent as YAMLKeyValueImpl
198+
val temp = p.keyText
199+
return temp == "dependencies" || temp == "dependency_overrides" || temp == "dev_dependencies"
209200
}
210201
return false
211202
}

0 commit comments

Comments
 (0)