Skip to content

Commit bcb911e

Browse files
committed
Fix another doing slow operation on EDT issue.
Version 1.24.10.
1 parent 3127131 commit bcb911e

File tree

4 files changed

+17
-16
lines changed

4 files changed

+17
-16
lines changed

CHANGES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
### 1.24.10
2+
* Fix another doing slow operation on EDT issue.
3+
14
### 1.24.9
25
* Fix doing slow operation on EDT issues.
36

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
pluginGroup = com.gmail.blueboxware
22
pluginName = LibGDX Plugin
3-
pluginVersion = 1.24.9
3+
pluginVersion = 1.24.10
44

55
pluginSinceBuild = 233.11799.300
66
pluginUntilBuild =

src/main/kotlin/com/gmail/blueboxware/libgdxplugin/settings/LibGDXProjectFileSubstitutions.kt

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import com.intellij.openapi.components.Service
77
import com.intellij.openapi.components.State
88
import com.intellij.openapi.fileTypes.FileType
99
import com.intellij.openapi.fileTypes.impl.FileTypeOverrider
10-
import com.intellij.openapi.project.ProjectLocator
10+
import com.intellij.openapi.project.ProjectManager
1111
import com.intellij.openapi.vfs.VfsUtilCore
1212
import com.intellij.openapi.vfs.VirtualFile
1313

@@ -47,22 +47,20 @@ internal class LibGDXFileTypeOverrider : FileTypeOverrider {
4747

4848
override fun getOverriddenFileType(file: VirtualFile): FileType? {
4949

50-
val locator = ProjectLocator.getInstance()
51-
val project = try {
52-
locator.guessProjectForFile(file)
53-
} catch (e: UnsupportedOperationException) {
54-
null
55-
} ?: return null
50+
val projectManager = ProjectManager.getInstanceIfCreated() ?: return null
5651

5752
val url = VfsUtilCore.pathToUrl(file.path)
58-
project.getService(LibGDXProjectSkinFiles::class.java)?.let {
59-
if (it.contains(url)) {
60-
return LibGDXSkinFileType
53+
54+
for (project in projectManager.openProjects) {
55+
project.getService(LibGDXProjectSkinFiles::class.java)?.let {
56+
if (it.contains(url)) {
57+
return LibGDXSkinFileType
58+
}
6159
}
62-
}
63-
project.getService(LibGDXProjectGdxJsonFiles::class.java)?.let {
64-
if (it.contains(url)) {
65-
return LibGDXJsonFileType
60+
project.getService(LibGDXProjectGdxJsonFiles::class.java)?.let {
61+
if (it.contains(url)) {
62+
return LibGDXJsonFileType
63+
}
6664
}
6765
}
6866

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
<change-notes><![CDATA[
3333
<ul>
34-
<li>Fix doing slow operation on EDT issues.</li>
34+
<li>Fix another doing slow operation on EDT issue.</li>
3535
</ul>
3636
]]>
3737
</change-notes>

0 commit comments

Comments
 (0)