fix compilation against branch 163

This commit is contained in:
Dmitry Jemerov
2016-10-11 18:06:42 +02:00
parent 24c9b6e171
commit a2b0b3d6eb
19 changed files with 43 additions and 54 deletions
@@ -71,7 +71,7 @@ abstract class KotlinGenerateTestSupportActionBase(
if (ApplicationManager.getApplication().isUnitTestMode) return consumer(frameworks.first())
val list = JBList(*frameworks.toTypedArray())
val list = JBList<TestFramework>(*frameworks.toTypedArray())
list.cellRenderer = TestFrameworkListCellRenderer()
PopupChooserBuilder(list)
@@ -113,7 +113,7 @@ class KotlinRecursiveCallLineMarkerProvider : LineMarkerProvider {
callElement,
callElement.textRange,
AllIcons.Gutter.RecursiveMethod,
Pass.UPDATE_OVERRIDEN_MARKERS,
Pass.LINE_MARKERS,
{ "Recursive call" },
null,
GutterIconRenderer.Alignment.RIGHT
@@ -171,7 +171,7 @@ private fun collectSuperDeclarationMarkers(declaration: KtDeclaration, result: M
declaration,
anchor.textRange,
if (implements) IMPLEMENTING_MARK else OVERRIDING_MARK,
Pass.UPDATE_OVERRIDDEN_MARKERS,
Pass.LINE_MARKERS,
SuperDeclarationMarkerTooltip,
SuperDeclarationMarkerNavigationHandler(),
GutterIconRenderer.Alignment.RIGHT
@@ -194,7 +194,7 @@ private fun collectInheritedClassMarker(element: KtClass, result: MutableCollect
anchor,
anchor.textRange,
if (isTrait) IMPLEMENTED_MARK else OVERRIDDEN_MARK,
Pass.UPDATE_OVERRIDDEN_MARKERS,
Pass.LINE_MARKERS,
SUBCLASSED_CLASS.tooltip,
SUBCLASSED_CLASS.navigationHandler,
GutterIconRenderer.Alignment.RIGHT
@@ -225,7 +225,7 @@ private fun collectOverriddenPropertyAccessors(properties: Collection<KtNamedDec
anchor,
anchor.textRange,
if (isImplemented(property)) IMPLEMENTED_MARK else OVERRIDDEN_MARK,
Pass.UPDATE_OVERRIDDEN_MARKERS,
Pass.LINE_MARKERS,
OVERRIDDEN_PROPERTY.tooltip,
OVERRIDDEN_PROPERTY.navigationHandler,
GutterIconRenderer.Alignment.RIGHT
@@ -305,7 +305,7 @@ private fun collectOverriddenFunctions(functions: Collection<KtNamedFunction>, r
anchor,
anchor.textRange,
if (isImplemented(function)) IMPLEMENTED_MARK else OVERRIDDEN_MARK,
Pass.UPDATE_OVERRIDDEN_MARKERS, OVERRIDDEN_FUNCTION.tooltip,
Pass.LINE_MARKERS, OVERRIDDEN_FUNCTION.tooltip,
OVERRIDDEN_FUNCTION.navigationHandler,
GutterIconRenderer.Alignment.RIGHT
))
@@ -39,7 +39,7 @@ import org.jetbrains.plugins.groovy.lang.psi.GroovyFileBase
val KOTLIN_PLUGIN_CLASSPATH_MARKER = "${KotlinWithGradleConfigurator.GROUP_ID}:${KotlinWithGradleConfigurator.GRADLE_PLUGIN_ID}:"
abstract class KotlinGradleInspectionVisitor : BaseInspectionVisitor() {
override fun visitFile(file: GroovyFileBase?) {
override fun visitFile(file: GroovyFileBase) {
if (file == null || !FileUtilRt.extensionEquals(file.name, GradleConstants.EXTENSION)) return
val fileIndex = ProjectRootManager.getInstance(file.project).fileIndex
@@ -29,6 +29,7 @@ import com.intellij.openapi.module.ModuleManager;
import com.intellij.openapi.options.SettingsEditor;
import com.intellij.openapi.util.InvalidDataException;
import com.intellij.openapi.util.WriteExternalException;
import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.util.xmlb.XmlSerializer;
import org.jdom.Element;
import org.jetbrains.annotations.NotNull;
@@ -54,6 +55,11 @@ public final class K2JSRunConfiguration extends ModuleBasedConfiguration<RunConf
return Arrays.asList(ModuleManager.getInstance(getProject()).getModules());
}
@Override
public GlobalSearchScope getSearchScope() {
return SearchScopeProvider.createSearchScope(getModules());
}
@Override
protected ModuleBasedConfiguration createInstance() {
return new K2JSRunConfiguration(getName(), getConfigurationModule(), getFactory());
@@ -186,7 +186,7 @@ private fun smartSelectElement(
val highlighter = ScopeHighlighter(editor)
val list = JBList(model)
val list = JBList<PsiElement>(model)
list.cellRenderer = object : DefaultListCellRenderer() {
override fun getListCellRendererComponent(list: JList<*>, value: Any?, index: Int, isSelected: Boolean, cellHasFocus: Boolean): Component {
@@ -87,7 +87,7 @@ internal fun chooseApplicableComponentFunctions(
if (editor == null) return callback(emptyList())
val list = JBList("Create single variable", "Create destructuring declaration")
val list = JBList<String>("Create single variable", "Create destructuring declaration")
JBPopupFactory.getInstance()
.createListPopupBuilder(list)
.setMovable(true)
@@ -932,7 +932,7 @@ fun checkSuperMethodsWithPopup(
append(" of ")
append(SymbolPresentationUtil.getSymbolPresentableText(superClass))
}
val list = JBList(renameBase, renameCurrent)
val list = JBList<String>(renameBase, renameCurrent)
JBPopupFactory.getInstance()
.createListPopupBuilder(list)
.setTitle(title)
@@ -40,6 +40,7 @@ import com.intellij.psi.PsiClass;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiMethod;
import com.intellij.psi.PsiPackage;
import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.refactoring.listeners.RefactoringElementAdapter;
import com.intellij.refactoring.listeners.RefactoringElementListener;
import kotlin.collections.ArraysKt;
@@ -84,6 +85,12 @@ public class JetRunConfiguration extends ModuleBasedConfiguration<RunConfigurati
return Arrays.asList(ModuleManager.getInstance(getProject()).getModules());
}
@Nullable
@Override
public GlobalSearchScope getSearchScope() {
return SearchScopeProvider.createSearchScope(getModules());
}
@NotNull
@Override
public SettingsEditor<? extends RunConfiguration> getConfigurationEditor() {
@@ -75,7 +75,7 @@ public abstract class ExternalSystemTestCase extends UsefulTestCase {
setUpFixtures();
myProject = myTestFixture.getProject();
edt(new Runnable() {
invokeTestRunnable(new Runnable() {
@Override
public void run() {
ApplicationManager.getApplication().runWriteAction(new Runnable() {
@@ -172,7 +172,7 @@ class GradleInspectionTest : GradleImportingTestCase() {
val globalContext = CodeInsightTestFixtureImpl.createGlobalContextForTool(scope, myProject, inspectionManager, toolWrapper)
val resultRef = Ref<List<String>>()
UsefulTestCase.edt {
invokeTestRunnable {
InspectionTestUtil.runTool(toolWrapper, scope, globalContext)
val presentation = globalContext.getPresentation(toolWrapper)
@@ -197,7 +197,7 @@ abstract class AbstractKotlinEvaluateExpressionTest : KotlinDebuggerTestBase() {
val session = myDebuggerSession.xDebugSession as XDebugSessionImpl
val watchesView = XWatchesViewImpl(session, false)
Disposer.register(testRootDisposable, watchesView)
session.addSessionListener(XDebugViewSessionListener(watchesView), testRootDisposable)
session.addSessionListener(XDebugViewSessionListener(watchesView, session), testRootDisposable)
return watchesView
}
@@ -205,7 +205,7 @@ abstract class AbstractKotlinEvaluateExpressionTest : KotlinDebuggerTestBase() {
val session = myDebuggerSession.xDebugSession as XDebugSessionImpl
val variablesView = XVariablesView(session)
Disposer.register(testRootDisposable, variablesView)
session.addSessionListener(XDebugViewSessionListener(variablesView), testRootDisposable)
session.addSessionListener(XDebugViewSessionListener(variablesView, session), testRootDisposable)
return variablesView
}
@@ -19,6 +19,7 @@ package org.jetbrains.kotlin.idea.quickfix;
import com.intellij.codeInsight.daemon.impl.HighlightInfo;
import com.intellij.codeInsight.daemon.quickFix.QuickFixTestCase;
import com.intellij.codeInsight.intention.IntentionAction;
import com.intellij.codeInspection.InspectionProfileEntry;
import com.intellij.codeInspection.LocalInspectionTool;
import com.intellij.codeInspection.SuppressIntentionAction;
import com.intellij.codeInspection.SuppressableProblemGroup;
@@ -35,6 +36,7 @@ import com.intellij.openapi.vfs.CharsetToolkit;
import com.intellij.psi.PsiElement;
import com.intellij.psi.stubs.StubUpdatingIndex;
import com.intellij.rt.execution.junit.FileComparisonFailure;
import com.intellij.testFramework.InspectionTestUtil;
import com.intellij.util.ArrayUtil;
import com.intellij.util.indexing.FileBasedIndex;
import kotlin.collections.CollectionsKt;
@@ -256,8 +258,10 @@ public abstract class AbstractQuickFixTest extends KotlinLightQuickFixTestCase {
File inspectionFile = QuickfixTestUtilsKt.findInspectionFile(new File(beforeFileName).getParentFile());
if (inspectionFile != null) {
String className = FileUtil.loadFile(inspectionFile).trim();
Class<?> inspectionClass = Class.forName(className);
enableInspectionTools(inspectionClass);
Class<InspectionProfileEntry> inspectionClass = (Class<InspectionProfileEntry>) Class.forName(className);
List<InspectionProfileEntry> tools = InspectionTestUtil.instantiateTools(
Collections.<Class<? extends InspectionProfileEntry>>singletonList(inspectionClass));
enableInspectionTools(tools.get(0));
}
}