Skip to content

Commit

Permalink
2024.3 EAP
Browse files Browse the repository at this point in the history
  • Loading branch information
RedNesto committed Sep 12, 2024
1 parent 07d1a7c commit 44ffaaa
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 42 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#

# suppress inspection "UnusedProperty" for whole file
ideaVersionName = 2024.2
ideaVersionName = 2024.3

coreVersion = 1.8.1

Expand Down
6 changes: 3 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion obfuscation-explorer/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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" })

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand All @@ -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")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -43,12 +44,12 @@ class FabricClientUseScopeEnlarger : UseScopeEnlarger() {

if (loomData.splitMinecraftJar) {
return GlobalSearchScope.filesScope(element.project) {
DumbService.getInstance(module.project).runReadActionInSmartMode(
Computable {
ReadAction.nonBlocking(
Callable<Collection<VirtualFile>> {
val moduleWithDeps = GlobalSearchScope.moduleWithDependenciesScope(module)
FilenameIndex.getVirtualFilesByName(FabricConstants.FABRIC_MOD_JSON, moduleWithDeps)
}
)
).inSmartMode(element.project).executeSynchronously()
}
}

Expand Down
31 changes: 13 additions & 18 deletions src/main/kotlin/platform/forge/ForgeModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,17 @@ 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
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
Expand Down Expand Up @@ -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())
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/update/Channels.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
10 changes: 1 addition & 9 deletions src/test/kotlin/framework/ProjectBuilderTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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()
}
}

0 comments on commit 44ffaaa

Please sign in to comment.