diff --git a/build.gradle.kts b/build.gradle.kts index 7f146fa00..58f1e3a9b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -98,7 +98,7 @@ dependencies { implementation(libs.bundles.fuel) intellijPlatform { - intellijIdeaCommunity(libs.versions.intellij.ide) + intellijIdeaCommunity(libs.versions.intellij.ide, useInstaller = false) // Bundled plugin dependencies bundledPlugin("com.intellij.java") diff --git a/gradle.properties b/gradle.properties index a4fb229af..46181f6ee 100644 --- a/gradle.properties +++ b/gradle.properties @@ -19,7 +19,7 @@ # # suppress inspection "UnusedProperty" for whole file -ideaVersionName = 2024.2 +ideaVersionName = 2024.3 coreVersion = 1.8.1 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 66dc15315..6b5181bee 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -8,9 +8,9 @@ fuel = "2.3.1" licenser = "0.6.1" changelog = "2.2.0" intellij-plugin = "2.0.1" -intellij-ide = "2024.2" +intellij-ide = "243-EAP-SNAPSHOT" idea-ext = "1.1.8" -psiPlugin = "242.4697" +psiPlugin = "243.7768" [plugins] kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } @@ -39,7 +39,7 @@ jflex-skeleton = "org.jetbrains.idea:jflex:1.7.0-c1fdf11" grammarKit = "org.jetbrains.idea:grammar-kit:1.5.1" # Gradle Tooling -gradleToolingExtension = "com.jetbrains.intellij.gradle:gradle-tooling-extension:242.20224.300" +gradleToolingExtension = "com.jetbrains.intellij.gradle:gradle-tooling-extension:243-EAP-SNAPSHOT" annotations = "org.jetbrains:annotations:24.0.0" groovy = "org.codehaus.groovy:groovy:3.0.19" diff --git a/obfuscation-explorer/build.gradle.kts b/obfuscation-explorer/build.gradle.kts index 62517b9f2..aced1468b 100644 --- a/obfuscation-explorer/build.gradle.kts +++ b/obfuscation-explorer/build.gradle.kts @@ -42,7 +42,7 @@ intellijPlatform { dependencies { intellijPlatform { - intellijIdeaCommunity(libs.versions.intellij.ide) + intellijIdeaCommunity(libs.versions.intellij.ide, useInstaller = false) plugin(libs.versions.psiPlugin.map { "PsiViewer:$it" }) diff --git a/src/main/kotlin/creator/custom/finalizers/ImportGradleProjectFinalizer.kt b/src/main/kotlin/creator/custom/finalizers/ImportGradleProjectFinalizer.kt index ae4edc97c..9b730c5f7 100644 --- a/src/main/kotlin/creator/custom/finalizers/ImportGradleProjectFinalizer.kt +++ b/src/main/kotlin/creator/custom/finalizers/ImportGradleProjectFinalizer.kt @@ -24,7 +24,7 @@ import com.intellij.ide.util.projectWizard.WizardContext import com.intellij.openapi.diagnostic.thisLogger import com.intellij.openapi.project.Project import org.jetbrains.plugins.gradle.service.project.open.canLinkAndRefreshGradleProject -import org.jetbrains.plugins.gradle.service.project.open.linkAndRefreshGradleProject +import org.jetbrains.plugins.gradle.service.project.open.linkAndSyncGradleProject class ImportGradleProjectFinalizer : CreatorFinalizer { @@ -38,7 +38,7 @@ class ImportGradleProjectFinalizer : CreatorFinalizer { val canLink = canLinkAndRefreshGradleProject(projectDir, project, showValidationDialog = false) thisLogger().info("canLink = $canLink projectDir = $projectDir") if (canLink) { - linkAndRefreshGradleProject(projectDir, project) + linkAndSyncGradleProject(project, projectDir) thisLogger().info("Linking done") } } diff --git a/src/main/kotlin/platform/fabric/reference/FabricClientUseScopeEnlarger.kt b/src/main/kotlin/platform/fabric/reference/FabricClientUseScopeEnlarger.kt index 34baa571f..fef41cd83 100644 --- a/src/main/kotlin/platform/fabric/reference/FabricClientUseScopeEnlarger.kt +++ b/src/main/kotlin/platform/fabric/reference/FabricClientUseScopeEnlarger.kt @@ -23,13 +23,14 @@ package com.demonwav.mcdev.platform.fabric.reference import com.demonwav.mcdev.platform.fabric.util.FabricConstants import com.demonwav.mcdev.platform.mcp.fabricloom.FabricLoomData import com.demonwav.mcdev.util.findModule -import com.intellij.openapi.project.DumbService -import com.intellij.openapi.util.Computable +import com.intellij.openapi.application.ReadAction +import com.intellij.openapi.vfs.VirtualFile import com.intellij.psi.PsiElement import com.intellij.psi.search.FilenameIndex import com.intellij.psi.search.GlobalSearchScope import com.intellij.psi.search.SearchScope import com.intellij.psi.search.UseScopeEnlarger +import java.util.concurrent.Callable import org.jetbrains.plugins.gradle.util.GradleUtil class FabricClientUseScopeEnlarger : UseScopeEnlarger() { @@ -43,12 +44,12 @@ class FabricClientUseScopeEnlarger : UseScopeEnlarger() { if (loomData.splitMinecraftJar) { return GlobalSearchScope.filesScope(element.project) { - DumbService.getInstance(module.project).runReadActionInSmartMode( - Computable { + ReadAction.nonBlocking( + Callable> { val moduleWithDeps = GlobalSearchScope.moduleWithDependenciesScope(module) FilenameIndex.getVirtualFilesByName(FabricConstants.FABRIC_MOD_JSON, moduleWithDeps) } - ) + ).inSmartMode(element.project).executeSynchronously() } } diff --git a/src/main/kotlin/platform/forge/ForgeModule.kt b/src/main/kotlin/platform/forge/ForgeModule.kt index 57dba30b3..15d2dcf64 100644 --- a/src/main/kotlin/platform/forge/ForgeModule.kt +++ b/src/main/kotlin/platform/forge/ForgeModule.kt @@ -38,8 +38,8 @@ import com.demonwav.mcdev.util.waitForAllSmart import com.intellij.json.JsonFileType import com.intellij.lang.jvm.JvmModifier import com.intellij.openapi.application.ApplicationManager +import com.intellij.openapi.application.ReadAction import com.intellij.openapi.fileTypes.FileTypeManager -import com.intellij.openapi.project.DumbService import com.intellij.psi.JavaPsiFacade import com.intellij.psi.PsiClass import com.intellij.psi.PsiElement @@ -47,6 +47,8 @@ import com.intellij.psi.PsiMethod import com.intellij.psi.PsiMethodCallExpression import com.intellij.psi.search.GlobalSearchScope import com.intellij.psi.search.searches.AnnotatedElementsSearch +import com.intellij.util.concurrency.AppExecutorUtil +import java.util.concurrent.Callable import org.jetbrains.uast.UClass import org.jetbrains.uast.UIdentifier import org.jetbrains.uast.toUElementOfType @@ -76,25 +78,18 @@ class ForgeModule internal constructor(facet: MinecraftFacet) : AbstractModule(f } // Index @SideOnly - val service = DumbService.getInstance(project) - service.runReadActionInSmartMode runSmart@{ - if (service.isDumb || project.isDisposed) { - return@runSmart - } - - val scope = GlobalSearchScope.projectScope(project) - val sidedProxy = JavaPsiFacade.getInstance(project) - .findClass(ForgeConstants.SIDED_PROXY_ANNOTATION, scope) ?: return@runSmart - val annotatedFields = AnnotatedElementsSearch.searchPsiFields(sidedProxy, scope).findAll() - - for (field in annotatedFields) { - if (service.isDumb || project.isDisposed) { - return@runSmart + ReadAction.nonBlocking( + Callable { + val scope = GlobalSearchScope.projectScope(project) + val sidedProxy = JavaPsiFacade.getInstance(project) + .findClass(ForgeConstants.SIDED_PROXY_ANNOTATION, scope) ?: return@Callable + val annotatedFields = AnnotatedElementsSearch.searchPsiFields(sidedProxy, scope).findAll() + + for (field in annotatedFields) { + SidedProxyAnnotator.check(field) } - - SidedProxyAnnotator.check(field) } - } + ).inSmartMode(project).submit(AppExecutorUtil.getAppExecutorService()) } } diff --git a/src/main/kotlin/translations/lang/spellcheck/LangKeySplitter.kt b/src/main/kotlin/translations/lang/spellcheck/LangKeySplitter.kt index aa8e0ee92..fb4bb8343 100644 --- a/src/main/kotlin/translations/lang/spellcheck/LangKeySplitter.kt +++ b/src/main/kotlin/translations/lang/spellcheck/LangKeySplitter.kt @@ -20,6 +20,7 @@ package com.demonwav.mcdev.translations.lang.spellcheck +import com.intellij.openapi.progress.ProgressManager import com.intellij.openapi.util.TextRange import com.intellij.spellchecker.inspections.BaseSplitter import com.intellij.spellchecker.inspections.IdentifierSplitter @@ -37,7 +38,7 @@ object LangKeySplitter : BaseSplitter() { var index = range.startOffset for (codepoint in codepoints) { - checkCancelled() + ProgressManager.checkCanceled() // Use full text with the correct range idSplitter.split(text, TextRange.from(index, codepoint.length), consumer) diff --git a/src/main/kotlin/update/Channels.kt b/src/main/kotlin/update/Channels.kt index e51d40aa3..ac02b9948 100644 --- a/src/main/kotlin/update/Channels.kt +++ b/src/main/kotlin/update/Channels.kt @@ -27,6 +27,6 @@ enum class Channels(val title: String, val url: String) { ; fun hasChannel(): Boolean { - return UpdateSettings.getInstance().pluginHosts.contains(url) + return UpdateSettings.getInstance().storedPluginHosts.contains(url) } } diff --git a/src/test/kotlin/framework/ProjectBuilderTest.kt b/src/test/kotlin/framework/ProjectBuilderTest.kt index daf2f0f08..362e787f3 100644 --- a/src/test/kotlin/framework/ProjectBuilderTest.kt +++ b/src/test/kotlin/framework/ProjectBuilderTest.kt @@ -30,7 +30,6 @@ import com.intellij.testFramework.fixtures.JavaTestFixtureFactory import com.intellij.testFramework.fixtures.TempDirTestFixture import com.intellij.testFramework.fixtures.impl.LightTempDirTestFixtureImpl import kotlin.reflect.KClass -import org.junit.ComparisonFailure import org.junit.jupiter.api.AfterEach import org.junit.jupiter.api.BeforeEach @@ -69,13 +68,6 @@ abstract class ProjectBuilderTest(descriptor: LightProjectDescriptor? = null) { @AfterEach fun tearDown() { - try { - fixture.tearDown() - } catch (e: ComparisonFailure) { - // For some reason this failure started to happen since 2024.2, but has visibly no bad side effect so far? - if (e.message?.startsWith("Code style settings damaged") != true) { - throw e - } - } + fixture.tearDown() } }