diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 40949ff6..cc4e7d06 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,23 +14,8 @@ jobs: strategy: matrix: - product: [ "IC-211", "IC-212", "IC-213", "IC-221", "IC-222", "IC-223", "IC-231", "IC-232", "IC-233", "IC-241", "IC-242" ] + product: [ "IC-223", "IC-231", "IC-232", "IC-233", "IC-241" ] include: - - product: "IC-211" - java: "11" - distribution: "adopt" - - product: "IC-212" - java: "11" - distribution: "adopt" - - product: "IC-213" - java: "11" - distribution: "adopt" - - product: "IC-221" - java: "11" - distribution: "adopt" - - product: "IC-222" - java: "11" - distribution: "adopt" - product: "IC-223" java: "17" distribution: "temurin" @@ -46,9 +31,9 @@ jobs: - product: "IC-241" java: "17" distribution: "temurin" - - product: "IC-242" - java: "17" - distribution: "temurin" +# - product: "IC-242" +# java: "17" +# distribution: "temurin" max-parallel: 10 fail-fast: false diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 427a0e5a..4abe3001 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -12,23 +12,8 @@ jobs: strategy: matrix: - product: [ "IC-211", "IC-212", "IC-213", "IC-221", "IC-222", "IC-223", "IC-231", "IC-232", "IC-233", "IC-241", "IC-242" ] + product: [ "IC-223", "IC-231", "IC-232", "IC-233", "IC-241" ] include: - - product: "IC-211" - java: "11" - distribution: "adopt" - - product: "IC-212" - java: "11" - distribution: "adopt" - - product: "IC-213" - java: "11" - distribution: "adopt" - - product: "IC-221" - java: "11" - distribution: "adopt" - - product: "IC-222" - java: "11" - distribution: "adopt" - product: "IC-223" java: "17" distribution: "temurin" @@ -44,9 +29,9 @@ jobs: - product: "IC-241" java: "17" distribution: "temurin" - - product: "IC-242" - java: "17" - distribution: "temurin" +# - product: "IC-242" +# java: "17" +# distribution: "temurin" max-parallel: 10 fail-fast: false diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b2d763f8..17cd6161 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,23 +8,8 @@ jobs: strategy: matrix: - product: [ "IC-211", "IC-212", "IC-213", "IC-221", "IC-222", "IC-223", "IC-231", "IC-232", "IC-233", "IC-241", "IC-242" ] + product: [ "IC-223", "IC-231", "IC-232", "IC-233", "IC-241" ] include: - - product: "IC-211" - java: "11" - distribution: "adopt" - - product: "IC-212" - java: "11" - distribution: "adopt" - - product: "IC-213" - java: "11" - distribution: "adopt" - - product: "IC-221" - java: "11" - distribution: "adopt" - - product: "IC-222" - java: "11" - distribution: "adopt" - product: "IC-223" java: "17" distribution: "temurin" @@ -40,9 +25,9 @@ jobs: - product: "IC-241" java: "17" distribution: "temurin" - - product: "IC-242" - java: "17" - distribution: "temurin" +# - product: "IC-242" +# java: "17" +# distribution: "temurin" max-parallel: 1 runs-on: ubuntu-latest diff --git a/.gitignore b/.gitignore index 4b7d0541..57da5d6a 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,4 @@ system-test/ /system/ .DS_Store +.intellijPlatform diff --git a/build.gradle.kts b/build.gradle.kts index 256813b5..b205cef1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,31 +1,15 @@ -buildscript { - repositories { - mavenCentral() - } -} - -@Suppress("DSL_SCOPE_VIOLATION") plugins { java - alias(libs.plugins.kotlin.jvm) - alias(libs.plugins.intellij) -} - -repositories { - mavenCentral() - mavenLocal() - maven("https://oss.sonatype.org/content/repositories/snapshots") - maven("https://www.jetbrains.com/intellij-repository/snapshots") + kotlin("jvm").version("1.9.23") + id("org.jetbrains.intellij.platform") } - data class PluginDescriptor( val since: String, // earliest version string this is compatible with val until: String, // latest version string this is compatible with, can be wildcard like 202.* // https://github.com/JetBrains/gradle-intellij-plugin#intellij-platform-properties - val sdkVersion: String, // the version string passed to the intellij sdk gradle plugin + val intellijVersion: String, // the version string passed to the intellijIdeaCommunity dependency val sourceFolder: String, // used as the source root for specifics of this build - val deps: List // dependent plugins of this plugin ) // https://jetbrains.org/intellij/sdk/docs/basics/getting_started/build_number_ranges.html @@ -37,6 +21,8 @@ data class PluginDescriptor( // https://data.services.jetbrains.com/products?fields=code,name,releases.downloads,releases.version,releases.build,releases.type&code=IIU // when releasing for an EAP, look at snapshots and see the column called build number // https://www.jetbrains.com/intellij-repository/snapshots +// more versions here: +// https://data.services.jetbrains.com/products?code=IC // for the sdk version we can use IC-2021.1 if the product is released // or IC-213-EAP-SNAPSHOT if not @@ -45,115 +31,71 @@ data class PluginDescriptor( // and 'until' we can use a wildcard eg 213.* val plugins = listOf( - PluginDescriptor( - since = "211.6693.111", // this version is 2021.1 - until = "211.*", - sdkVersion = "IC-2021.1", - sourceFolder = "IC-211", - deps = listOf("java", "org.jetbrains.plugins.gradle", "org.jetbrains.kotlin") - ), - PluginDescriptor( - since = "212.3116.43", // this version is 2021.2 - until = "212.*", - sdkVersion = "IC-2021.2.3", - sourceFolder = "IC-212", - deps = listOf("java", "org.jetbrains.plugins.gradle", "org.jetbrains.kotlin") - ), - PluginDescriptor( - since = "213.3714", // this version is 2021.3 - until = "213.*", - sdkVersion = "IC-2021.3", - sourceFolder = "IC-213", - deps = listOf("java", "org.jetbrains.plugins.gradle", "org.jetbrains.kotlin:213-1.6.10-release-923-IJ5744.223") - ), - PluginDescriptor( - since = "221.3427.89", // this version is 2022.1 - until = "221.*", - sdkVersion = "IC-2022.1", - sourceFolder = "IC-221", - deps = listOf("java", "org.jetbrains.plugins.gradle", "org.jetbrains.kotlin") - ), - PluginDescriptor( - since = "222.2270.16", // this version is 2022.2 - until = "222.*", - sdkVersion = "IC-2022.2", - sourceFolder = "IC-222", - deps = listOf("java", "org.jetbrains.plugins.gradle", "org.jetbrains.kotlin") - ), PluginDescriptor( since = "223.4884.69", // this version is 2022.3 until = "223.*", - sdkVersion = "IC-2022.3", + intellijVersion = "2022.3", sourceFolder = "IC-223", - deps = listOf("java", "org.jetbrains.plugins.gradle", "org.jetbrains.kotlin") ), PluginDescriptor( since = "231.8109.163", // this version is 2023.1 release until = "231.*", - sdkVersion = "IC-2023.1", + intellijVersion = "2023.1", sourceFolder = "IC-231", - deps = listOf("java", "org.jetbrains.plugins.gradle", "org.jetbrains.kotlin") ), PluginDescriptor( since = "232.5150.116", // this version is 2023.2 until = "232.*", - sdkVersion = "IC-2023.2", + intellijVersion = "2023.2", sourceFolder = "IC-232", - deps = listOf("java", "org.jetbrains.plugins.gradle", "org.jetbrains.kotlin") ), PluginDescriptor( since = "233.9802.16", // this version is 2023.3 until = "233.*", - sdkVersion = "IC-2023.3", + intellijVersion = "2023.3", sourceFolder = "IC-233", - deps = listOf("java", "org.jetbrains.plugins.gradle", "org.jetbrains.kotlin") ), PluginDescriptor( since = "241.15989.150", // this version is 2024.1 - until = "241.*", - sdkVersion = "IC-2024.1.1", - sourceFolder = "IC-241", - deps = listOf("java", "org.jetbrains.plugins.gradle", "org.jetbrains.kotlin") - ), - PluginDescriptor( - since = "241.17011.108", // this version is 2024.2 until = "242.*", - sdkVersion = "241.17011-EAP-CANDIDATE-SNAPSHOT", - sourceFolder = "IC-242", - deps = listOf("java", "org.jetbrains.plugins.gradle", "org.jetbrains.kotlin") + intellijVersion = "2024.1.1", + sourceFolder = "IC-241", ), + // this is broken until the next release of the gradle plugin +// PluginDescriptor( +// since = "242.12881.66", // this version is 2024.2 +// until = "243.*", +// intellijVersion = "242.12881.66", +// sourceFolder = "IC-242", +// ), ) -val productName = System.getenv("PRODUCT_NAME") ?: "IC-242" -val jvmTarget = System.getenv("JVM_TARGET") ?: "11" -val descriptor = plugins.first { it.sourceFolder == productName } +val productName = System.getenv("PRODUCT_NAME") ?: "IC-241" +val jvmTargetVersion = System.getenv("JVM_TARGET") ?: "11" +val descriptor = plugins.firstOrNull { it.sourceFolder == productName } ?: error("SDK not found $productName") val jetbrainsToken: String by project -version = "1.3." + (System.getenv("GITHUB_RUN_NUMBER") ?: "0-SNAPSHOT") - -intellij { - sandboxDir.set(project.property("sandbox").toString()) -// sandboxDir.set("./sandbox") - version.set(descriptor.sdkVersion) - pluginName.set("kotest-plugin-intellij") - plugins.addAll(*descriptor.deps.toTypedArray()) - downloadSources.set(true) - type.set("IC") - updateSinceUntilBuild.set(false) -} +version = "1.4." + (System.getenv("GITHUB_RUN_NUMBER") ?: "0-SNAPSHOT") dependencies { + implementation(libs.jaxb.api) implementation(libs.javax.activation) + intellijPlatform { + intellijIdeaCommunity(descriptor.intellijVersion) + bundledPlugin("com.intellij.java") + bundledPlugin("org.jetbrains.kotlin") + } + // we bundle this for 4.1 support - // in kotest 4.2.0 the launcher has moved to a stand alone module + // in kotest 4.2.0 the launcher has moved to a standalone module implementation(libs.runtime.kotest.legacy.launcher) // this is needed to use the launcher in 4.2.0, in 4.2.1+ the launcher is built // into the engine dep which should already be on the classpath - implementation(libs.runtime.kotest.framework.launcher) + implementation(libs.kotest.framework.launcher) // needed for the resource files which are loaded into java light tests testImplementation(libs.test.kotest.framework.api) @@ -172,37 +114,67 @@ sourceSets { } } +intellijPlatform { + buildSearchableOptions = true + instrumentCode = false + projectName = "Kotest Plugin" + sandboxContainer.set(project.projectDir) + pluginConfiguration { + name.set("kotest-plugin-intellij") + description.set("Plugin for Kotest for Intellij") + version.set("${project.version}-${descriptor.intellijVersion}") + ideaVersion { + sinceBuild = descriptor.since + untilBuild = descriptor.until + } + } + + publishing { + token.set(System.getenv("JETBRAINS_TOKEN") ?: jetbrainsToken) + } + + verifyPlugin { + } +} + tasks { compileKotlin { kotlinOptions { - jvmTarget = jvmTarget + jvmTarget = jvmTargetVersion } } withType { kotlinOptions { - jvmTarget = jvmTarget + jvmTarget = jvmTargetVersion } } - buildPlugin { - archiveClassifier.set(descriptor.sdkVersion) + java { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } - publishPlugin { - token.set(System.getenv("JETBRAINS_TOKEN") ?: jetbrainsToken) - } - - patchPluginXml { - version.set("${project.version}-${descriptor.sdkVersion}") - sinceBuild.set(descriptor.since) - untilBuild.set(descriptor.until) - } +// tasks { +// printProductsReleases { +// channels = listOf(ProductRelease.Channel.EAP) +// types = listOf(IntelliJPlatformType.IntellijIdeaCommunity) +// untilBuild = provider { null } +// +// doLast { +// val latestEap = productsReleases.get().max() +// } +// } +// } + +// buildPlugin { +// archiveClassifier.set(descriptor.sdkVersion) +// } test { isScanForTestClasses = false - // Only run tests from classes that end with "Test" +// Only run tests from classes that end with "Test" include("**/*Test.class") include("**/*Tests.class") } diff --git a/gradle.properties b/gradle.properties index b571e4f7..24f45094 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,21 @@ jetbrainsToken=xx # this is the version used for the plugin upload -version=1.1.0 +version=1.4.0 org.gradle.caching=true sandbox = /tmp/ + +# Taken from https://github.com/catppuccin/jetbrains-icons/blob/main/gradle.properties +kotlin.stdlib.default.dependency=false +#pluginGroup=com.github.catppuccin.jetbrains_icons +#pluginName=Catppuccin Icons +#pluginVersion=1.5.0 +#pluginSinceBuild=231 +#pluginUntilBuild=241.* +#platformType=IC +#platformVersion=2023.1 +#platformPlugins=org.jetbrains.kotlin,com.intellij.java +#javaVersion=17 +#gradleVersion=8.7 +#buildSearchableOptions.enabled=false diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml deleted file mode 100644 index 249d1e9d..00000000 --- a/gradle/libs.versions.toml +++ /dev/null @@ -1,20 +0,0 @@ -[versions] -kotlin = "1.9.23" -runtime-kotest = "4.2.0" -# We separate these from the actual runtime dependencies -test-kotest = "5.8.1" - -[libraries] -runtime-kotest-framework-launcher = { module = "io.kotest:kotest-framework-launcher", version.ref = "runtime-kotest" } -runtime-kotest-legacy-launcher = { module = "io.kotest:kotest-launcher", version = "1.0.10" } - -# Separate these from the Kotest libraries that will go into the plugin release -test-kotest-assertions-core = { module = "io.kotest:kotest-assertions-core", version.ref = "test-kotest" } -test-kotest-framework-api = { module = "io.kotest:kotest-framework-api", version.ref = "test-kotest" } - -jaxb-api = { module = "javax.xml.bind:jaxb-api", version = "2.3.1" } -javax-activation = { module = "javax.activation:activation", version = "1.1.1" } - -[plugins] -kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } -intellij = { id = "org.jetbrains.intellij", version = "1.17.3" } diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 00000000..947604af --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,31 @@ +import org.jetbrains.intellij.platform.gradle.extensions.intellijPlatform + +////import org.jetbrains.intellij.platform.gradle.extensions.intellijPlatform + +plugins { + id("org.jetbrains.intellij.platform.settings") version "2.0.0-beta5" +} + +dependencyResolutionManagement { + repositories { + mavenCentral() + mavenLocal() + maven("https://oss.sonatype.org/content/repositories/snapshots/") + maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") + intellijPlatform { + defaultRepositories() + } + } + versionCatalogs { + create("libs") { + library("runtime-kotest-legacy-launcher", "io.kotest:kotest-launcher:1.0.10") + library("kotest-framework-launcher", "io.kotest:kotest-framework-launcher:4.2.0") + // Separate these from the Kotest libraries that will go into the plugin release + // these are the versions used to TEST the plugin + library("test-kotest-assertions-core", "io.kotest:kotest-assertions-core:5.8.1") + library("test-kotest-framework-api", "io.kotest:kotest-framework-api:5.8.1") + library("jaxb-api", "javax.xml.bind:jaxb-api:2.3.1") + library("javax-activation", "javax.activation:activation:1.1.1") + } + } +} diff --git a/src/IC-211/kotlin/io/kotest/plugin/intellij/contentFactory.kt b/src/IC-211/kotlin/io/kotest/plugin/intellij/contentFactory.kt deleted file mode 100644 index 1e0b5eaf..00000000 --- a/src/IC-211/kotlin/io/kotest/plugin/intellij/contentFactory.kt +++ /dev/null @@ -1,5 +0,0 @@ -package io.kotest.plugin.intellij - -import com.intellij.ui.content.ContentFactory - -fun getContentFactory(): ContentFactory = ContentFactory.SERVICE.getInstance() diff --git a/src/IC-211/kotlin/io/kotest/plugin/intellij/files.kt b/src/IC-211/kotlin/io/kotest/plugin/intellij/files.kt deleted file mode 100644 index 947aaef9..00000000 --- a/src/IC-211/kotlin/io/kotest/plugin/intellij/files.kt +++ /dev/null @@ -1,31 +0,0 @@ -package io.kotest.plugin.intellij - -import com.intellij.execution.PsiLocation -import com.intellij.openapi.project.Project -import com.intellij.openapi.vfs.VirtualFile -import com.intellij.psi.PsiElement -import com.intellij.psi.search.FilenameIndex -import com.intellij.psi.search.GlobalSearchScope -import io.kotest.plugin.intellij.psi.elementAtLine -import io.kotest.plugin.intellij.psi.isTestFile -import io.kotest.plugin.intellij.psi.toPsiLocation -import io.kotest.plugin.intellij.toolwindow.TagsFilename - -fun findFiles(project: Project): List { - return FilenameIndex - .getVirtualFilesByName(project, TagsFilename, false, GlobalSearchScope.allScope(project)) - .toList() -} - -fun getLocationForFile( - project: Project, - scope: GlobalSearchScope, - name: String, - lineNumber: Int -): PsiLocation? { - return FilenameIndex - .getFilesByName(project, name, scope) - .firstOrNull { it.isTestFile() } - ?.elementAtLine(lineNumber) - ?.toPsiLocation() -} diff --git a/src/IC-211/kotlin/io/kotest/plugin/intellij/findeditor.kt b/src/IC-211/kotlin/io/kotest/plugin/intellij/findeditor.kt deleted file mode 100644 index b0de1883..00000000 --- a/src/IC-211/kotlin/io/kotest/plugin/intellij/findeditor.kt +++ /dev/null @@ -1,6 +0,0 @@ -package io.kotest.plugin.intellij - -import com.intellij.psi.PsiElement -import org.jetbrains.kotlin.idea.inspections.findExistingEditor - -fun PsiElement.existingEditor() = this.findExistingEditor() diff --git a/src/IC-211/kotlin/io/kotest/plugin/intellij/fqnames.kt b/src/IC-211/kotlin/io/kotest/plugin/intellij/fqnames.kt deleted file mode 100644 index 6e075001..00000000 --- a/src/IC-211/kotlin/io/kotest/plugin/intellij/fqnames.kt +++ /dev/null @@ -1,7 +0,0 @@ -package io.kotest.plugin.intellij - -import org.jetbrains.kotlin.idea.search.getKotlinFqName -import org.jetbrains.kotlin.name.FqName -import org.jetbrains.kotlin.psi.KtClassOrObject - -fun KtClassOrObject.fqname(): FqName? = this.getKotlinFqName() diff --git a/src/IC-211/kotlin/io/kotest/plugin/intellij/inspectionsuper.kt b/src/IC-211/kotlin/io/kotest/plugin/intellij/inspectionsuper.kt deleted file mode 100644 index 503e26e1..00000000 --- a/src/IC-211/kotlin/io/kotest/plugin/intellij/inspectionsuper.kt +++ /dev/null @@ -1,5 +0,0 @@ -package io.kotest.plugin.intellij - -import org.jetbrains.kotlin.idea.inspections.AbstractKotlinInspection - -abstract class AbstractInspection : AbstractKotlinInspection() diff --git a/src/IC-211/kotlin/io/kotest/plugin/intellij/markers.kt b/src/IC-211/kotlin/io/kotest/plugin/intellij/markers.kt deleted file mode 100644 index 6bd63cde..00000000 --- a/src/IC-211/kotlin/io/kotest/plugin/intellij/markers.kt +++ /dev/null @@ -1,18 +0,0 @@ -package io.kotest.plugin.intellij - -import com.intellij.codeInsight.daemon.LineMarkerInfo -import com.intellij.openapi.editor.markup.GutterIconRenderer -import com.intellij.openapi.editor.markup.MarkupEditorFilter -import com.intellij.openapi.editor.markup.MarkupEditorFilterFactory -import com.intellij.psi.PsiElement -import com.intellij.util.Functions -import javax.swing.Icon - -/** - * A Line marker that does not appear in diffs - */ -class MainEditorLineMarkerInfo(element: PsiElement, text: String, icon: Icon) : LineMarkerInfo( - element, element.textRange, icon, Functions.constant(text), null, GutterIconRenderer.Alignment.LEFT, { text } -) { - override fun getEditorFilter(): MarkupEditorFilter = MarkupEditorFilterFactory.createIsNotDiffFilter() -} diff --git a/src/IC-211/resources/META-INF/plugin.xml b/src/IC-211/resources/META-INF/plugin.xml deleted file mode 100644 index 3be5c693..00000000 --- a/src/IC-211/resources/META-INF/plugin.xml +++ /dev/null @@ -1,110 +0,0 @@ - - - kotest-plugin-intellij - Kotest - - Kotest - - Kotest.

