Delete 193 bunch files
This commit is contained in:
@@ -1,11 +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.findUsages
|
||||
|
||||
import com.intellij.util.Processor
|
||||
|
||||
// FIX ME WHEN BUNCH 193 REMOVED
|
||||
typealias ProcessorInCompat<T> = Processor<T>
|
||||
@@ -1,119 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2019 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.caches.resolve
|
||||
|
||||
import com.intellij.openapi.util.Key
|
||||
import com.intellij.psi.*
|
||||
import org.jetbrains.kotlin.asJava.elements.KtLightElement
|
||||
import org.jetbrains.kotlin.asJava.elements.KtLightModifierList
|
||||
import org.jetbrains.kotlin.idea.KotlinLanguage
|
||||
import org.junit.Assert
|
||||
|
||||
object PsiElementChecker {
|
||||
val TEST_DATA_KEY = Key.create<Int>("Test Key")
|
||||
|
||||
fun checkPsiElementStructure(lightClass: PsiClass) {
|
||||
checkPsiElement(lightClass)
|
||||
|
||||
lightClass.methods.forEach {
|
||||
it.parameterList.parameters.forEach { checkPsiElement(it) }
|
||||
checkPsiElement(it)
|
||||
}
|
||||
|
||||
lightClass.fields.forEach { checkPsiElement(it) }
|
||||
|
||||
lightClass.innerClasses.forEach { checkPsiElementStructure(it) }
|
||||
}
|
||||
|
||||
private fun checkPsiElement(element: PsiElement) {
|
||||
if (element !is KtLightElement<*, *> && element !is KtLightModifierList<*>) return
|
||||
|
||||
if (element is PsiModifierListOwner) {
|
||||
val modifierList = element.modifierList
|
||||
if (modifierList != null) {
|
||||
checkPsiElement(modifierList)
|
||||
}
|
||||
}
|
||||
|
||||
if (element is PsiTypeParameterListOwner) {
|
||||
val typeParameterList = element.typeParameterList
|
||||
if (typeParameterList != null) {
|
||||
checkPsiElement(typeParameterList)
|
||||
typeParameterList.typeParameters.forEach { checkPsiElement(it) }
|
||||
}
|
||||
}
|
||||
|
||||
with(element) {
|
||||
try {
|
||||
Assert.assertEquals("Number of methods has changed. Please update test.", 55, PsiElement::class.java.methods.size)
|
||||
|
||||
project
|
||||
Assert.assertTrue(language == KotlinLanguage.INSTANCE)
|
||||
manager
|
||||
children
|
||||
parent
|
||||
firstChild
|
||||
lastChild
|
||||
nextSibling
|
||||
prevSibling
|
||||
containingFile
|
||||
textRange
|
||||
//textRangeInParent - throws an exception for non-physical elements, it is expected behaviour
|
||||
startOffsetInParent
|
||||
textLength
|
||||
findElementAt(0)
|
||||
findReferenceAt(0)
|
||||
textOffset
|
||||
text
|
||||
textToCharArray()
|
||||
navigationElement
|
||||
originalElement
|
||||
textMatches("")
|
||||
Assert.assertTrue(textMatches(this))
|
||||
textContains('a')
|
||||
accept(PsiElementVisitor.EMPTY_VISITOR)
|
||||
acceptChildren(PsiElementVisitor.EMPTY_VISITOR)
|
||||
|
||||
val copy = copy()
|
||||
Assert.assertTrue(copy == null || copy::class.java == this::class.java)
|
||||
|
||||
// Modify methods:
|
||||
// add(this)
|
||||
// addBefore(this, lastChild)
|
||||
// addAfter(firstChild, this)
|
||||
// checkAdd(this)
|
||||
// addRange(firstChild, lastChild)
|
||||
// addRangeBefore(firstChild, lastChild, lastChild)
|
||||
// addRangeAfter(firstChild, lastChild, firstChild)
|
||||
// delete()
|
||||
// checkDelete()
|
||||
// deleteChildRange(firstChild, lastChild)
|
||||
// replace(this)
|
||||
|
||||
Assert.assertTrue(isValid)
|
||||
isWritable
|
||||
reference
|
||||
references
|
||||
putCopyableUserData(TEST_DATA_KEY, 12)
|
||||
|
||||
Assert.assertTrue(getCopyableUserData(TEST_DATA_KEY) == 12)
|
||||
// Assert.assertTrue(copy().getCopyableUserData(TEST_DATA_KEY) == 12) { this } Doesn't work
|
||||
|
||||
// processDeclarations(...)
|
||||
|
||||
context
|
||||
isPhysical
|
||||
resolveScope
|
||||
useScope
|
||||
node
|
||||
toString()
|
||||
Assert.assertTrue(isEquivalentTo(this))
|
||||
} catch (t: Throwable) {
|
||||
throw AssertionErrorWithCause("Failed for ${this::class.java} ${this}", t)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2019 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
|
||||
|
||||
import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightFixtureTestCase
|
||||
|
||||
//BUNCH 201
|
||||
abstract class AbstractRenderingKDocTest : KotlinLightCodeInsightFixtureTestCase() {
|
||||
protected fun doTest(path: String) = Unit
|
||||
}
|
||||
-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.navigationToolbar
|
||||
|
||||
import com.intellij.ide.navigationToolbar.NavBarModel
|
||||
import com.intellij.ide.navigationToolbar.NavBarModelExtension
|
||||
import com.intellij.ide.navigationToolbar.NavBarPresentation
|
||||
import com.intellij.openapi.actionSystem.DataContext
|
||||
import com.intellij.openapi.editor.ex.EditorEx
|
||||
import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightFixtureTestCase
|
||||
import org.jetbrains.kotlin.test.InTextDirectivesUtils
|
||||
|
||||
|
||||
abstract class AbstractKotlinNavBarTest : KotlinLightCodeInsightFixtureTestCase() {
|
||||
|
||||
// inspired by: com.intellij.ide.navigationToolbar.JavaNavBarTest#assertNavBarModel
|
||||
protected fun doTest(testPath: String) {
|
||||
val psiFile = myFixture.configureByFile(testDataFile().name)
|
||||
val model = NavBarModel(myFixture.project)
|
||||
|
||||
model::class.java.getDeclaredMethod("updateModel", DataContext::class.java)
|
||||
.apply { isAccessible = true }
|
||||
.invoke(model, (myFixture.editor as EditorEx).dataContext)
|
||||
|
||||
val actualItems = (0 until model.size()).map {
|
||||
NavBarPresentation.calcPresentableText(model[it])
|
||||
}
|
||||
val expectedItems = InTextDirectivesUtils.findListWithPrefixes(psiFile.text, "// NAV_BAR_ITEMS:")
|
||||
assertOrderedEquals(actualItems, expectedItems)
|
||||
}
|
||||
}
|
||||
@@ -1,16 +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.quickfix
|
||||
|
||||
import com.intellij.codeInsight.intention.IntentionAction
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.intellij.psi.PsiFile
|
||||
import com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl
|
||||
|
||||
// FIX ME WHEN BUNCH 193 REMOVED
|
||||
fun invokeIntentionCompat(action: IntentionAction, file: PsiFile, editor: Editor) {
|
||||
CodeInsightTestFixtureImpl.invokeIntention(action, file, editor, action.text)
|
||||
}
|
||||
@@ -1,24 +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.resolve
|
||||
|
||||
import com.intellij.mock.MockProject
|
||||
import com.intellij.pom.PomModel
|
||||
import com.intellij.pom.tree.TreeAspect
|
||||
import org.jetbrains.kotlin.idea.caches.trackers.KotlinCodeBlockModificationListener
|
||||
|
||||
internal fun createAndRegisterKotlinCodeBlockModificationListener(project: MockProject, pomModel: PomModel, treeAspect: TreeAspect) {
|
||||
project.registerService(PomModel::class.java, pomModel)
|
||||
project.picoContainer.registerComponentInstance(
|
||||
KotlinCodeBlockModificationListener(project, treeAspect)
|
||||
)
|
||||
}
|
||||
|
||||
internal fun unregisterKotlinCodeBlockModificationListener(project: MockProject) {
|
||||
val picoContainer = project.picoContainer
|
||||
picoContainer.unregisterComponent(KotlinCodeBlockModificationListener::class.java)
|
||||
picoContainer.unregisterComponent(PomModel::class.java)
|
||||
}
|
||||
Reference in New Issue
Block a user