KT-32368 Rework Inline hints settings // remove suspending call hints
Suspending call hints were removed according to KT-30928 and KT-39271.
This commit is contained in:
@@ -47,7 +47,6 @@ import org.jetbrains.kotlin.idea.codeInsight.generate.AbstractGenerateTestSuppor
|
|||||||
import org.jetbrains.kotlin.idea.codeInsight.generate.AbstractGenerateToStringActionTest
|
import org.jetbrains.kotlin.idea.codeInsight.generate.AbstractGenerateToStringActionTest
|
||||||
import org.jetbrains.kotlin.idea.codeInsight.hints.AbstractKotlinLambdasHintsProvider
|
import org.jetbrains.kotlin.idea.codeInsight.hints.AbstractKotlinLambdasHintsProvider
|
||||||
import org.jetbrains.kotlin.idea.codeInsight.hints.AbstractKotlinReferenceTypeHintsProviderTest
|
import org.jetbrains.kotlin.idea.codeInsight.hints.AbstractKotlinReferenceTypeHintsProviderTest
|
||||||
import org.jetbrains.kotlin.idea.codeInsight.hints.AbstractKotlinSuspendingCallHintsProviderTest
|
|
||||||
import org.jetbrains.kotlin.idea.codeInsight.moveUpDown.AbstractMoveLeftRightTest
|
import org.jetbrains.kotlin.idea.codeInsight.moveUpDown.AbstractMoveLeftRightTest
|
||||||
import org.jetbrains.kotlin.idea.codeInsight.moveUpDown.AbstractMoveStatementTest
|
import org.jetbrains.kotlin.idea.codeInsight.moveUpDown.AbstractMoveStatementTest
|
||||||
import org.jetbrains.kotlin.idea.codeInsight.postfix.AbstractPostfixTemplateProviderTest
|
import org.jetbrains.kotlin.idea.codeInsight.postfix.AbstractPostfixTemplateProviderTest
|
||||||
@@ -882,10 +881,6 @@ fun main(args: Array<String>) {
|
|||||||
model("codeInsight/codeVision")
|
model("codeInsight/codeVision")
|
||||||
}
|
}
|
||||||
|
|
||||||
testClass<AbstractKotlinSuspendingCallHintsProviderTest> {
|
|
||||||
model("codeInsight/hints/suspending")
|
|
||||||
}
|
|
||||||
|
|
||||||
testClass<AbstractKotlinReferenceTypeHintsProviderTest> {
|
testClass<AbstractKotlinReferenceTypeHintsProviderTest> {
|
||||||
model("codeInsight/hints/types")
|
model("codeInsight/hints/types")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -377,7 +377,6 @@
|
|||||||
|
|
||||||
<codeInsight.inlayProvider language="kotlin" implementationClass="org.jetbrains.kotlin.idea.codeInsight.hints.KotlinReferencesTypeHintsProvider"/>
|
<codeInsight.inlayProvider language="kotlin" implementationClass="org.jetbrains.kotlin.idea.codeInsight.hints.KotlinReferencesTypeHintsProvider"/>
|
||||||
<codeInsight.inlayProvider language="kotlin" implementationClass="org.jetbrains.kotlin.idea.codeInsight.hints.KotlinLambdasHintsProvider"/>
|
<codeInsight.inlayProvider language="kotlin" implementationClass="org.jetbrains.kotlin.idea.codeInsight.hints.KotlinLambdasHintsProvider"/>
|
||||||
<codeInsight.inlayProvider language="kotlin" implementationClass="org.jetbrains.kotlin.idea.codeInsight.hints.KotlinSuspendingCallHintsProvider"/>
|
|
||||||
|
|
||||||
<codeInsight.gotoSuper language="kotlin" implementationClass="org.jetbrains.kotlin.idea.codeInsight.GotoSuperActionHandler"/>
|
<codeInsight.gotoSuper language="kotlin" implementationClass="org.jetbrains.kotlin.idea.codeInsight.GotoSuperActionHandler"/>
|
||||||
|
|
||||||
|
|||||||
-46
@@ -1,46 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
|
||||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.jetbrains.kotlin.idea.codeInsight.hints
|
|
||||||
|
|
||||||
import com.intellij.codeInsight.hints.ChangeListener
|
|
||||||
import com.intellij.codeInsight.hints.ImmediateConfigurable
|
|
||||||
import com.intellij.ui.layout.panel
|
|
||||||
import org.jetbrains.kotlin.idea.KotlinBundle
|
|
||||||
import javax.swing.JComponent
|
|
||||||
|
|
||||||
@Suppress("UnstableApiUsage")
|
|
||||||
class KotlinSuspendingCallHintsProvider : KotlinAbstractHintsProvider<KotlinSuspendingCallHintsProvider.Settings>() {
|
|
||||||
|
|
||||||
data class Settings(var suspendingCalls: Boolean = false)
|
|
||||||
|
|
||||||
override val name: String = KotlinBundle.message("hints.settings.suspending")
|
|
||||||
|
|
||||||
override fun createConfigurable(settings: Settings): ImmediateConfigurable {
|
|
||||||
return object : ImmediateConfigurable {
|
|
||||||
override fun createComponent(listener: ChangeListener): JComponent = panel {}
|
|
||||||
|
|
||||||
override val mainCheckboxText: String = KotlinBundle.message("hints.settings.common.items")
|
|
||||||
|
|
||||||
override val cases: List<ImmediateConfigurable.Case>
|
|
||||||
get() = listOf(
|
|
||||||
ImmediateConfigurable.Case(
|
|
||||||
KotlinBundle.message("hints.settings.suspending"),
|
|
||||||
"hints.suspending.calls",
|
|
||||||
settings::suspendingCalls
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun createSettings(): Settings = Settings()
|
|
||||||
|
|
||||||
override fun isElementSupported(resolved: HintType?, settings: Settings): Boolean {
|
|
||||||
return when (resolved) {
|
|
||||||
HintType.SUSPENDING_CALL -> settings.suspendingCalls
|
|
||||||
else -> false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
import kotlin.coroutines.experimental.buildSequence
|
|
||||||
|
|
||||||
val x = buildSequence {
|
|
||||||
<# # #>yield(1)
|
|
||||||
}
|
|
||||||
-34
@@ -1,34 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
|
||||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.jetbrains.kotlin.idea.codeInsight.hints
|
|
||||||
|
|
||||||
import com.intellij.openapi.util.io.FileUtil
|
|
||||||
import com.intellij.testFramework.LightProjectDescriptor
|
|
||||||
import com.intellij.testFramework.utils.inlays.InlayHintsProviderTestCase
|
|
||||||
import org.jetbrains.kotlin.idea.test.KotlinWithJdkAndRuntimeLightProjectDescriptor
|
|
||||||
import org.jetbrains.kotlin.test.InTextDirectivesUtils
|
|
||||||
import java.io.File
|
|
||||||
|
|
||||||
@Suppress("UnstableApiUsage")
|
|
||||||
abstract class AbstractKotlinSuspendingCallHintsProviderTest :
|
|
||||||
InlayHintsProviderTestCase() { // Abstract- prefix is just a convention for GenerateTests
|
|
||||||
|
|
||||||
override fun getProjectDescriptor(): LightProjectDescriptor {
|
|
||||||
return KotlinWithJdkAndRuntimeLightProjectDescriptor.INSTANCE
|
|
||||||
}
|
|
||||||
|
|
||||||
fun doTest(testPath: String) { // named according to the convention imposed by GenerateTests
|
|
||||||
assertThatActualHintsMatch(testPath)
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun assertThatActualHintsMatch(fileName: String) {
|
|
||||||
with(KotlinSuspendingCallHintsProvider()) {
|
|
||||||
val fileContents = FileUtil.loadFile(File(fileName), true)
|
|
||||||
val settings = createSettings().apply { suspendingCalls = true }
|
|
||||||
testProvider("KotlinSuspendingCallHintsProvider.kt", fileContents, this, settings)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-35
@@ -1,35 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
|
||||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.jetbrains.kotlin.idea.codeInsight.hints;
|
|
||||||
|
|
||||||
import com.intellij.testFramework.TestDataPath;
|
|
||||||
import org.jetbrains.kotlin.test.JUnit3RunnerWithInners;
|
|
||||||
import org.jetbrains.kotlin.test.KotlinTestUtils;
|
|
||||||
import org.jetbrains.kotlin.test.TestMetadata;
|
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.util.regex.Pattern;
|
|
||||||
|
|
||||||
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */
|
|
||||||
@SuppressWarnings("all")
|
|
||||||
@TestMetadata("idea/testData/codeInsight/hints/suspending")
|
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
|
||||||
public class KotlinSuspendingCallHintsProviderTestGenerated extends AbstractKotlinSuspendingCallHintsProviderTest {
|
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInSuspending() throws Exception {
|
|
||||||
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/testData/codeInsight/hints/suspending"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("SimpleCase.kt")
|
|
||||||
public void testSimpleCase() throws Exception {
|
|
||||||
runTest("idea/testData/codeInsight/hints/suspending/SimpleCase.kt");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user