- This plugin requires the use of Kotest 4.2.0 or newer. - ]]>
- - - 1.0.0 - - - org.jetbrains.kotlin - com.intellij.modules.java - org.jetbrains.plugins.gradle - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - io.kotest.plugin.intellij.intentions.SoftAssertIntention - Kotlin/Test - SoftAssertIntention - - - - io.kotest.plugin.intellij.intentions.BangIntention - Kotlin/Test - BangIntention - - - - io.kotest.plugin.intellij.intentions.ShouldThrowIntention - Kotlin/Test - ShouldThrowIntention - - - - io.kotest.plugin.intellij.intentions.ShouldThrowAnyIntention - Kotlin/Test - ShouldThrowAnyIntention - - - - io.kotest.plugin.intellij.intentions.ShouldThrowExactlyIntention - Kotlin/Test - ShouldThrowExactlyIntention - - - -
diff --git a/src/IC-212/kotlin/io/kotest/plugin/intellij/contentFactory.kt b/src/IC-212/kotlin/io/kotest/plugin/intellij/contentFactory.kt deleted file mode 100644 index 1e0b5eaf..00000000 --- a/src/IC-212/kotlin/io/kotest/plugin/intellij/contentFactory.kt +++ /dev/null @@ -1,5 +0,0 @@ -package io.kotest.plugin.intellij - -import com.intellij.ui.content.ContentFactory - -fun getContentFactory(): ContentFactory = ContentFactory.SERVICE.getInstance() diff --git a/src/IC-212/kotlin/io/kotest/plugin/intellij/files.kt b/src/IC-212/kotlin/io/kotest/plugin/intellij/files.kt deleted file mode 100644 index 947aaef9..00000000 --- a/src/IC-212/kotlin/io/kotest/plugin/intellij/files.kt +++ /dev/null @@ -1,31 +0,0 @@ -package io.kotest.plugin.intellij - -import com.intellij.execution.PsiLocation -import com.intellij.openapi.project.Project -import com.intellij.openapi.vfs.VirtualFile -import com.intellij.psi.PsiElement -import com.intellij.psi.search.FilenameIndex -import com.intellij.psi.search.GlobalSearchScope -import io.kotest.plugin.intellij.psi.elementAtLine -import io.kotest.plugin.intellij.psi.isTestFile -import io.kotest.plugin.intellij.psi.toPsiLocation -import io.kotest.plugin.intellij.toolwindow.TagsFilename - -fun findFiles(project: Project): List { - return FilenameIndex - .getVirtualFilesByName(project, TagsFilename, false, GlobalSearchScope.allScope(project)) - .toList() -} - -fun getLocationForFile( - project: Project, - scope: GlobalSearchScope, - name: String, - lineNumber: Int -): PsiLocation? { - return FilenameIndex - .getFilesByName(project, name, scope) - .firstOrNull { it.isTestFile() } - ?.elementAtLine(lineNumber) - ?.toPsiLocation() -} diff --git a/src/IC-212/kotlin/io/kotest/plugin/intellij/findeditor.kt b/src/IC-212/kotlin/io/kotest/plugin/intellij/findeditor.kt deleted file mode 100644 index b0de1883..00000000 --- a/src/IC-212/kotlin/io/kotest/plugin/intellij/findeditor.kt +++ /dev/null @@ -1,6 +0,0 @@ -package io.kotest.plugin.intellij - -import com.intellij.psi.PsiElement -import org.jetbrains.kotlin.idea.inspections.findExistingEditor - -fun PsiElement.existingEditor() = this.findExistingEditor() diff --git a/src/IC-212/kotlin/io/kotest/plugin/intellij/fqnames.kt b/src/IC-212/kotlin/io/kotest/plugin/intellij/fqnames.kt deleted file mode 100644 index e926393d..00000000 --- a/src/IC-212/kotlin/io/kotest/plugin/intellij/fqnames.kt +++ /dev/null @@ -1,7 +0,0 @@ -package io.kotest.plugin.intellij - -import org.jetbrains.kotlin.idea.refactoring.fqName.getKotlinFqName -import org.jetbrains.kotlin.name.FqName -import org.jetbrains.kotlin.psi.KtClassOrObject - -fun KtClassOrObject.fqname(): FqName? = this.getKotlinFqName() diff --git a/src/IC-212/kotlin/io/kotest/plugin/intellij/inspectionsuper.kt b/src/IC-212/kotlin/io/kotest/plugin/intellij/inspectionsuper.kt deleted file mode 100644 index 503e26e1..00000000 --- a/src/IC-212/kotlin/io/kotest/plugin/intellij/inspectionsuper.kt +++ /dev/null @@ -1,5 +0,0 @@ -package io.kotest.plugin.intellij - -import org.jetbrains.kotlin.idea.inspections.AbstractKotlinInspection - -abstract class AbstractInspection : AbstractKotlinInspection() diff --git a/src/IC-212/kotlin/io/kotest/plugin/intellij/markers.kt b/src/IC-212/kotlin/io/kotest/plugin/intellij/markers.kt deleted file mode 100644 index 6bd63cde..00000000 --- a/src/IC-212/kotlin/io/kotest/plugin/intellij/markers.kt +++ /dev/null @@ -1,18 +0,0 @@ -package io.kotest.plugin.intellij - -import com.intellij.codeInsight.daemon.LineMarkerInfo -import com.intellij.openapi.editor.markup.GutterIconRenderer -import com.intellij.openapi.editor.markup.MarkupEditorFilter -import com.intellij.openapi.editor.markup.MarkupEditorFilterFactory -import com.intellij.psi.PsiElement -import com.intellij.util.Functions -import javax.swing.Icon - -/** - * A Line marker that does not appear in diffs - */ -class MainEditorLineMarkerInfo(element: PsiElement, text: String, icon: Icon) : LineMarkerInfo( - element, element.textRange, icon, Functions.constant(text), null, GutterIconRenderer.Alignment.LEFT, { text } -) { - override fun getEditorFilter(): MarkupEditorFilter = MarkupEditorFilterFactory.createIsNotDiffFilter() -} diff --git a/src/IC-212/resources/META-INF/plugin.xml b/src/IC-212/resources/META-INF/plugin.xml deleted file mode 100644 index 3be5c693..00000000 --- a/src/IC-212/resources/META-INF/plugin.xml +++ /dev/null @@ -1,110 +0,0 @@ - - - kotest-plugin-intellij - Kotest - - Kotest - - Kotest.

