Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,18 @@ dependencies {
implementation(libs.jspecify)

intellijPlatform {
intellijIdeaCommunity(libs.versions.intellij.ide) {
intellijIdea(libs.versions.intellij.ide) {
useInstaller = false
}

// Bundled plugin dependencies
bundledPlugin("com.intellij.java")
bundledPlugin("org.jetbrains.idea.maven")
bundledPlugin("com.intellij.gradle")
bundledPlugin("org.jetbrains.idea.reposearch")
bundledPlugin("org.intellij.groovy")
bundledPlugin("ByteCodeViewer")
bundledPlugin("org.intellij.intelliLang")
bundledModule("intellij.platform.langInjection")
bundledPlugin("com.intellij.properties")
bundledPlugin("Git4Idea")
bundledPlugin("com.intellij.modules.json")
Expand Down
1 change: 0 additions & 1 deletion buildSrc/src/main/kotlin/mcdev-publishing.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ tasks.publishPlugin {

false -> PluginRepositoryFactory.create(host.get(), token.get())
}
@Suppress("DEPRECATION")
val uploadBean = repositoryClient.uploader.uploadUpdateByXmlIdAndFamily(
id = pluginId,
family = ProductFamily.INTELLIJ,
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# https://mcdev.io/
#
# Copyright (C) 2025 minecraft-dev
# Copyright (C) 2026 minecraft-dev
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
Expand All @@ -21,7 +21,7 @@
# suppress inspection "UnusedProperty" for whole file
org.gradle.jvmargs=-Xmx1g

ideaVersionName = 2025.2
ideaVersionName = 2026.1

coreVersion = 1.8.15

Expand Down
6 changes: 3 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[versions]
# https://github.com/JetBrains/intellij-community/blob/<version>/.idea/libraries/kotlin_stdlib.xml
kotlin = "2.2.0-RC2"
kotlin = "2.3.20-RC2"
# https://github.com/JetBrains/intellij-community/blob/<version>/.idea/libraries/kotlinx_coroutines_core.xml
coroutines = "1.10.2"
junit = "6.0.3"
Expand All @@ -14,7 +14,7 @@ intellij-plugin = "2.13.1"
intellij-plugin-repository-rest-client = "2.0.50"
# https://www.jetbrains.com/intellij-repository/snapshots or https://www.jetbrains.com/intellij-repository/releases/
# Search for com.jetbrains.intellij.idea
intellij-ide = "2025.2"
intellij-ide = "261.22158.277"
# https://github.com/JetBrains/gradle-idea-ext-plugin
idea-ext = "1.4.1"

Expand Down Expand Up @@ -51,7 +51,7 @@ grammarKit = "org.jetbrains.idea:grammar-kit:1.5.1"
# Gradle Tooling
# https://www.jetbrains.com/intellij-repository/snapshots or https://www.jetbrains.com/intellij-repository/releases/
# Search for com.jetbrains.intellij.gradle
gradleToolingExtension = { module = "com.jetbrains.intellij.gradle:gradle-tooling-extension", version = "252.23892.409" }
gradleToolingExtension = { module = "com.jetbrains.intellij.gradle:gradle-tooling-extension", version = "253.29346.138" }
annotations = "org.jetbrains:annotations:26.1.0"
groovy = "org.codehaus.groovy:groovy:3.0.25"

Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/creator/buildsystem/maven-steps.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* https://mcdev.io/
*
* Copyright (C) 2025 minecraft-dev
* Copyright (C) 2026 minecraft-dev
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
Expand Down Expand Up @@ -195,7 +195,7 @@ class MavenImportStep(parent: NewProjectWizardStep) : AbstractLongRunningStep(pa
val templateConfig = mavenConfigFactory.createTemplateConfiguration(project)
val runConfiguration = mavenConfigFactory.createConfiguration(runConfigName, templateConfig)
as MavenRunConfiguration
runConfiguration.runnerParameters.goals.add(task)
runConfiguration.runnerParameters.goals = listOf(task)
runConfiguration.runnerParameters.workingDirPath = context.projectDirectory.toString()

runConfiguration.isAllowRunningInParallel = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* https://mcdev.io/
*
* Copyright (C) 2025 minecraft-dev
* Copyright (C) 2026 minecraft-dev
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
Expand Down Expand Up @@ -43,7 +43,7 @@ import com.intellij.ui.dsl.builder.bindItem
import com.intellij.ui.dsl.builder.bindSelected
import com.intellij.ui.dsl.builder.bindText
import com.intellij.util.ui.AsyncProcessIcon
import fleet.multiplatform.shims.ConcurrentHashMap
import java.util.concurrent.ConcurrentHashMap
import java.util.function.Function
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/creator/step/AbstractReformatFilesStep.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* https://mcdev.io/
*
* Copyright (C) 2025 minecraft-dev
* Copyright (C) 2026 minecraft-dev
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
Expand Down Expand Up @@ -50,7 +50,7 @@ abstract class AbstractReformatFilesStep(parent: NewProjectWizardStep) : Abstrac

val rootDir = VfsUtil.findFile(Path.of(context.projectFileDirectory), true) ?: return
val psiManager = PsiManager.getInstance(project)
val files = ReadAction.compute<Array<PsiFile>, Throwable> {
val files = ReadAction.computeBlocking<Array<PsiFile>, Throwable> {
filesToReformat.mapNotNull { path ->
VfsUtil.findRelativeFile(rootDir, *path.split('/').toTypedArray())?.let(psiManager::findFile)
}.toTypedArray()
Expand Down
35 changes: 3 additions & 32 deletions src/main/kotlin/facet/MinecraftFacet.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* https://mcdev.io/
*
* Copyright (C) 2025 minecraft-dev
* Copyright (C) 2026 minecraft-dev
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
Expand Down Expand Up @@ -36,11 +36,8 @@ import com.intellij.facet.FacetTypeId
import com.intellij.facet.FacetTypeRegistry
import com.intellij.ide.projectView.ProjectView
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.application.runReadAction
import com.intellij.openapi.application.runWriteAction
import com.intellij.openapi.module.Module
import com.intellij.openapi.module.ModuleGrouper
import com.intellij.openapi.module.ModuleManager
import com.intellij.openapi.roots.ModuleRootManager
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.psi.PsiClass
Expand Down Expand Up @@ -227,14 +224,14 @@ class MinecraftFacet(
fun findFile(path: String, type: SourceType): VirtualFile? {
try {
return findFile0(path, type)
} catch (ignored: RefreshRootsException) {
} catch (_: RefreshRootsException) {
}

updateRoots()

return try {
findFile0(path, type)
} catch (ignored: RefreshRootsException) {
} catch (_: RefreshRootsException) {
// Well we tried our best
null
}
Expand Down Expand Up @@ -268,32 +265,6 @@ class MinecraftFacet(

fun getInstance(module: Module) = FacetManager.getInstance(module).getFacetByType(ID)

fun getChildInstances(module: Module) = runReadAction run@{
val instance = getInstance(module)
if (instance != null) {
return@run setOf(instance)
}

val project = module.project
val manager = ModuleManager.getInstance(project)
val grouper = ModuleGrouper.instanceFor(project)

val result = mutableSetOf<MinecraftFacet>()

val modulePath = grouper.getModuleAsGroupPath(module) ?: return@run result

for (m in manager.modules) {
val path = grouper.getGroupPath(m)
if (modulePath != path) {
continue
}

val facet = getInstance(m) ?: continue
result.add(facet)
}
return@run result
}

fun <T : AbstractModule> getInstance(module: Module, type: AbstractModuleType<T>) =
getInstance(module)?.getModuleOfType(type)

Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/insight/ColorLineMarkerProvider.kt
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class ColorLineMarkerProvider : LineMarkerProvider {
}

val actionText = MCDevBundle("generate.color.choose_action")
val c = ColorChooserService.instance.showDialog(psiElement.project, editor.component, actionText, color)
val c = ColorChooserService.getInstance().showDialog(psiElement.project, editor.component, actionText, color)
?: return@handler
when (workElement) {
is ULiteralExpression -> {
Expand Down
5 changes: 3 additions & 2 deletions src/main/kotlin/insight/generation/EventGenHelper.kt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import com.intellij.psi.PsiElement
import com.intellij.psi.PsiFile
import com.intellij.psi.codeStyle.CodeStyleManager
import com.intellij.psi.util.parentOfType
import org.jetbrains.kotlin.K1Deprecation
import org.jetbrains.kotlin.analysis.api.KaIdeApi
import org.jetbrains.kotlin.idea.base.analysis.api.utils.shortenReferences
import org.jetbrains.kotlin.idea.base.analysis.api.utils.shortenReferencesInRange
Expand Down Expand Up @@ -114,7 +115,7 @@ class KotlinEventGenHelper : EventGenHelper {
val entry = factory.createSuperTypeEntry(fqn)
val insertedEntry = ktClass.addSuperTypeListEntry(entry)
when (KotlinPluginModeProvider.currentPluginMode) {
KotlinPluginMode.K1 -> ShortenReferences.DEFAULT.process(insertedEntry)
KotlinPluginMode.K1 -> @OptIn(K1Deprecation::class) ShortenReferences.DEFAULT.process(insertedEntry)
// TODO find a non-internal alternative to this...
KotlinPluginMode.K2 -> @OptIn(KaIdeApi::class) shortenReferences(insertedEntry)
}
Expand All @@ -128,7 +129,7 @@ class KotlinEventGenHelper : EventGenHelper {

val marker = JvmEventGenHelper.doReformat(project, file, startOffset, endOffset) ?: return
when (KotlinPluginModeProvider.currentPluginMode) {
KotlinPluginMode.K1 -> ShortenReferences.DEFAULT.process(file, marker.startOffset, marker.endOffset)
KotlinPluginMode.K1 -> @OptIn(K1Deprecation::class) ShortenReferences.DEFAULT.process(file, marker.startOffset, marker.endOffset)
// TODO find a non-internal alternative to this...
KotlinPluginMode.K2 -> @OptIn(KaIdeApi::class) shortenReferencesInRange(file, marker.textRange)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* https://mcdev.io/
*
* Copyright (C) 2025 minecraft-dev
* Copyright (C) 2026 minecraft-dev
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
Expand All @@ -27,7 +27,7 @@ import com.demonwav.mcdev.util.manipulator
import com.demonwav.mcdev.util.mapFirstNotNull
import com.demonwav.mcdev.util.reference.InspectionReference
import com.intellij.json.psi.JsonStringLiteral
import com.intellij.openapi.application.runReadAction
import com.intellij.openapi.application.runReadActionBlocking
import com.intellij.openapi.module.Module
import com.intellij.openapi.module.ModuleManager
import com.intellij.openapi.module.ModuleUtilCore
Expand Down Expand Up @@ -98,7 +98,7 @@ class ResourceFileReference(
}

val variants = mutableListOf<Any>()
runReadAction {
runReadActionBlocking {
val relevantModules = getRelevantModules()

val relevantRootTypes = mutableSetOf(JavaResourceRootType.RESOURCE)
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/platform/mcp/ct/CtCompletionContributor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import com.intellij.codeInsight.completion.CompletionType
import com.intellij.codeInsight.completion.InsertionContext
import com.intellij.codeInsight.completion.PrioritizedLookupElement
import com.intellij.codeInsight.lookup.LookupElementBuilder
import com.intellij.openapi.application.runReadAction
import com.intellij.openapi.application.runReadActionBlocking
import com.intellij.patterns.PlatformPatterns
import com.intellij.psi.PsiDocumentManager
import com.intellij.psi.TokenType
Expand Down Expand Up @@ -63,7 +63,7 @@ private fun insertWhitespace(context: InsertionContext) {
context.document.insertString(context.editor.caretModel.offset, " ")
context.editor.caretModel.moveCaretRelatively(1, 0, false, false, false)
context.setLaterRunnable {
runReadAction {
runReadActionBlocking {
CodeCompletionHandlerBase.createHandler(CompletionType.BASIC)
.invokeCompletion(context.project, context.editor)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* https://mcdev.io/
*
* Copyright (C) 2025 minecraft-dev
* Copyright (C) 2026 minecraft-dev
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
Expand All @@ -21,7 +21,7 @@
package com.demonwav.mcdev.platform.mcp.vanillagradle

import com.demonwav.mcdev.platform.mcp.gradle.tooling.vanillagradle.VanillaGradleModel
import com.intellij.openapi.application.runReadAction
import com.intellij.openapi.application.runReadActionBlocking
import com.intellij.openapi.externalSystem.model.DataNode
import com.intellij.openapi.externalSystem.model.project.ModuleData
import org.gradle.tooling.model.idea.IdeaModule
Expand All @@ -35,7 +35,7 @@ class VanillaGradleProjectResolverExtension : AbstractProjectResolverExtension()
override fun getToolingExtensionsClasses() = extraProjectModelClasses

override fun populateModuleExtraModels(gradleModule: IdeaModule, ideModule: DataNode<ModuleData>) {
val vgData = runReadAction {
val vgData = runReadActionBlocking {
resolverCtx.getExtraProject(gradleModule, VanillaGradleModel::class.java)
}
if (vgData != null && vgData.hasVanillaGradle()) {
Expand Down
8 changes: 4 additions & 4 deletions src/main/kotlin/platform/mixin/action/FindMixinsAction.kt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import com.intellij.openapi.actionSystem.CommonDataKeys.CARET
import com.intellij.openapi.actionSystem.CommonDataKeys.PROJECT
import com.intellij.openapi.actionSystem.CommonDataKeys.PSI_FILE
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.application.runReadAction
import com.intellij.openapi.application.runReadActionBlocking
import com.intellij.openapi.progress.ProgressIndicator
import com.intellij.openapi.progress.runBackgroundableTask
import com.intellij.openapi.project.Project
Expand Down Expand Up @@ -89,13 +89,13 @@ class FindMixinsAction : AnAction() {
runBackgroundableTask("Searching for Mixins", project, true) run@{ indicator ->
indicator.isIndeterminate = true

val classes = runReadAction {
val classes = runReadActionBlocking {
if (!targetClass.isValid) {
return@runReadAction null
return@runReadActionBlocking null
}

val classes = findMixins(targetClass, project, indicator)?.filter(filter)
?: return@runReadAction null
?: return@runReadActionBlocking null

when (classes.size) {
0 -> null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class InjectionPointTypedHandlerDelegate : TypedHandlerDelegate() {
if (charTyped != ':' || !file.language.isKindOf(JavaLanguage.INSTANCE)) {
return Result.CONTINUE
}
AutoPopupController.getInstance(project).autoPopupMemberLookup(editor) {
AutoPopupController.getInstance(project).scheduleAutoPopup(editor) {
val offset = editor.caretModel.offset
val element = it.findElementAt(offset)?.findContextElement()
InjectionPointReference.ELEMENT_PATTERN.accepts(element)
Expand Down
9 changes: 5 additions & 4 deletions src/main/kotlin/platform/mixin/debug/MixinPositionManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* https://mcdev.io/
*
* Copyright (C) 2025 minecraft-dev
* Copyright (C) 2026 minecraft-dev
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
Expand Down Expand Up @@ -33,7 +33,7 @@ import com.intellij.debugger.engine.PositionManagerImpl.ClsSourcePosition
import com.intellij.debugger.impl.DebuggerUtilsEx
import com.intellij.debugger.requests.ClassPrepareRequestor
import com.intellij.ide.highlighter.JavaFileType
import com.intellij.openapi.application.runReadAction
import com.intellij.openapi.application.runReadActionBlocking
import com.intellij.openapi.fileTypes.FileType
import com.intellij.openapi.project.Project
import com.intellij.openapi.vfs.VirtualFileManager
Expand All @@ -47,6 +47,7 @@ import com.sun.jdi.request.ClassPrepareRequest

class MixinPositionManager(private val debugProcess: DebugProcess) : MultiRequestPositionManager {

@Deprecated("Deprecated in Java")
override fun getAcceptedFileTypes(): Set<FileType> = setOf(JavaFileType.INSTANCE)

@Throws(NoDataException::class)
Expand Down Expand Up @@ -106,7 +107,7 @@ class MixinPositionManager(private val debugProcess: DebugProcess) : MultiReques
}

override fun getAllClasses(classPosition: SourcePosition): List<ReferenceType> {
return runReadAction {
return runReadActionBlocking {
findMatchingClasses(classPosition)
.flatMap { name -> debugProcess.virtualMachineProxy.classesByName(name).asSequence() }
.toList()
Expand Down Expand Up @@ -137,7 +138,7 @@ class MixinPositionManager(private val debugProcess: DebugProcess) : MultiReques
requestor: ClassPrepareRequestor,
position: SourcePosition,
): List<ClassPrepareRequest> {
return runReadAction {
return runReadActionBlocking {
findMatchingClasses(position)
.mapNotNull { name -> debugProcess.requestsManager.createClassPrepareRequest(requestor, name) }
.toList()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ class MEExpressionAnnotator : Annotator {
hostEditor.caretModel.moveToOffset(dummy.textOffset)
PsiDocumentManager.getInstance(project).doPostponedOperationsAndUnblockDocument(hostEditor.document)
hostEditor.document.replaceString(dummy.textRange.startOffset, dummy.textRange.endOffset, "")
AutoPopupController.getInstance(project).autoPopupMemberLookup(hostEditor, null)
AutoPopupController.getInstance(project).scheduleAutoPopup(hostEditor, null)
}
}
}
Loading
Loading