Build: drop IntelliJ 2018.3 support (KT-35374)
Delete references in code
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
192
|
192
|
||||||
193
|
193
|
||||||
191
|
191
|
||||||
183_191
|
|
||||||
as35_191
|
as35_191
|
||||||
as36
|
as36
|
||||||
as40_193
|
as40_193
|
||||||
|
|||||||
-1
@@ -99,7 +99,6 @@
|
|||||||
<option name="problems">
|
<option name="problems">
|
||||||
<list>
|
<list>
|
||||||
<Problem reference="com.intellij.util.JdomKt#element" reason="Removed in 191" />
|
<Problem reference="com.intellij.util.JdomKt#element" reason="Removed in 191" />
|
||||||
<Problem reference="com.intellij.execution.JavaRunConfigurationExtensionManager#getInstance" reason="Can't be used in Kotlin, because method was replaced with property after J2K in 183. Use JavaRunConfigurationExtensionManagerUtil instead." />
|
|
||||||
<Problem reference="org.jetbrains.kotlin.idea.reporter.ITNReporterCompat#submit" reason="parentComponent is nullable in AS" />
|
<Problem reference="org.jetbrains.kotlin.idea.reporter.ITNReporterCompat#submit" reason="parentComponent is nullable in AS" />
|
||||||
<Problem reference="com.intellij.diagnostic.ITNReporter#submit" reason="parentComponent is nullable in AS" />
|
<Problem reference="com.intellij.diagnostic.ITNReporter#submit" reason="parentComponent is nullable in AS" />
|
||||||
</list>
|
</list>
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ enum class Platform : CompatibilityPredicate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
enum class Ide(val platform: Platform) : CompatibilityPredicate {
|
enum class Ide(val platform: Platform) : CompatibilityPredicate {
|
||||||
IJ183(Platform.P183),
|
|
||||||
IJ191(Platform.P191),
|
IJ191(Platform.P191),
|
||||||
IJ192(Platform.P192),
|
IJ192(Platform.P192),
|
||||||
IJ193(Platform.P193),
|
IJ193(Platform.P193),
|
||||||
|
|||||||
+1
-1
@@ -48,7 +48,7 @@ class KotlinCodeBlockModificationListener(
|
|||||||
@Suppress("UnstableApiUsage")
|
@Suppress("UnstableApiUsage")
|
||||||
private val isLanguageTrackerEnabled = modificationTrackerImpl.isEnableLanguageTrackerCompat
|
private val isLanguageTrackerEnabled = modificationTrackerImpl.isEnableLanguageTrackerCompat
|
||||||
|
|
||||||
// BUNCH: 183
|
// BUNCH: 191
|
||||||
// When there're we no per-language trackers we had to increment global tracker first and process result afterward
|
// When there're we no per-language trackers we had to increment global tracker first and process result afterward
|
||||||
private val customIncrement = if (isLanguageTrackerEnabled) 0 else 1
|
private val customIncrement = if (isLanguageTrackerEnabled) 0 else 1
|
||||||
|
|
||||||
|
|||||||
@@ -80,13 +80,8 @@ dependencies {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
if (Ide.IJ183()) {
|
"main" { }
|
||||||
"main" { projectDefault() }
|
"test" { }
|
||||||
"test" { projectDefault() }
|
|
||||||
} else {
|
|
||||||
"main" { }
|
|
||||||
"test" { }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
projectTest(parallel = true) {
|
projectTest(parallel = true) {
|
||||||
|
|||||||
+1
-1
@@ -8,7 +8,7 @@ package org.jetbrains.kotlin.idea.gradle.execution
|
|||||||
import com.intellij.openapi.module.Module
|
import com.intellij.openapi.module.Module
|
||||||
import org.jetbrains.plugins.gradle.settings.GradleProjectSettings
|
import org.jetbrains.plugins.gradle.settings.GradleProjectSettings
|
||||||
|
|
||||||
//BUNCH: 183
|
// BUNCH: 191
|
||||||
fun isDelegatedBuild(module: Module): Boolean {
|
fun isDelegatedBuild(module: Module): Boolean {
|
||||||
val projectUrl = module.project.presentableUrl
|
val projectUrl = module.project.presentableUrl
|
||||||
if (projectUrl == null || !GradleProjectSettings.isDelegatedBuildEnabled(module)) {
|
if (projectUrl == null || !GradleProjectSettings.isDelegatedBuildEnabled(module)) {
|
||||||
|
|||||||
-1
@@ -9,7 +9,6 @@ import com.intellij.openapi.externalSystem.util.ExternalSystemApiUtil.toCanonica
|
|||||||
import org.jetbrains.plugins.gradle.service.settings.GradleSettingsService
|
import org.jetbrains.plugins.gradle.service.settings.GradleSettingsService
|
||||||
import com.intellij.openapi.module.Module
|
import com.intellij.openapi.module.Module
|
||||||
|
|
||||||
//BUNCH: 183
|
|
||||||
fun isDelegatedBuild(module: Module): Boolean {
|
fun isDelegatedBuild(module: Module): Boolean {
|
||||||
val projectUrl = module.project.presentableUrl
|
val projectUrl = module.project.presentableUrl
|
||||||
if (projectUrl == null || !GradleSettingsService.getInstance(module.project).isDelegatedBuildEnabled(toCanonicalPath(projectUrl))) {
|
if (projectUrl == null || !GradleSettingsService.getInstance(module.project).isDelegatedBuildEnabled(toCanonicalPath(projectUrl))) {
|
||||||
|
|||||||
-19
@@ -1,19 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2010-2018 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.run;
|
|
||||||
|
|
||||||
import com.intellij.execution.JavaRunConfigurationExtensionManager;
|
|
||||||
|
|
||||||
// Introduced for compatibility reasons only.
|
|
||||||
// Method JavaRunConfigurationExtensionManager.getInstance() was rewritten to Kotlin in 191 and
|
|
||||||
// can't be called from Kotlin anymore.
|
|
||||||
// BUNCH: 183
|
|
||||||
public class JavaRunConfigurationExtensionManagerUtil {
|
|
||||||
public static JavaRunConfigurationExtensionManager getInstance() {
|
|
||||||
//noinspection IncompatibleAPI
|
|
||||||
return JavaRunConfigurationExtensionManager.getInstance();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+3
-6
@@ -5,10 +5,7 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.idea.run
|
package org.jetbrains.kotlin.idea.run
|
||||||
|
|
||||||
import com.intellij.execution.CommonJavaRunConfigurationParameters
|
import com.intellij.execution.*
|
||||||
import com.intellij.execution.PsiLocation
|
|
||||||
import com.intellij.execution.RunManager
|
|
||||||
import com.intellij.execution.RunnerAndConfigurationSettings
|
|
||||||
import com.intellij.execution.actions.ConfigurationContext
|
import com.intellij.execution.actions.ConfigurationContext
|
||||||
import com.intellij.execution.actions.ConfigurationFromContext
|
import com.intellij.execution.actions.ConfigurationFromContext
|
||||||
import com.intellij.execution.actions.RunConfigurationProducer
|
import com.intellij.execution.actions.RunConfigurationProducer
|
||||||
@@ -110,7 +107,7 @@ class KotlinJUnitRunConfigurationProducer : RunConfigurationProducer<JUnitConfig
|
|||||||
val method = getTestMethod(leaf)
|
val method = getTestMethod(leaf)
|
||||||
if (method != null) {
|
if (method != null) {
|
||||||
configuration.beMethodConfiguration(method.toLocation())
|
configuration.beMethodConfiguration(method.toLocation())
|
||||||
JavaRunConfigurationExtensionManagerUtil.getInstance().extendCreatedConfiguration(configuration, location)
|
JavaRunConfigurationExtensionManager.instance.extendCreatedConfiguration(configuration, location)
|
||||||
configuration.setModule(module)
|
configuration.setModule(module)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
@@ -118,7 +115,7 @@ class KotlinJUnitRunConfigurationProducer : RunConfigurationProducer<JUnitConfig
|
|||||||
val testClass = getTestClass(leaf)
|
val testClass = getTestClass(leaf)
|
||||||
if (testClass != null) {
|
if (testClass != null) {
|
||||||
configuration.beClassConfiguration(testClass)
|
configuration.beClassConfiguration(testClass)
|
||||||
JavaRunConfigurationExtensionManagerUtil.getInstance().extendCreatedConfiguration(configuration, location)
|
JavaRunConfigurationExtensionManager.instance.extendCreatedConfiguration(configuration, location)
|
||||||
configuration.setModule(module)
|
configuration.setModule(module)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ public class KotlinRunConfiguration extends JetRunConfiguration {
|
|||||||
public SettingsEditor<? extends RunConfiguration> getConfigurationEditor() {
|
public SettingsEditor<? extends RunConfiguration> getConfigurationEditor() {
|
||||||
SettingsEditorGroup<KotlinRunConfiguration> group = new SettingsEditorGroup<KotlinRunConfiguration>();
|
SettingsEditorGroup<KotlinRunConfiguration> group = new SettingsEditorGroup<KotlinRunConfiguration>();
|
||||||
group.addEditor(ExecutionBundle.message("run.configuration.configuration.tab.title"), new KotlinRunConfigurationEditor(getProject()));
|
group.addEditor(ExecutionBundle.message("run.configuration.configuration.tab.title"), new KotlinRunConfigurationEditor(getProject()));
|
||||||
JavaRunConfigurationExtensionManagerUtil.getInstance().appendEditors(this, group);
|
JavaRunConfigurationExtensionManager.getInstance().appendEditors(this, group);
|
||||||
group.addEditor(ExecutionBundle.message("logs.tab.title"), new LogConfigurationPanel<KotlinRunConfiguration>());
|
group.addEditor(ExecutionBundle.message("logs.tab.title"), new LogConfigurationPanel<KotlinRunConfiguration>());
|
||||||
return group;
|
return group;
|
||||||
}
|
}
|
||||||
@@ -107,7 +107,7 @@ public class KotlinRunConfiguration extends JetRunConfiguration {
|
|||||||
PathMacroManager.getInstance(getProject()).expandPaths(element);
|
PathMacroManager.getInstance(getProject()).expandPaths(element);
|
||||||
super.readExternal(element);
|
super.readExternal(element);
|
||||||
|
|
||||||
JavaRunConfigurationExtensionManagerUtil.getInstance().readExternal(this, element);
|
JavaRunConfigurationExtensionManager.getInstance().readExternal(this, element);
|
||||||
DefaultJDOMExternalizer.readExternal(this, element);
|
DefaultJDOMExternalizer.readExternal(this, element);
|
||||||
|
|
||||||
readModule(element);
|
readModule(element);
|
||||||
@@ -117,7 +117,7 @@ public class KotlinRunConfiguration extends JetRunConfiguration {
|
|||||||
@Override
|
@Override
|
||||||
public void writeExternal(Element element) throws WriteExternalException {
|
public void writeExternal(Element element) throws WriteExternalException {
|
||||||
super.writeExternal(element);
|
super.writeExternal(element);
|
||||||
JavaRunConfigurationExtensionManagerUtil.getInstance().writeExternal(this, element);
|
JavaRunConfigurationExtensionManager.getInstance().writeExternal(this, element);
|
||||||
DefaultJDOMExternalizer.writeExternal(this, element);
|
DefaultJDOMExternalizer.writeExternal(this, element);
|
||||||
|
|
||||||
writeModule(element);
|
writeModule(element);
|
||||||
|
|||||||
+1
-1
@@ -216,7 +216,7 @@ public class KotlinTestNgConfigurationProducer extends TestNGConfigurationProduc
|
|||||||
}
|
}
|
||||||
configuration.restoreOriginalModule(originalModule);
|
configuration.restoreOriginalModule(originalModule);
|
||||||
configuration.setName(configuration.getName());
|
configuration.setName(configuration.getName());
|
||||||
JavaRunConfigurationExtensionManagerUtil.getInstance().extendCreatedConfiguration(configuration, location);
|
JavaRunConfigurationExtensionManager.getInstance().extendCreatedConfiguration(configuration, location);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-4
@@ -28,7 +28,6 @@ import com.intellij.refactoring.listeners.RefactoringElementAdapter
|
|||||||
import com.intellij.refactoring.listeners.RefactoringElementListener
|
import com.intellij.refactoring.listeners.RefactoringElementListener
|
||||||
import org.jdom.Element
|
import org.jdom.Element
|
||||||
import org.jetbrains.kotlin.idea.core.script.ScriptConfigurationManager
|
import org.jetbrains.kotlin.idea.core.script.ScriptConfigurationManager
|
||||||
import org.jetbrains.kotlin.idea.run.JavaRunConfigurationExtensionManagerUtil
|
|
||||||
import org.jetbrains.kotlin.idea.run.KotlinRunConfiguration
|
import org.jetbrains.kotlin.idea.run.KotlinRunConfiguration
|
||||||
import org.jetbrains.kotlin.idea.run.script.standalone.KotlinStandaloneScriptRunConfigurationProducer.Companion.pathFromPsiElement
|
import org.jetbrains.kotlin.idea.run.script.standalone.KotlinStandaloneScriptRunConfigurationProducer.Companion.pathFromPsiElement
|
||||||
import org.jetbrains.kotlin.idea.util.ProjectRootsUtil.isProjectSourceFile
|
import org.jetbrains.kotlin.idea.util.ProjectRootsUtil.isProjectSourceFile
|
||||||
@@ -113,13 +112,13 @@ class KotlinStandaloneScriptRunConfiguration(
|
|||||||
ExecutionBundle.message("run.configuration.configuration.tab.title"),
|
ExecutionBundle.message("run.configuration.configuration.tab.title"),
|
||||||
KotlinStandaloneScriptRunConfigurationEditor(project)
|
KotlinStandaloneScriptRunConfigurationEditor(project)
|
||||||
)
|
)
|
||||||
JavaRunConfigurationExtensionManagerUtil.getInstance().appendEditors(this, group)
|
JavaRunConfigurationExtensionManager.instance.appendEditors(this, group)
|
||||||
return group
|
return group
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun writeExternal(element: Element) {
|
override fun writeExternal(element: Element) {
|
||||||
super.writeExternal(element)
|
super.writeExternal(element)
|
||||||
JavaRunConfigurationExtensionManagerUtil.getInstance().writeExternal(this, element)
|
JavaRunConfigurationExtensionManager.instance.writeExternal(this, element)
|
||||||
DefaultJDOMExternalizer.writeExternal(this, element)
|
DefaultJDOMExternalizer.writeExternal(this, element)
|
||||||
EnvironmentVariablesComponent.writeExternal(element, getEnvs())
|
EnvironmentVariablesComponent.writeExternal(element, getEnvs())
|
||||||
PathMacroManager.getInstance(project).collapsePathsRecursively(element)
|
PathMacroManager.getInstance(project).collapsePathsRecursively(element)
|
||||||
@@ -128,7 +127,7 @@ class KotlinStandaloneScriptRunConfiguration(
|
|||||||
override fun readExternal(element: Element) {
|
override fun readExternal(element: Element) {
|
||||||
PathMacroManager.getInstance(project).expandPaths(element)
|
PathMacroManager.getInstance(project).expandPaths(element)
|
||||||
super.readExternal(element)
|
super.readExternal(element)
|
||||||
JavaRunConfigurationExtensionManagerUtil.getInstance().readExternal(this, element)
|
JavaRunConfigurationExtensionManager.instance.readExternal(this, element)
|
||||||
DefaultJDOMExternalizer.readExternal(this, element)
|
DefaultJDOMExternalizer.readExternal(this, element)
|
||||||
EnvironmentVariablesComponent.readExternal(element, getEnvs())
|
EnvironmentVariablesComponent.readExternal(element, getEnvs())
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-5
@@ -77,15 +77,16 @@ class InlayScratchOutputHandler(
|
|||||||
if (shortText != text) {
|
if (shortText != text) {
|
||||||
printToToolWindow(file, expression, output)
|
printToToolWindow(file, expression, output)
|
||||||
}
|
}
|
||||||
editor.inlayModel.addInlay(
|
editor.inlayModel.addAfterLineEndElement(
|
||||||
lineEndOffset,
|
lineEndOffset,
|
||||||
|
false,
|
||||||
InlayScratchFileRenderer(" ".repeat(spaceCount) + shortText, output.type)
|
InlayScratchFileRenderer(" ".repeat(spaceCount) + shortText, output.type)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
val existing = editor.inlayModel
|
val existing = editor.inlayModel
|
||||||
.getInlays(lineEndOffset, lineEndOffset)
|
.getAfterLineEndElementsInRange(lineEndOffset, lineEndOffset)
|
||||||
.singleOrNull()
|
.singleOrNull { it.renderer is InlayScratchFileRenderer }
|
||||||
if (existing != null) {
|
if (existing != null) {
|
||||||
existing.dispose()
|
existing.dispose()
|
||||||
addInlay(((existing.renderer as InlayScratchFileRenderer).text + "; " + output.text).drop(spaceCount))
|
addInlay(((existing.renderer as InlayScratchFileRenderer).text + "; " + output.text).drop(spaceCount))
|
||||||
@@ -111,8 +112,9 @@ class InlayScratchOutputHandler(
|
|||||||
|
|
||||||
private fun clearInlays(editor: TextEditor) {
|
private fun clearInlays(editor: TextEditor) {
|
||||||
TransactionGuard.submitTransaction(editor, Runnable {
|
TransactionGuard.submitTransaction(editor, Runnable {
|
||||||
editor
|
editor.editor.inlayModel
|
||||||
.editor.inlayModel.getInlays(0, editor.editor.document.textLength)
|
.getAfterLineEndElementsInRange(0, editor.editor.document.textLength)
|
||||||
|
.filter { it.renderer is InlayScratchFileRenderer }
|
||||||
.forEach { Disposer.dispose(it) }
|
.forEach { Disposer.dispose(it) }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
+1
@@ -9,6 +9,7 @@ import com.intellij.diff.util.DiffUtil
|
|||||||
import com.intellij.openapi.Disposable
|
import com.intellij.openapi.Disposable
|
||||||
import com.intellij.openapi.application.TransactionGuard
|
import com.intellij.openapi.application.TransactionGuard
|
||||||
import com.intellij.openapi.application.runWriteAction
|
import com.intellij.openapi.application.runWriteAction
|
||||||
|
import com.intellij.openapi.command.executeCommand
|
||||||
import com.intellij.openapi.editor.Document
|
import com.intellij.openapi.editor.Document
|
||||||
import com.intellij.openapi.editor.Editor
|
import com.intellij.openapi.editor.Editor
|
||||||
import com.intellij.openapi.editor.FoldRegion
|
import com.intellij.openapi.editor.FoldRegion
|
||||||
|
|||||||
@@ -1,9 +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.scratch.output
|
|
||||||
|
|
||||||
// BUNCH: 183
|
|
||||||
inline fun executeCommand(crossinline command: () -> Unit) = com.intellij.openapi.command.executeCommand(command = command)
|
|
||||||
@@ -1,19 +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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
@file:Suppress("UnstableApiUsage")
|
|
||||||
|
|
||||||
package org.jetbrains.kotlin.idea.scratch.output
|
|
||||||
|
|
||||||
import com.intellij.openapi.editor.InlayModel
|
|
||||||
|
|
||||||
// BUNCH: 183
|
|
||||||
fun InlayModel.addInlay(offset: Int, renderer: InlayScratchFileRenderer) {
|
|
||||||
addAfterLineEndElement(offset, false, renderer)
|
|
||||||
}
|
|
||||||
|
|
||||||
// BUNCH: 183
|
|
||||||
fun InlayModel.getInlays(start: Int, end: Int) =
|
|
||||||
getAfterLineEndElementsInRange(start, end).filter { it.renderer is InlayScratchFileRenderer }
|
|
||||||
-21
@@ -1,21 +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.maven
|
|
||||||
|
|
||||||
import org.jetbrains.concurrency.AsyncPromise
|
|
||||||
import org.jetbrains.idea.maven.model.MavenArtifact
|
|
||||||
import org.jetbrains.idea.maven.project.MavenProject
|
|
||||||
import org.jetbrains.idea.maven.project.MavenProjectsManager
|
|
||||||
|
|
||||||
//BUNCH: 183
|
|
||||||
fun scheduleArtifactsDownloading(
|
|
||||||
projectsManager: MavenProjectsManager,
|
|
||||||
projects: List<MavenProject>,
|
|
||||||
toBeDownloaded: List<MavenArtifact>
|
|
||||||
) {
|
|
||||||
//true, false, AsyncResult()
|
|
||||||
projectsManager.scheduleArtifactsDownloading(projects, toBeDownloaded, true, false, AsyncPromise())
|
|
||||||
}
|
|
||||||
@@ -17,6 +17,7 @@ import com.intellij.openapi.roots.libraries.Library
|
|||||||
import com.intellij.util.PathUtil
|
import com.intellij.util.PathUtil
|
||||||
import org.jdom.Element
|
import org.jdom.Element
|
||||||
import org.jdom.Text
|
import org.jdom.Text
|
||||||
|
import org.jetbrains.concurrency.AsyncPromise
|
||||||
import org.jetbrains.idea.maven.importing.MavenImporter
|
import org.jetbrains.idea.maven.importing.MavenImporter
|
||||||
import org.jetbrains.idea.maven.importing.MavenRootModelAdapter
|
import org.jetbrains.idea.maven.importing.MavenRootModelAdapter
|
||||||
import org.jetbrains.idea.maven.model.MavenPlugin
|
import org.jetbrains.idea.maven.model.MavenPlugin
|
||||||
@@ -129,7 +130,8 @@ class KotlinMavenImporter : MavenImporter(KOTLIN_PLUGIN_GROUP_ID, KOTLIN_PLUGIN_
|
|||||||
val toBeDownloaded = artifacts.filter { it.libraryName in libraryNames }
|
val toBeDownloaded = artifacts.filter { it.libraryName in libraryNames }
|
||||||
|
|
||||||
if (toBeDownloaded.isNotEmpty()) {
|
if (toBeDownloaded.isNotEmpty()) {
|
||||||
scheduleArtifactsDownloading(MavenProjectsManager.getInstance(module.project), listOf(mavenProject), toBeDownloaded)
|
MavenProjectsManager.getInstance(module.project)
|
||||||
|
.scheduleArtifactsDownloading(listOf(mavenProject), toBeDownloaded, true, false, AsyncPromise())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-2
@@ -29,7 +29,6 @@ import org.jetbrains.kotlin.idea.scratch.actions.ClearScratchAction
|
|||||||
import org.jetbrains.kotlin.idea.scratch.actions.RunScratchAction
|
import org.jetbrains.kotlin.idea.scratch.actions.RunScratchAction
|
||||||
import org.jetbrains.kotlin.idea.scratch.actions.ScratchCompilationSupport
|
import org.jetbrains.kotlin.idea.scratch.actions.ScratchCompilationSupport
|
||||||
import org.jetbrains.kotlin.idea.scratch.output.InlayScratchFileRenderer
|
import org.jetbrains.kotlin.idea.scratch.output.InlayScratchFileRenderer
|
||||||
import org.jetbrains.kotlin.idea.scratch.output.getInlays
|
|
||||||
import org.jetbrains.kotlin.idea.scratch.ui.KtScratchFileEditorWithPreview
|
import org.jetbrains.kotlin.idea.scratch.ui.KtScratchFileEditorWithPreview
|
||||||
import org.jetbrains.kotlin.idea.test.KotlinLightProjectDescriptor
|
import org.jetbrains.kotlin.idea.test.KotlinLightProjectDescriptor
|
||||||
import org.jetbrains.kotlin.idea.test.KotlinWithJdkAndRuntimeLightProjectDescriptor
|
import org.jetbrains.kotlin.idea.test.KotlinWithJdkAndRuntimeLightProjectDescriptor
|
||||||
@@ -200,7 +199,9 @@ abstract class AbstractScratchRunActionTest : FileEditorManagerTestCase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected fun getInlays(start: Int = 0, end: Int = myFixture.file.textLength): List<InlayScratchFileRenderer> {
|
protected fun getInlays(start: Int = 0, end: Int = myFixture.file.textLength): List<InlayScratchFileRenderer> {
|
||||||
val inlineElementsInRange = myFixture.editor.inlayModel.getInlays(start, end)
|
val inlineElementsInRange = myFixture.editor.inlayModel
|
||||||
|
.getAfterLineEndElementsInRange(start, end)
|
||||||
|
.filter { it.renderer is InlayScratchFileRenderer }
|
||||||
return inlineElementsInRange.map { it.renderer as InlayScratchFileRenderer }
|
return inlineElementsInRange.map { it.renderer as InlayScratchFileRenderer }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -238,17 +238,8 @@ class KotlinQuickDocumentationProvider : AbstractDocumentationProvider() {
|
|||||||
return renderKotlinDeclaration(element, quickNavigation)
|
return renderKotlinDeclaration(element, quickNavigation)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getText(element: PsiElement, originalElement: PsiElement?, quickNavigation: Boolean): String? {
|
private fun getText(element: PsiElement, originalElement: PsiElement?, quickNavigation: Boolean) =
|
||||||
// INRE is already fixed in 191 in CtrlMouseHandler.updateOnPsiChanges(), so after abandoning 183 branch try-catch can be removed.
|
getTextImpl(element, originalElement, quickNavigation)
|
||||||
// BUNCH: 183
|
|
||||||
return try {
|
|
||||||
getTextImpl(element, originalElement, quickNavigation)
|
|
||||||
} catch (_: IndexNotReadyException) {
|
|
||||||
DumbService.getInstance(element.project)
|
|
||||||
.showDumbModeNotification("Element information is not available during index update")
|
|
||||||
null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun getTextImpl(element: PsiElement, originalElement: PsiElement?, quickNavigation: Boolean): String? {
|
private fun getTextImpl(element: PsiElement, originalElement: PsiElement?, quickNavigation: Boolean): String? {
|
||||||
if (element is PsiWhiteSpace) {
|
if (element is PsiWhiteSpace) {
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ import org.jetbrains.kotlin.idea.caches.resolve.analyze
|
|||||||
import org.jetbrains.kotlin.idea.caches.resolve.resolveToDescriptorIfAny
|
import org.jetbrains.kotlin.idea.caches.resolve.resolveToDescriptorIfAny
|
||||||
import org.jetbrains.kotlin.idea.references.KtReference
|
import org.jetbrains.kotlin.idea.references.KtReference
|
||||||
import org.jetbrains.kotlin.idea.references.mainReference
|
import org.jetbrains.kotlin.idea.references.mainReference
|
||||||
import org.jetbrains.kotlin.idea.slicer.compat.PsiElement_N183_NN191
|
|
||||||
import org.jetbrains.kotlin.psi.*
|
import org.jetbrains.kotlin.psi.*
|
||||||
import org.jetbrains.kotlin.psi.psiUtil.isPlainWithEscapes
|
import org.jetbrains.kotlin.psi.psiUtil.isPlainWithEscapes
|
||||||
import org.jetbrains.kotlin.psi.psiUtil.parentsWithSelf
|
import org.jetbrains.kotlin.psi.psiUtil.parentsWithSelf
|
||||||
@@ -74,11 +73,7 @@ class KotlinSliceProvider : SliceLanguageSupportProvider, SliceUsageTransformer
|
|||||||
return listOf(KotlinSliceUsage(usage.element, usage.parent, 0, false))
|
return listOf(KotlinSliceUsage(usage.element, usage.parent, 0, false))
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getExpressionAtCaret(atCaret: PsiElement_N183_NN191, dataFlowToThis: Boolean): KtExpression? {
|
override fun getExpressionAtCaret(atCaret: PsiElement, dataFlowToThis: Boolean): KtExpression? {
|
||||||
// BUNCH: 183
|
|
||||||
@Suppress("SENSELESS_COMPARISON")
|
|
||||||
if (atCaret == null) return null
|
|
||||||
|
|
||||||
val element =
|
val element =
|
||||||
atCaret.parentsWithSelf
|
atCaret.parentsWithSelf
|
||||||
.firstOrNull {
|
.firstOrNull {
|
||||||
|
|||||||
@@ -1,11 +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.slicer.compat
|
|
||||||
|
|
||||||
import com.intellij.psi.PsiElement
|
|
||||||
|
|
||||||
// BUNCH: 183
|
|
||||||
internal typealias PsiElement_N183_NN191 = PsiElement
|
|
||||||
@@ -9,6 +9,7 @@ import com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerImpl;
|
|||||||
import com.intellij.codeInsight.daemon.impl.HighlightInfo;
|
import com.intellij.codeInsight.daemon.impl.HighlightInfo;
|
||||||
import com.intellij.openapi.util.io.FileUtil;
|
import com.intellij.openapi.util.io.FileUtil;
|
||||||
import com.intellij.rt.execution.junit.FileComparisonFailure;
|
import com.intellij.rt.execution.junit.FileComparisonFailure;
|
||||||
|
import com.intellij.testFramework.ExpectedHighlightingData;
|
||||||
import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightFixtureTestCase;
|
import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightFixtureTestCase;
|
||||||
import org.jetbrains.kotlin.test.InTextDirectivesUtils;
|
import org.jetbrains.kotlin.test.InTextDirectivesUtils;
|
||||||
import org.jetbrains.kotlin.test.TagsTestDataUtil;
|
import org.jetbrains.kotlin.test.TagsTestDataUtil;
|
||||||
@@ -53,6 +54,6 @@ public abstract class AbstractHighlightingTest extends KotlinLightCodeInsightFix
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
DuplicateHighlightingKt.expectedDuplicatedHighlighting(runnable);
|
ExpectedHighlightingData.expectedDuplicatedHighlighting(runnable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +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.highlighter
|
|
||||||
|
|
||||||
import com.intellij.testFramework.ExpectedHighlightingData
|
|
||||||
|
|
||||||
// Idea 191 has an additional check for duplicate highlighting
|
|
||||||
// BUNCH: 183
|
|
||||||
fun expectedDuplicatedHighlighting(runnable: Runnable) {
|
|
||||||
@Suppress("DEPRECATION")
|
|
||||||
ExpectedHighlightingData.expectedDuplicatedHighlighting(runnable)
|
|
||||||
}
|
|
||||||
@@ -183,8 +183,6 @@ abstract class AbstractScriptConfigurationTest : KotlinCompletionTestCase() {
|
|||||||
val newModuleDir = runWriteAction { VfsUtil.createDirectoryIfMissing(project.baseDir, name) }
|
val newModuleDir = runWriteAction { VfsUtil.createDirectoryIfMissing(project.baseDir, name) }
|
||||||
val newModule = createModuleAt(name, project, JavaModuleType.getModuleType(), newModuleDir.path)
|
val newModule = createModuleAt(name, project, JavaModuleType.getModuleType(), newModuleDir.path)
|
||||||
|
|
||||||
// Return type was changed, but it's not used. BUNCH: 183
|
|
||||||
@Suppress("MissingRecentApi")
|
|
||||||
PsiTestUtil.addSourceContentToRoots(newModule, newModuleDir)
|
PsiTestUtil.addSourceContentToRoots(newModule, newModuleDir)
|
||||||
return newModule
|
return newModule
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,13 +71,8 @@ dependencies {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
if (Ide.IJ183()) {
|
"main" { }
|
||||||
"main" { projectDefault() }
|
"test" { }
|
||||||
"test" { projectDefault() }
|
|
||||||
} else {
|
|
||||||
"main" { }
|
|
||||||
"test" { }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
testsJar {}
|
testsJar {}
|
||||||
|
|||||||
@@ -15,10 +15,6 @@ dependencies {
|
|||||||
compileOnly(project(":compiler:frontend.java"))
|
compileOnly(project(":compiler:frontend.java"))
|
||||||
compileOnly(project(":idea:idea-core"))
|
compileOnly(project(":idea:idea-core"))
|
||||||
|
|
||||||
Ide.IJ183 {
|
|
||||||
compileOnly(project(":idea:idea-android"))
|
|
||||||
}
|
|
||||||
|
|
||||||
compileOnly(project(":idea"))
|
compileOnly(project(":idea"))
|
||||||
compileOnly(project(":idea:idea-jvm"))
|
compileOnly(project(":idea:idea-jvm"))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user