- This plugin requires the use of Kotest 4.2.0 or newer. - ]]>
- - - 1.0.0 - - - org.jetbrains.kotlin - com.intellij.modules.java - org.jetbrains.plugins.gradle - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - io.kotest.plugin.intellij.intentions.SoftAssertIntention - Kotlin/Test - SoftAssertIntention - - - - io.kotest.plugin.intellij.intentions.BangIntention - Kotlin/Test - BangIntention - - - - io.kotest.plugin.intellij.intentions.ShouldThrowIntention - Kotlin/Test - ShouldThrowIntention - - - - io.kotest.plugin.intellij.intentions.ShouldThrowAnyIntention - Kotlin/Test - ShouldThrowAnyIntention - - - - io.kotest.plugin.intellij.intentions.ShouldThrowExactlyIntention - Kotlin/Test - ShouldThrowExactlyIntention - - - -
diff --git a/src/IC-213/kotlin/io/kotest/plugin/intellij/contentFactory.kt b/src/IC-213/kotlin/io/kotest/plugin/intellij/contentFactory.kt deleted file mode 100644 index 1e0b5eaf..00000000 --- a/src/IC-213/kotlin/io/kotest/plugin/intellij/contentFactory.kt +++ /dev/null @@ -1,5 +0,0 @@ -package io.kotest.plugin.intellij - -import com.intellij.ui.content.ContentFactory - -fun getContentFactory(): ContentFactory = ContentFactory.SERVICE.getInstance() diff --git a/src/IC-213/kotlin/io/kotest/plugin/intellij/files.kt b/src/IC-213/kotlin/io/kotest/plugin/intellij/files.kt deleted file mode 100644 index 947aaef9..00000000 --- a/src/IC-213/kotlin/io/kotest/plugin/intellij/files.kt +++ /dev/null @@ -1,31 +0,0 @@ -package io.kotest.plugin.intellij - -import com.intellij.execution.PsiLocation -import com.intellij.openapi.project.Project -import com.intellij.openapi.vfs.VirtualFile -import com.intellij.psi.PsiElement -import com.intellij.psi.search.FilenameIndex -import com.intellij.psi.search.GlobalSearchScope -import io.kotest.plugin.intellij.psi.elementAtLine -import io.kotest.plugin.intellij.psi.isTestFile -import io.kotest.plugin.intellij.psi.toPsiLocation -import io.kotest.plugin.intellij.toolwindow.TagsFilename - -fun findFiles(project: Project): List { - return FilenameIndex - .getVirtualFilesByName(project, TagsFilename, false, GlobalSearchScope.allScope(project)) - .toList() -} - -fun getLocationForFile( - project: Project, - scope: GlobalSearchScope, - name: String, - lineNumber: Int -): PsiLocation? { - return FilenameIndex - .getFilesByName(project, name, scope) - .firstOrNull { it.isTestFile() } - ?.elementAtLine(lineNumber) - ?.toPsiLocation() -} diff --git a/src/IC-213/kotlin/io/kotest/plugin/intellij/findeditor.kt b/src/IC-213/kotlin/io/kotest/plugin/intellij/findeditor.kt deleted file mode 100644 index b0de1883..00000000 --- a/src/IC-213/kotlin/io/kotest/plugin/intellij/findeditor.kt +++ /dev/null @@ -1,6 +0,0 @@ -package io.kotest.plugin.intellij - -import com.intellij.psi.PsiElement -import org.jetbrains.kotlin.idea.inspections.findExistingEditor - -fun PsiElement.existingEditor() = this.findExistingEditor() diff --git a/src/IC-213/kotlin/io/kotest/plugin/intellij/fqnames.kt b/src/IC-213/kotlin/io/kotest/plugin/intellij/fqnames.kt deleted file mode 100644 index e926393d..00000000 --- a/src/IC-213/kotlin/io/kotest/plugin/intellij/fqnames.kt +++ /dev/null @@ -1,7 +0,0 @@ -package io.kotest.plugin.intellij - -import org.jetbrains.kotlin.idea.refactoring.fqName.getKotlinFqName -import org.jetbrains.kotlin.name.FqName -import org.jetbrains.kotlin.psi.KtClassOrObject - -fun KtClassOrObject.fqname(): FqName? = this.getKotlinFqName() diff --git a/src/IC-213/kotlin/io/kotest/plugin/intellij/inspectionsuper.kt b/src/IC-213/kotlin/io/kotest/plugin/intellij/inspectionsuper.kt deleted file mode 100644 index 503e26e1..00000000 --- a/src/IC-213/kotlin/io/kotest/plugin/intellij/inspectionsuper.kt +++ /dev/null @@ -1,5 +0,0 @@ -package io.kotest.plugin.intellij - -import org.jetbrains.kotlin.idea.inspections.AbstractKotlinInspection - -abstract class AbstractInspection : AbstractKotlinInspection() diff --git a/src/IC-213/kotlin/io/kotest/plugin/intellij/markers.kt b/src/IC-213/kotlin/io/kotest/plugin/intellij/markers.kt deleted file mode 100644 index 6bd63cde..00000000 --- a/src/IC-213/kotlin/io/kotest/plugin/intellij/markers.kt +++ /dev/null @@ -1,18 +0,0 @@ -package io.kotest.plugin.intellij - -import com.intellij.codeInsight.daemon.LineMarkerInfo -import com.intellij.openapi.editor.markup.GutterIconRenderer -import com.intellij.openapi.editor.markup.MarkupEditorFilter -import com.intellij.openapi.editor.markup.MarkupEditorFilterFactory -import com.intellij.psi.PsiElement -import com.intellij.util.Functions -import javax.swing.Icon - -/** - * A Line marker that does not appear in diffs - */ -class MainEditorLineMarkerInfo(element: PsiElement, text: String, icon: Icon) : LineMarkerInfo( - element, element.textRange, icon, Functions.constant(text), null, GutterIconRenderer.Alignment.LEFT, { text } -) { - override fun getEditorFilter(): MarkupEditorFilter = MarkupEditorFilterFactory.createIsNotDiffFilter() -} diff --git a/src/IC-213/resources/META-INF/plugin.xml b/src/IC-213/resources/META-INF/plugin.xml deleted file mode 100644 index 3be5c693..00000000 --- a/src/IC-213/resources/META-INF/plugin.xml +++ /dev/null @@ -1,110 +0,0 @@ - - - kotest-plugin-intellij - Kotest - - Kotest - - Kotest.

