⁠
kyle wood: Fix up all duplicaate code warnings
Also messed up the ktlint configuration trying to upgrade it, but future
versions are still a broken mess. Sorry about that.
Also messed up the ktlint configuration trying to upgrade it, but future
versions are still a broken mess. Sorry about that.
- /*
- * Minecraft Dev for IntelliJ
- *
- * https://minecraftdev.org
- *
- * Copyright (c) 2023 minecraft-dev
- *
- * MIT License
- */
- package com.demonwav.mcdev.platform.mixin.reference.target
- import com.intellij.codeInsight.navigation.actions.GotoDeclarationHandler
- import com.intellij.openapi.editor.Editor
- import com.intellij.psi.PsiElement
- import com.intellij.psi.PsiLiteral
- import com.intellij.psi.util.parentOfType
- class TargetGTDHandler : GotoDeclarationHandler {
- override fun getGotoDeclarationTargets(
- sourceElement: PsiElement?,
- offset: Int,
- editor: Editor?
- ): Array<PsiElement>? {
- if (sourceElement == null) return null
- val stringLiteral = sourceElement.parentOfType<PsiLiteral>() ?: return null
- if (!TargetReference.ELEMENT_PATTERN.accepts(stringLiteral)) {
- return null
- }
- return TargetReference.resolveNavigationTargets(stringLiteral)
- }
- }
- /*
- * Minecraft Dev for IntelliJ
- *
- * https://minecraftdev.org
- *
- * Copyright (c) 2023 minecraft-dev
- *
- * MIT License
- */
- package com.demonwav.mcdev.platform.mixin.reference.target
- import com.intellij.codeInsight.navigation.actions.GotoDeclarationHandler
- import com.intellij.openapi.editor.Editor
- import com.intellij.psi.PsiElement
- import com.intellij.psi.PsiLiteral
- import com.intellij.psi.util.parentOfType
- class TargetGTDHandler : GotoDeclarationHandler {
- override fun getGotoDeclarationTargets(
- sourceElement: PsiElement?,
- offset: Int,
- editor: Editor?,
- ): Array<PsiElement>? {
- if (sourceElement == null) return null
- val stringLiteral = sourceElement.parentOfType<PsiLiteral>() ?: return null
- if (!TargetReference.ELEMENT_PATTERN.accepts(stringLiteral)) {
- return null
- }
- return TargetReference.resolveNavigationTargets(stringLiteral)
- }
- }