From 6c1b2934934926f6c1ca04a76c08bb4d352fb8bd Mon Sep 17 00:00:00 2001 From: Oleg Kizeev Date: Thu, 16 Nov 2023 14:08:48 +0700 Subject: [PATCH] Fixed qodana warning --- .../slint/ideaplugin/lang/SlintLanguage.kt | 3 ++- .../lang/psi/SlintElementFactory.kt | 22 ------------------- .../lang/psi/SlintNameIdentifierOwner.kt | 5 ----- 3 files changed, 2 insertions(+), 28 deletions(-) delete mode 100644 src/main/kotlin/dev/slint/ideaplugin/lang/psi/SlintElementFactory.kt delete mode 100644 src/main/kotlin/dev/slint/ideaplugin/lang/psi/SlintNameIdentifierOwner.kt diff --git a/src/main/kotlin/dev/slint/ideaplugin/lang/SlintLanguage.kt b/src/main/kotlin/dev/slint/ideaplugin/lang/SlintLanguage.kt index 4137397..aff5730 100644 --- a/src/main/kotlin/dev/slint/ideaplugin/lang/SlintLanguage.kt +++ b/src/main/kotlin/dev/slint/ideaplugin/lang/SlintLanguage.kt @@ -1,9 +1,10 @@ package dev.slint.ideaplugin.lang -import com.intellij.json.JsonLanguage import com.intellij.lang.Language object SlintLanguage : Language("Slint") { + private fun readResolve(): Any = SlintLanguage + val INSTANCE = SlintLanguage override fun getDisplayName(): String = "Slint" diff --git a/src/main/kotlin/dev/slint/ideaplugin/lang/psi/SlintElementFactory.kt b/src/main/kotlin/dev/slint/ideaplugin/lang/psi/SlintElementFactory.kt deleted file mode 100644 index 6ba93e1..0000000 --- a/src/main/kotlin/dev/slint/ideaplugin/lang/psi/SlintElementFactory.kt +++ /dev/null @@ -1,22 +0,0 @@ -//package dev.slint.ideaplugin.lang.psi -// -//import com.intellij.openapi.project.Project -//import com.intellij.psi.PsiElement -//import com.intellij.psi.PsiFileFactory -//import com.intellij.psi.util.PsiTreeUtil -//import dev.slint.ideaplugin.lang.SlintLanguage -//import org.jetbrains.annotations.NonNls -// -//object SlintElementFactory { -// fun createFile(project: Project, @NonNls text: String): SlintFile = -// PsiFileFactory.getInstance(project).createFileFromText( -// "dummy.Slint", SlintLanguage, text, false, true -// ) as SlintFile -// -// private inline fun createElement(project: Project, text: String): T? = -// PsiTreeUtil.findChildOfType(createFile(project, text), T::class.java, true) -// -// fun createIdentifier(project: Project, name: String): PsiElement = -// createElement(project, "model $name {}")?.nameIdentifier -// ?: error("Invalid identifier: $name") -//} \ No newline at end of file diff --git a/src/main/kotlin/dev/slint/ideaplugin/lang/psi/SlintNameIdentifierOwner.kt b/src/main/kotlin/dev/slint/ideaplugin/lang/psi/SlintNameIdentifierOwner.kt deleted file mode 100644 index 38682a0..0000000 --- a/src/main/kotlin/dev/slint/ideaplugin/lang/psi/SlintNameIdentifierOwner.kt +++ /dev/null @@ -1,5 +0,0 @@ -package dev.slint.ideaplugin.lang.psi - -import com.intellij.psi.PsiNameIdentifierOwner - -interface SlintNameIdentifierOwner : SlintNamedElement, PsiNameIdentifierOwner \ No newline at end of file