- This plugin requires the use of Kotest 4.2.0 or newer. - ]]>
- - - 1.0.0 - - - org.jetbrains.kotlin - com.intellij.modules.java - org.jetbrains.plugins.gradle - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - io.kotest.plugin.intellij.intentions.SoftAssertIntention - Kotlin/Test - SoftAssertIntention - - - - io.kotest.plugin.intellij.intentions.BangIntention - Kotlin/Test - BangIntention - - - - io.kotest.plugin.intellij.intentions.ShouldThrowIntention - Kotlin/Test - ShouldThrowIntention - - - - io.kotest.plugin.intellij.intentions.ShouldThrowAnyIntention - Kotlin/Test - ShouldThrowAnyIntention - - - - io.kotest.plugin.intellij.intentions.ShouldThrowExactlyIntention - Kotlin/Test - ShouldThrowExactlyIntention - - - -
diff --git a/src/IC-221/kotlin/io/kotest/plugin/intellij/contentFactory.kt b/src/IC-221/kotlin/io/kotest/plugin/intellij/contentFactory.kt deleted file mode 100644 index 1e0b5eaf..00000000 --- a/src/IC-221/kotlin/io/kotest/plugin/intellij/contentFactory.kt +++ /dev/null @@ -1,5 +0,0 @@ -package io.kotest.plugin.intellij - -import com.intellij.ui.content.ContentFactory - -fun getContentFactory(): ContentFactory = ContentFactory.SERVICE.getInstance() diff --git a/src/IC-221/kotlin/io/kotest/plugin/intellij/files.kt b/src/IC-221/kotlin/io/kotest/plugin/intellij/files.kt deleted file mode 100644 index 3f047009..00000000 --- a/src/IC-221/kotlin/io/kotest/plugin/intellij/files.kt +++ /dev/null @@ -1,33 +0,0 @@ -package io.kotest.plugin.intellij - -import com.intellij.execution.PsiLocation -import com.intellij.openapi.project.Project -import com.intellij.openapi.vfs.VirtualFile -import com.intellij.psi.PsiElement -import com.intellij.psi.search.FilenameIndex -import com.intellij.psi.search.GlobalSearchScope -import io.kotest.plugin.intellij.psi.elementAtLine -import io.kotest.plugin.intellij.psi.isTestFile -import io.kotest.plugin.intellij.psi.toPsiLocation -import io.kotest.plugin.intellij.toolwindow.TagsFilename -import org.jetbrains.kotlin.idea.core.util.toPsiFile - -fun findFiles(project: Project): List { - return FilenameIndex - .getVirtualFilesByName(TagsFilename, false, GlobalSearchScope.allScope(project)) - .toList() -} - -fun getLocationForFile( - project: Project, - scope: GlobalSearchScope, - name: String, - lineNumber: Int -): PsiLocation? { - return FilenameIndex - .getVirtualFilesByName(name, scope) - .firstOrNull { it.isTestFile(project) } - ?.toPsiFile(project) - ?.elementAtLine(lineNumber) - ?.toPsiLocation() -} diff --git a/src/IC-221/kotlin/io/kotest/plugin/intellij/findeditor.kt b/src/IC-221/kotlin/io/kotest/plugin/intellij/findeditor.kt deleted file mode 100644 index b0de1883..00000000 --- a/src/IC-221/kotlin/io/kotest/plugin/intellij/findeditor.kt +++ /dev/null @@ -1,6 +0,0 @@ -package io.kotest.plugin.intellij - -import com.intellij.psi.PsiElement -import org.jetbrains.kotlin.idea.inspections.findExistingEditor - -fun PsiElement.existingEditor() = this.findExistingEditor() diff --git a/src/IC-221/kotlin/io/kotest/plugin/intellij/fqnames.kt b/src/IC-221/kotlin/io/kotest/plugin/intellij/fqnames.kt deleted file mode 100644 index d1f338ef..00000000 --- a/src/IC-221/kotlin/io/kotest/plugin/intellij/fqnames.kt +++ /dev/null @@ -1,7 +0,0 @@ -package io.kotest.plugin.intellij - -import org.jetbrains.kotlin.idea.base.utils.fqname.getKotlinFqName -import org.jetbrains.kotlin.name.FqName -import org.jetbrains.kotlin.psi.KtClassOrObject - -fun KtClassOrObject.fqname(): FqName? = this.getKotlinFqName() diff --git a/src/IC-221/kotlin/io/kotest/plugin/intellij/inspectionsuper.kt b/src/IC-221/kotlin/io/kotest/plugin/intellij/inspectionsuper.kt deleted file mode 100644 index 503e26e1..00000000 --- a/src/IC-221/kotlin/io/kotest/plugin/intellij/inspectionsuper.kt +++ /dev/null @@ -1,5 +0,0 @@ -package io.kotest.plugin.intellij - -import org.jetbrains.kotlin.idea.inspections.AbstractKotlinInspection - -abstract class AbstractInspection : AbstractKotlinInspection() diff --git a/src/IC-221/kotlin/io/kotest/plugin/intellij/markers.kt b/src/IC-221/kotlin/io/kotest/plugin/intellij/markers.kt deleted file mode 100644 index 6bd63cde..00000000 --- a/src/IC-221/kotlin/io/kotest/plugin/intellij/markers.kt +++ /dev/null @@ -1,18 +0,0 @@ -package io.kotest.plugin.intellij - -import com.intellij.codeInsight.daemon.LineMarkerInfo -import com.intellij.openapi.editor.markup.GutterIconRenderer -import com.intellij.openapi.editor.markup.MarkupEditorFilter -import com.intellij.openapi.editor.markup.MarkupEditorFilterFactory -import com.intellij.psi.PsiElement -import com.intellij.util.Functions -import javax.swing.Icon - -/** - * A Line marker that does not appear in diffs - */ -class MainEditorLineMarkerInfo(element: PsiElement, text: String, icon: Icon) : LineMarkerInfo( - element, element.textRange, icon, Functions.constant(text), null, GutterIconRenderer.Alignment.LEFT, { text } -) { - override fun getEditorFilter(): MarkupEditorFilter = MarkupEditorFilterFactory.createIsNotDiffFilter() -} diff --git a/src/IC-221/kotlin/io/kotest/plugin/intellij/structure/KotestStructureViewExtension.kt b/src/IC-221/kotlin/io/kotest/plugin/intellij/structure/KotestStructureViewExtension.kt deleted file mode 100644 index 8aa0e602..00000000 --- a/src/IC-221/kotlin/io/kotest/plugin/intellij/structure/KotestStructureViewExtension.kt +++ /dev/null @@ -1,68 +0,0 @@ -package io.kotest.plugin.intellij.structure - -import com.intellij.icons.AllIcons -import com.intellij.ide.structureView.StructureViewExtension -import com.intellij.ide.structureView.StructureViewTreeElement -import com.intellij.ide.util.treeView.smartTree.TreeElement -import com.intellij.navigation.ItemPresentation -import com.intellij.openapi.editor.Editor -import com.intellij.psi.NavigatablePsiElement -import com.intellij.psi.PsiElement -import io.kotest.plugin.intellij.TestElement -import io.kotest.plugin.intellij.psi.specStyle -import org.jetbrains.kotlin.psi.KtClassOrObject -import javax.swing.Icon - -class KotestStructureViewExtension : StructureViewExtension { - - override fun getType(): Class { - return KtClassOrObject::class.java - } - - override fun getChildren(parent: PsiElement): Array { - val ktClassOrObject = parent as? KtClassOrObject ?: return emptyArray() - val spec = ktClassOrObject.specStyle() ?: return emptyArray() - val tests = spec.tests(parent, false) - return tests.map { KotestTestStructureViewTreeElement(it) }.toTypedArray() - } - - class KotestTestStructureViewTreeElement(private val test: TestElement) : StructureViewTreeElement { - override fun getPresentation(): ItemPresentation { - return object : ItemPresentation { - override fun getIcon(unused: Boolean): Icon { - return AllIcons.Nodes.Test - } - - override fun getPresentableText(): String { - return test.test.name.displayName() - } - } - } - - override fun getChildren(): Array { - return test.nestedTests.map { KotestTestStructureViewTreeElement(it) }.toTypedArray() - } - - override fun navigate(requestFocus: Boolean) { - if (test.psi is NavigatablePsiElement) { - test.psi.navigate(true) - } - } - - override fun canNavigate(): Boolean { - return true - } - - override fun canNavigateToSource(): Boolean { - return true - } - - override fun getValue(): Any { - return test - } - } - - override fun getCurrentEditorElement(editor: Editor?, parent: PsiElement?): Any? { - return null - } -} diff --git a/src/IC-221/resources/META-INF/plugin.xml b/src/IC-221/resources/META-INF/plugin.xml deleted file mode 100644 index 5a2ea308..00000000 --- a/src/IC-221/resources/META-INF/plugin.xml +++ /dev/null @@ -1,119 +0,0 @@ - - - kotest-plugin-intellij - Kotest - - Kotest - - Kotest.

