Skip to content

Commit 777dcfb

Browse files
committed
Version 1.27.1.
Fix #45: Freeze when creating Enum.
1 parent 06b55ce commit 777dcfb

File tree

17 files changed

+72
-149
lines changed

17 files changed

+72
-149
lines changed

CHANGES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
### 1.27.1
2+
* Fix [#45](https://github.com/BlueBoxWare/LibGDXPlugin/issues/45): Freeze when creating Enum
3+
14
### 1.27
25
* gdxAI behaviour trees: Proper indentation handling, (re)formatting support, code style support, toggle comments, small improvements.
36

build.gradle.kts

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@ import org.jetbrains.grammarkit.tasks.GenerateLexerTask
33
import org.jetbrains.grammarkit.tasks.GenerateParserTask
44
import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType
55
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
6+
import org.jetbrains.intellij.platform.gradle.tasks.PrepareSandboxTask
67
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
78

89
plugins {
910
id("java")
1011
id("maven-publish")
11-
id("org.jetbrains.kotlin.jvm") version "2.1.20"
12+
id("org.jetbrains.kotlin.jvm") version "2.3.0"
1213
id("com.github.blueboxware.tocme") version "1.8"
1314
id("org.jetbrains.intellij.platform") version "2.10.5"
14-
id("org.jetbrains.grammarkit") version "2022.3.2.2"
15+
id("org.jetbrains.grammarkit") version "2023.3.0.1"
1516
}
1617

1718
group = providers.gradleProperty("pluginGroup").get()
@@ -139,6 +140,33 @@ tasks {
139140
archiveVersion.set(providers.gradleProperty("pluginVersion"))
140141
}
141142

143+
withType<PrepareSandboxTask> {
144+
doLast {
145+
val trustedPathsFile = sandboxConfigDirectory.file("options/trusted-paths.xml").get().asFile
146+
147+
trustedPathsFile.writeText(
148+
"""
149+
<application>
150+
<component name="Trusted.Paths.Settings">
151+
<option name="TRUSTED_PATHS">
152+
<list>
153+
<option value="${'$'}USER_HOME$/projects" />
154+
</list>
155+
</option>
156+
</component>
157+
<component name="Trusted.Paths.Settings">
158+
<option name="TRUSTED_PATHS">
159+
<list>
160+
<option value="${'$'}USER_HOME$/temp" />
161+
</list>
162+
</option>
163+
</component>
164+
</application>
165+
""".trimIndent()
166+
)
167+
}
168+
}
169+
142170
fun generateParserTask(path: String, lexer: String, parser: String) {
143171
val name = path.uppercaseFirstChar()
144172
val bnfTask = register<GenerateParserTask>("generate${name}Parser") {

gradle.properties

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
pluginGroup = com.gmail.blueboxware
22
pluginName = LibGDX
3-
pluginVersion = 1.27
3+
pluginVersion = 1.27.1
44

55
pluginSinceBuild = 252.27397.103
6+
#pluginSinceBuild = 253.29346.138
67

78
# https://www.jetbrains.com/intellij-repository/snapshots/
89
# https://www.jetbrains.com/intellij-repository/releases/
910
# gradle printProductsReleases
1011

1112
platformVersion = 252.27397.103
13+
#platformVersion = 2025.3.1
1214

1315
platformBundledPlugins = com.intellij.java, org.jetbrains.kotlin, com.intellij.properties, com.intellij.modules.json
1416
platformBundledModules = intellij.spellchecker, intellij.properties.backend.psi

src/main/kotlin/com/gmail/blueboxware/libgdxplugin/SkinTagsChangeListener.kt

Lines changed: 0 additions & 63 deletions
This file was deleted.

src/main/kotlin/com/gmail/blueboxware/libgdxplugin/SkinTagsFileListener.kt

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/main/kotlin/com/gmail/blueboxware/libgdxplugin/filetypes/skin/actions/CreateColorAction.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ class CreateColorAction : SimpleCodeInsightAction() {
5959
return
6060
}
6161

62-
ColorChooserService.instance.showDialog(editor.component, "Choose Color To Create", JBColor.WHITE, true)
62+
ColorChooserService.instance
63+
.showDialog(editor.component, "Choose Color To Create", JBColor.WHITE, true)
6364
?.let { color ->
6465
ApplicationManager.getApplication().runWriteAction {
6566
file.addColor(result.first, color = color, useComponents = result.second ?: false)

src/main/kotlin/com/gmail/blueboxware/libgdxplugin/utils/TagUtils.kt

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
package com.gmail.blueboxware.libgdxplugin.utils
22

33
import com.intellij.codeInsight.AnnotationUtil
4-
import com.intellij.openapi.components.Service
5-
import com.intellij.openapi.components.service
64
import com.intellij.openapi.project.Project
75
import com.intellij.openapi.roots.ProjectRootManager
86
import com.intellij.openapi.util.RecursionManager
9-
import com.intellij.openapi.util.SimpleModificationTracker
107
import com.intellij.openapi.util.text.StringUtil
118
import com.intellij.psi.*
129
import com.intellij.psi.impl.source.PsiImmediateClassType
1310
import com.intellij.psi.search.searches.AnnotatedElementsSearch
1411
import com.intellij.psi.search.searches.ClassInheritorsSearch
1512
import com.intellij.psi.search.searches.ReferencesSearch
1613
import com.intellij.psi.util.CachedValue
14+
import com.intellij.psi.util.PsiModificationTracker
1715
import org.jetbrains.kotlin.analysis.api.analyze
1816
import org.jetbrains.kotlin.analysis.api.types.KaClassType
1917
import org.jetbrains.kotlin.asJava.elements.KtLightElement
@@ -52,31 +50,10 @@ internal const val PROPERTY_NAME_TINTED_DRAWABLE_COLOR = "color"
5250

5351
private val KEY = key<CachedValue<TagMap?>>("tag2classMap")
5452

55-
@Service(Service.Level.PROJECT)
56-
class SkinTagsModificationTracker : SimpleModificationTracker() {
57-
58-
var isFresh: Boolean = false
59-
private set
60-
61-
override fun getModificationCount(): Long {
62-
isFresh = false
63-
return super.getModificationCount()
64-
}
65-
66-
override fun incModificationCount() {
67-
isFresh = true
68-
super.incModificationCount()
69-
}
70-
71-
companion object {
72-
fun getInstance(project: Project) = project.service<SkinTagsModificationTracker>()
73-
}
74-
}
75-
7653
internal fun Project.getSkinTag2ClassMap(): TagMap? =
7754
getCachedValue(
7855
KEY,
79-
SkinTagsModificationTracker.getInstance(this),
56+
PsiModificationTracker.MODIFICATION_COUNT,
8057
ProjectRootManager.getInstance(this)
8158
) {
8259

src/main/resources/META-INF/plugin.xml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
<change-notes><![CDATA[
3232
<ul>
33-
<li>gdxAI behaviour trees: Proper indentation handling, (re)formatting support, code style support, toggle comments, small improvements.</li>
33+
<li>Fix #45: Freeze when creating Enum</li>
3434
</ul>
3535
]]>
3636
</change-notes>
@@ -48,8 +48,6 @@
4848
<projectListeners>
4949
<listener class="com.gmail.blueboxware.libgdxplugin.GwtOutdatedListener"
5050
topic="com.intellij.openapi.vfs.newvfs.BulkFileListener"/>
51-
<listener class="com.gmail.blueboxware.libgdxplugin.SkinTagsFileListener"
52-
topic="com.intellij.openapi.vfs.newvfs.BulkFileListener"/>
5351
</projectListeners>
5452

5553
<extensions defaultExtensionNs="com.intellij">
@@ -209,8 +207,6 @@
209207
<annotator language="LibGDXSkin"
210208
implementationClass="com.gmail.blueboxware.libgdxplugin.filetypes.skin.annotators.SkinErrorsAnnotator"/>
211209

212-
<psi.treeChangeListener implementation="com.gmail.blueboxware.libgdxplugin.SkinTagsChangeListener"/>
213-
214210
<fileType
215211
name="libGDX Skin"
216212
language="LibGDXSkin"

src/test/kotlin/com/gmail/blueboxware/libgdxplugin/ShowInfo.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class ShowInfo : LibGDXCodeInsightFixtureTestCase() {
2929

3030
@Suppress("ReplacePrintlnWithLogging")
3131
fun testShowInfo() {
32+
println()
3233
println("IntelliJ version: " + ApplicationInfo.getInstance().fullVersion)
3334
println("IntelliJ build: " + ApplicationInfo.getInstance().build)
3435
println("Kotlin version: " + KotlinVersion.CURRENT)

src/test/kotlin/com/gmail/blueboxware/libgdxplugin/Utils.kt

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,21 @@ internal fun loadAtlas(file: Atlas2File): TextureAtlas {
106106
}
107107
}
108108
r.getFieldList()
109-
.filter { it.key !in listOf("xy", "size", "bounds", "offset", "orig", "offsets", "rotate", "index") }
109+
.filter {
110+
it.getKey() !in listOf(
111+
"xy",
112+
"size",
113+
"bounds",
114+
"offset",
115+
"orig",
116+
"offsets",
117+
"rotate",
118+
"index"
119+
)
120+
}
110121
.forEach { field ->
111-
names.add(field.key)
112-
values.add(field.values.map { it.toIntOrNull() ?: 0 })
122+
names.add(field.getKey())
123+
values.add(field.getValues().map { it.toIntOrNull() ?: 0 })
113124
}
114125

115126
if (region.originalWidth == 0 && region.originalHeight == 0) {

0 commit comments

Comments
 (0)