Skip to content

Commit

Permalink
Fixes for latest EAP breaking changes
Browse files Browse the repository at this point in the history
  • Loading branch information
RedNesto committed Jul 2, 2023
1 parent 404d31e commit 9fe419c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 16 deletions.
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ tasks.test {
}
}
systemProperty("NO_FS_ROOTS_ACCESS_CHECK", "true")
systemProperty("java.awt.headless", "true")

jvmArgs(
"-Dsun.io.useCanonCaches=false",
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
# suppress inspection "UnusedProperty" for whole file
kotlin.code.style=official

ideaVersion = 232-EAP-SNAPSHOT
ideaVersion = 232.8453.116-EAP-SNAPSHOT
ideaVersionName = 2023.2

coreVersion = 1.6.6
downloadIdeaSources = true

pluginTomlVersion = 232.5150.113
pluginTomlVersion = 232.8453.111

# Silences a build-time warning because we are bundling our own kotlin library
kotlin.stdlib.default.dependency = false
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import com.intellij.codeInsight.daemon.GutterIconNavigationHandler
import com.intellij.codeInsight.daemon.LineMarkerInfo
import com.intellij.codeInsight.daemon.LineMarkerProviderDescriptor
import com.intellij.codeInsight.hint.HintManager
import com.intellij.codeInsight.navigation.NavigationUtil
import com.intellij.codeInsight.navigation.getPsiElementPopup
import com.intellij.openapi.editor.markup.GutterIconRenderer
import com.intellij.openapi.fileEditor.FileEditorManager
import com.intellij.psi.PsiAnnotation
Expand Down Expand Up @@ -111,10 +111,10 @@ class MixinTargetLineMarkerProvider : LineMarkerProviderDescriptor() {
}
else -> {
if (editor != null) {
NavigationUtil.getPsiElementPopup(targets.toTypedArray(), "Choose Target")
getPsiElementPopup(targets.toTypedArray(), "Choose Target")
.showInBestPositionFor(editor)
} else {
NavigationUtil.getPsiElementPopup(targets.toTypedArray(), "Choose Target")
getPsiElementPopup(targets.toTypedArray(), "Choose Target")
.show(RelativePoint(e))
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class SpongePluginClassInspection : AbstractBaseJavaLocalInspectionTool() {
classIdentifier,
"Plugin class must have an empty constructor or an @Inject constructor.",
ProblemHighlightType.GENERIC_ERROR,
AddDefaultConstructorFix(aClass),
AddDefaultConstructorFix(aClass).asQuickFix(),
)
}
}
Expand Down
11 changes: 1 addition & 10 deletions src/main/kotlin/util/class-utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,13 @@ package com.demonwav.mcdev.util

import com.intellij.codeInsight.daemon.impl.quickfix.AddMethodFix
import com.intellij.navigation.AnonymousElementProvider
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.project.Project
import com.intellij.psi.CommonClassNames
import com.intellij.psi.JavaPsiFacade
import com.intellij.psi.PsiClass
import com.intellij.psi.PsiClassType
import com.intellij.psi.PsiElement
import com.intellij.psi.PsiField
import com.intellij.psi.PsiFile
import com.intellij.psi.PsiInvalidElementAccessException
import com.intellij.psi.PsiJavaFile
import com.intellij.psi.PsiMethod
Expand Down Expand Up @@ -228,14 +226,7 @@ fun PsiClass.addImplements(qualifiedClassName: String) {
* Adds the given method to this class, or its copy. Returns the method actually added
*/
fun PsiClass.addMethod(template: PsiMethod): PsiMethod? {
var theNewMethod: PsiMethod? = null
object : AddMethodFix(template, this) {
override fun postAddAction(file: PsiFile, editor: Editor?, newMethod: PsiMethod?) {
theNewMethod = newMethod
super.postAddAction(file, editor, newMethod)
}
}.applyFix()
return theNewMethod
return AddMethodFix(template, this).createMethod(this)
}

fun PsiClass.findMatchingMethod(
Expand Down

0 comments on commit 9fe419c

Please sign in to comment.