- This plugin requires the use of Kotest 4.2.0 or newer. - ]]>
- - - 1.0.0 - - - org.jetbrains.kotlin - com.intellij.modules.java - org.jetbrains.plugins.gradle - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - io.kotest.plugin.intellij.intentions.SoftAssertIntention - Kotlin/Test - SoftAssertIntention - - - - io.kotest.plugin.intellij.intentions.BangIntention - Kotlin/Test - BangIntention - - - - io.kotest.plugin.intellij.intentions.ShouldThrowIntention - Kotlin/Test - ShouldThrowIntention - - - - io.kotest.plugin.intellij.intentions.ShouldThrowAnyIntention - Kotlin/Test - ShouldThrowAnyIntention - - - - io.kotest.plugin.intellij.intentions.ShouldThrowExactlyIntention - Kotlin/Test - ShouldThrowExactlyIntention - - - -
diff --git a/src/IC-222/kotlin/io/kotest/plugin/intellij/contentFactory.kt b/src/IC-222/kotlin/io/kotest/plugin/intellij/contentFactory.kt deleted file mode 100644 index 3cd76f88..00000000 --- a/src/IC-222/kotlin/io/kotest/plugin/intellij/contentFactory.kt +++ /dev/null @@ -1,5 +0,0 @@ -package io.kotest.plugin.intellij - -import com.intellij.ui.content.ContentFactory - -fun getContentFactory(): ContentFactory = ContentFactory.getInstance() diff --git a/src/IC-222/kotlin/io/kotest/plugin/intellij/files.kt b/src/IC-222/kotlin/io/kotest/plugin/intellij/files.kt deleted file mode 100644 index 3f047009..00000000 --- a/src/IC-222/kotlin/io/kotest/plugin/intellij/files.kt +++ /dev/null @@ -1,33 +0,0 @@ -package io.kotest.plugin.intellij - -import com.intellij.execution.PsiLocation -import com.intellij.openapi.project.Project -import com.intellij.openapi.vfs.VirtualFile -import com.intellij.psi.PsiElement -import com.intellij.psi.search.FilenameIndex -import com.intellij.psi.search.GlobalSearchScope -import io.kotest.plugin.intellij.psi.elementAtLine -import io.kotest.plugin.intellij.psi.isTestFile -import io.kotest.plugin.intellij.psi.toPsiLocation -import io.kotest.plugin.intellij.toolwindow.TagsFilename -import org.jetbrains.kotlin.idea.core.util.toPsiFile - -fun findFiles(project: Project): List { - return FilenameIndex - .getVirtualFilesByName(TagsFilename, false, GlobalSearchScope.allScope(project)) - .toList() -} - -fun getLocationForFile( - project: Project, - scope: GlobalSearchScope, - name: String, - lineNumber: Int -): PsiLocation? { - return FilenameIndex - .getVirtualFilesByName(name, scope) - .firstOrNull { it.isTestFile(project) } - ?.toPsiFile(project) - ?.elementAtLine(lineNumber) - ?.toPsiLocation() -} diff --git a/src/IC-222/kotlin/io/kotest/plugin/intellij/findeditor.kt b/src/IC-222/kotlin/io/kotest/plugin/intellij/findeditor.kt deleted file mode 100644 index b0de1883..00000000 --- a/src/IC-222/kotlin/io/kotest/plugin/intellij/findeditor.kt +++ /dev/null @@ -1,6 +0,0 @@ -package io.kotest.plugin.intellij - -import com.intellij.psi.PsiElement -import org.jetbrains.kotlin.idea.inspections.findExistingEditor - -fun PsiElement.existingEditor() = this.findExistingEditor() diff --git a/src/IC-222/kotlin/io/kotest/plugin/intellij/fqnames.kt b/src/IC-222/kotlin/io/kotest/plugin/intellij/fqnames.kt deleted file mode 100644 index d1f338ef..00000000 --- a/src/IC-222/kotlin/io/kotest/plugin/intellij/fqnames.kt +++ /dev/null @@ -1,7 +0,0 @@ -package io.kotest.plugin.intellij - -import org.jetbrains.kotlin.idea.base.utils.fqname.getKotlinFqName -import org.jetbrains.kotlin.name.FqName -import org.jetbrains.kotlin.psi.KtClassOrObject - -fun KtClassOrObject.fqname(): FqName? = this.getKotlinFqName() diff --git a/src/IC-222/kotlin/io/kotest/plugin/intellij/inspectionsuper.kt b/src/IC-222/kotlin/io/kotest/plugin/intellij/inspectionsuper.kt deleted file mode 100644 index 503e26e1..00000000 --- a/src/IC-222/kotlin/io/kotest/plugin/intellij/inspectionsuper.kt +++ /dev/null @@ -1,5 +0,0 @@ -package io.kotest.plugin.intellij - -import org.jetbrains.kotlin.idea.inspections.AbstractKotlinInspection - -abstract class AbstractInspection : AbstractKotlinInspection() diff --git a/src/IC-222/kotlin/io/kotest/plugin/intellij/markers.kt b/src/IC-222/kotlin/io/kotest/plugin/intellij/markers.kt deleted file mode 100644 index 6bd63cde..00000000 --- a/src/IC-222/kotlin/io/kotest/plugin/intellij/markers.kt +++ /dev/null @@ -1,18 +0,0 @@ -package io.kotest.plugin.intellij - -import com.intellij.codeInsight.daemon.LineMarkerInfo -import com.intellij.openapi.editor.markup.GutterIconRenderer -import com.intellij.openapi.editor.markup.MarkupEditorFilter -import com.intellij.openapi.editor.markup.MarkupEditorFilterFactory -import com.intellij.psi.PsiElement -import com.intellij.util.Functions -import javax.swing.Icon - -/** - * A Line marker that does not appear in diffs - */ -class MainEditorLineMarkerInfo(element: PsiElement, text: String, icon: Icon) : LineMarkerInfo( - element, element.textRange, icon, Functions.constant(text), null, GutterIconRenderer.Alignment.LEFT, { text } -) { - override fun getEditorFilter(): MarkupEditorFilter = MarkupEditorFilterFactory.createIsNotDiffFilter() -} diff --git a/src/IC-222/kotlin/io/kotest/plugin/intellij/structure/KotestStructureViewExtension.kt b/src/IC-222/kotlin/io/kotest/plugin/intellij/structure/KotestStructureViewExtension.kt deleted file mode 100644 index 8aa0e602..00000000 --- a/src/IC-222/kotlin/io/kotest/plugin/intellij/structure/KotestStructureViewExtension.kt +++ /dev/null @@ -1,68 +0,0 @@ -package io.kotest.plugin.intellij.structure - -import com.intellij.icons.AllIcons -import com.intellij.ide.structureView.StructureViewExtension -import com.intellij.ide.structureView.StructureViewTreeElement -import com.intellij.ide.util.treeView.smartTree.TreeElement -import com.intellij.navigation.ItemPresentation -import com.intellij.openapi.editor.Editor -import com.intellij.psi.NavigatablePsiElement -import com.intellij.psi.PsiElement -import io.kotest.plugin.intellij.TestElement -import io.kotest.plugin.intellij.psi.specStyle -import org.jetbrains.kotlin.psi.KtClassOrObject -import javax.swing.Icon - -class KotestStructureViewExtension : StructureViewExtension { - - override fun getType(): Class { - return KtClassOrObject::class.java - } - - override fun getChildren(parent: PsiElement): Array { - val ktClassOrObject = parent as? KtClassOrObject ?: return emptyArray() - val spec = ktClassOrObject.specStyle() ?: return emptyArray() - val tests = spec.tests(parent, false) - return tests.map { KotestTestStructureViewTreeElement(it) }.toTypedArray() - } - - class KotestTestStructureViewTreeElement(private val test: TestElement) : StructureViewTreeElement { - override fun getPresentation(): ItemPresentation { - return object : ItemPresentation { - override fun getIcon(unused: Boolean): Icon { - return AllIcons.Nodes.Test - } - - override fun getPresentableText(): String { - return test.test.name.displayName() - } - } - } - - override fun getChildren(): Array { - return test.nestedTests.map { KotestTestStructureViewTreeElement(it) }.toTypedArray() - } - - override fun navigate(requestFocus: Boolean) { - if (test.psi is NavigatablePsiElement) { - test.psi.navigate(true) - } - } - - override fun canNavigate(): Boolean { - return true - } - - override fun canNavigateToSource(): Boolean { - return true - } - - override fun getValue(): Any { - return test - } - } - - override fun getCurrentEditorElement(editor: Editor?, parent: PsiElement?): Any? { - return null - } -} diff --git a/src/IC-222/resources/META-INF/plugin.xml b/src/IC-222/resources/META-INF/plugin.xml deleted file mode 100644 index 26861633..00000000 --- a/src/IC-222/resources/META-INF/plugin.xml +++ /dev/null @@ -1,113 +0,0 @@ - - - kotest-plugin-intellij - Kotest - - Kotest - - Kotest.

- This plugin requires the use of Kotest 4.2.0 or newer. - ]]>
- - - 1.0.0 - - - org.jetbrains.kotlin - com.intellij.modules.java - org.jetbrains.plugins.gradle - org.intellij.intelliLang - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - io.kotest.plugin.intellij.intentions.SoftAssertIntention - Kotlin/Test - SoftAssertIntention - - - - io.kotest.plugin.intellij.intentions.BangIntention - Kotlin/Test - BangIntention - - - - io.kotest.plugin.intellij.intentions.ShouldThrowIntention - Kotlin/Test - ShouldThrowIntention - - - - io.kotest.plugin.intellij.intentions.ShouldThrowAnyIntention - Kotlin/Test - ShouldThrowAnyIntention - - - - io.kotest.plugin.intellij.intentions.ShouldThrowExactlyIntention - Kotlin/Test - ShouldThrowExactlyIntention - - - -