Compare commits

...

57 Commits

Author SHA1 Message Date
Nikolay Krasko
292e288280 Merge master to idea12 + change url for bootstrap compiler 2014-01-31 01:47:45 +04:00
Zalim Bashorov
69d3d3ebd4 Reverted commit d357015 for idea12, because it dependent on patch in idea13.
Commit message from d357015:
 Fixed mapping generic type with multiple bounds from Java to Kotlin.

#KT-3480 fixed
2014-01-23 19:18:11 +04:00
Zalim Bashorov
837ca367b0 Fix build after merge. 2014-01-23 16:27:43 +04:00
Zalim Bashorov
e42ebad426 Merge branch 'master' into idea12
Conflicts:
	annotations/com/intellij/psi/search/searches/annotations.xml
	build.xml
	idea/src/org/jetbrains/jet/plugin/formatter/JetFormattingModelBuilder.java
	idea/testData/hierarchy/calls/callers/kotlinProperty/KotlinProperty_verification.xml
	idea/testData/hierarchy/calls/callers/kotlinProperty/main0.kt
	idea/testData/hierarchy/calls/callers/kotlinProperty/main1.java
	idea/tests/org/jetbrains/jet/checkers/KotlinAndJavaCheckerTest.java
	idea/tests/org/jetbrains/jet/plugin/parameterInfo/MockParameterInfoUIContext.java
	update_dependencies.xml
2014-01-23 15:13:30 +04:00
Zalim Bashorov
3c6a5b0b89 Revert bad merged line which decelerated our definition searcher. 2013-12-20 18:53:08 +04:00
Zalim Bashorov
8a2e88a073 Turned off test OverrideImplementTest#testFunctionFromTraitInJava.
Should be turned when 2c5da897bb9eac407a290bef8b6fb7434a0edbd2 will be back ported to IDEA 12.
2013-12-20 18:50:44 +04:00
Zalim Bashorov
570b6df197 Minor -- dropped unnecessary classes. 2013-12-20 14:26:07 +04:00
Zalim Bashorov
b8af512a7d Fix build after merge with master:
- added @NotNull annotations to `AllClassesSearch#search`;
- use `CompletionUtil` instead of `CompletionUtilCore`.
2013-12-20 14:24:34 +04:00
Zalim Bashorov
c6525660c0 Merge master into idea12 2013-12-19 23:08:02 +04:00
Andrey Breslav
bdbd3ee723 Merge remote-tracking branch 'origin/master' into idea12
Conflicts:
	compiler/frontend/serialization/src/org/jetbrains/jet/descriptors/serialization/ProtoBuf.java
	update_dependencies.xml
        KotlinSpellcheckingStrategy.kt
2013-12-06 15:23:24 +04:00
Nikolay Krasko
1ff82e985d Don't download idea for invalid branch 2013-11-29 12:18:10 +04:00
Alexey Sedunov
cc814c1766 Merge master to idea12 2013-11-25 13:45:27 +04:00
Nikolay Krasko
aa2696ced2 Merge master into idea12 2013-11-15 16:32:38 +04:00
Zalim Bashorov
f1cd25a44f Merge master into idea12 2013-10-30 20:41:28 +04:00
Zalim Bashorov
b6e9815d1e Fixed update dependencies for Idea12 branch.
Check archive name instead of os family when extracting it.
2013-10-21 21:06:28 +04:00
Nikolay Krasko
7809d7833c Merge master into idea12 2013-10-17 20:58:56 +04:00
Andrey Breslav
8b33e2a818 Merge commit '31fa1383ba1a7113201d3bb2' into idea12 2013-10-10 19:50:34 +04:00
Alexey Sedunov
78d847c5f9 Merge master into idea12 2013-10-09 18:17:31 +04:00
Alexey Sedunov
b9624d568e Update IDEA SDK version 2013-10-09 15:14:16 +04:00
Andrey Breslav
65fe761951 Merge branch 'master' into idea12
Conflicts:
	jps-plugin/src/org/jetbrains/jet/jps/build/KotlinBuilder.java
2013-10-03 16:26:03 +04:00
Evgeny Gerashchenko
364bf3b4ab Merge remote-tracking branch 'origin/master' into idea12 2013-10-01 21:18:15 +04:00
Andrey Breslav
544399dfb7 Update to IDEA 12.1.5 2013-10-01 20:37:44 +04:00
Andrey Breslav
1a78c63879 Revert 625efe1be1 Update to idea 132.425 2013-10-01 18:09:40 +04:00
Andrey Breslav
5d7eef2f9d Failing hierarchy test removed in IDEA 12 2013-10-01 18:08:41 +04:00
Andrey Breslav
d309797385 Completion test data fixed 2013-10-01 18:08:11 +04:00
Andrey Breslav
305ebbfd4f Fixing a merge problem: restoring cli-parser-1.1.1 2013-10-01 16:42:31 +04:00
Andrey Breslav
8d0f15830f Revert a part of ecab2a2039: Implement extension of method usages search to cover usages of overriding functions in Kotlin 2013-10-01 16:15:56 +04:00
Andrey Breslav
9e4486317b Fixing compilation in idea12 2013-10-01 16:09:17 +04:00
Andrey Breslav
0d0953027d Using guava 12.0 2013-10-01 16:09:17 +04:00
Andrey Breslav
fe366d6743 Using protobuf 2.4.1 2013-10-01 16:09:16 +04:00
Andrey Breslav
bdd4f5077e Merge branch 'master' into idea12
Conflicts:
	update_dependencies.xml
2013-10-01 15:35:12 +04:00
Evgeny Gerashchenko
fab5b73a4b Added hack to avoid exception in tests and compiler.
The hack is relevant only to IDEA 12, because in IDEA 13 related bug is already fixed.
2013-09-13 18:02:28 +04:00
Evgeny Gerashchenko
cbd0db2d9f Merge branch 'master' into idea12 2013-09-12 15:31:53 +04:00
Evgeny Gerashchenko
329486146c Updated IDEA to 129.1237 (12.1.5 EAP) 2013-09-11 16:16:30 +04:00
Evgeny Gerashchenko
ed22ffa37a Merge remote-tracking branch 'origin/master' into HEAD 2013-09-11 16:16:07 +04:00
Evgeny Gerashchenko
c0ade7e433 Committed lost files. 2013-08-30 22:04:03 +04:00
Evgeny Gerashchenko
e20903fa2a Merge branch 'master' into idea12 2013-08-30 21:58:21 +04:00
Evgeny Gerashchenko
9eea98d735 Updated to IDEA 129.1135 (12.1.5 EAP) 2013-08-30 21:40:46 +04:00
Andrey Breslav
320585b419 Protobuf 2.4.1 in build.xml in IDEA 12 2013-08-29 18:27:30 +04:00
Andrey Breslav
342e2278c3 Revert: Update to IDEA EAP 130.1619 (5a3834e) 2013-08-29 18:19:34 +04:00
Andrey Breslav
4e0619449b Use CodeInsightUtilBase in IDEA 12 2013-08-29 18:19:33 +04:00
Andrey Breslav
e8f14d76c2 Revert: Refactoring: Fix deprecation warning (9a45277) 2013-08-29 18:19:33 +04:00
Andrey Breslav
e5bc9917c8 Use protobuf 2.4.1 in IDEA 12 2013-08-29 18:19:33 +04:00
Andrey Breslav
9063db40c8 Merge remote-tracking branch 'origin/master' into idea12
Conflicts:
	idea/src/META-INF/plugin.xml
	update_dependencies.xml
2013-08-29 17:47:49 +04:00
Nikolay Krasko
c318267ba4 Merge branch 'master' into idea 2013-08-14 16:58:56 +04:00
Andrey Breslav
ed23f32777 Adapt to new plugin site behavior 2013-08-14 16:48:16 +04:00
Andrey Breslav
afc4817214 Merge remote-tracking branch 'origin/master' into idea12
Conflicts:
	update_dependencies.xml
2013-08-14 13:54:55 +04:00
Andrey Breslav
dc462b5317 New build with correct sources.zip layout 2013-08-12 14:21:19 +04:00
Andrey Breslav
87a7bec5eb Fixing compilation in IDEA 12.1
Reverting parts of a4451dbf24
2013-08-09 17:20:51 +04:00
Andrey Breslav
804b080364 Fixing compilation in IDEA 12.1
Reverting parts of b14a5f3ea1
2013-08-09 17:18:09 +04:00
Andrey Breslav
45b567f5b3 Fixing required IDEA version to be 12.1 2013-08-09 17:06:26 +04:00
Andrey Breslav
156997bc6f Fix compilation for IDEA 12: no SafeDeleteOverrideAnnotation is available 2013-08-09 16:24:56 +04:00
Andrey Breslav
f663342f4e Fixing compilation for IDEA 12
Revert 530dc1ca95
2013-08-09 15:59:38 +04:00
Andrey Breslav
7e468bace2 Fix compilation: Do not disable JPS in IDEA 12 2013-08-09 15:55:26 +04:00
Andrey Breslav
e58d31ef2d Merge branch 'master' into idea12
Conflicts:
	update_dependencies.xml
2013-08-09 15:18:32 +04:00
Andrey Breslav
a3cc17dd20 Update to IDEA 129.961 2013-08-09 12:32:21 +04:00
Zalim Bashorov
d951e60f7b Fixed the Plugin Publisher. 2013-07-25 20:47:25 +04:00
127 changed files with 3306 additions and 7121 deletions

View File

@@ -4,11 +4,11 @@
<root url="file://$PROJECT_DIR$/annotations" />
</ANNOTATIONS>
<CLASSES>
<root url="jar://$PROJECT_DIR$/ideaSDK/lib/guava-14.0.1.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/lib/guava-12.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/dependencies/guava-14.0.1-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/dependencies/guava-12.0-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -1,11 +1,11 @@
<component name="libraryTable">
<library name="protobuf-java">
<CLASSES>
<root url="jar://$PROJECT_DIR$/ideaSDK/lib/protobuf-2.5.0.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/lib/protobuf-2.4.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/dependencies/protobuf-java-2.5.0-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/dependencies/protobuf-java-2.4.1-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -0,0 +1,11 @@
<root>
<item name='com.intellij.CommonBundle java.lang.String getNoButtonText()'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='com.intellij.CommonBundle java.lang.String getOkButtonText()'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='com.intellij.CommonBundle java.lang.String getYesButtonText()'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
</root>

View File

@@ -0,0 +1,5 @@
<root>
<item name='com.intellij.openapi.components.ComponentManager com.intellij.util.messages.MessageBus getMessageBus()'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
</root>

View File

@@ -1,8 +1,16 @@
<root>
<item
name='com.intellij.psi.search.searches.AllClassesSearch com.intellij.util.Query&lt;com.intellij.psi.PsiClass&gt; search(com.intellij.psi.search.SearchScope, com.intellij.openapi.project.Project)'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item
name='com.intellij.psi.search.searches.ClassInheritorsSearch com.intellij.util.Query&lt;com.intellij.psi.PsiClass&gt; search(com.intellij.psi.PsiClass, com.intellij.psi.search.SearchScope, boolean, boolean, boolean)'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item
name='com.intellij.psi.search.searches.ClassInheritorsSearch com.intellij.util.Query&lt;com.intellij.psi.PsiClass&gt; search(com.intellij.psi.search.searches.ClassInheritorsSearch.SearchParameters)'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item
name='com.intellij.psi.search.searches.DirectClassInheritorsSearch com.intellij.util.Query&lt;com.intellij.psi.PsiClass&gt; search(com.intellij.psi.PsiClass, com.intellij.psi.search.SearchScope, boolean, boolean)'>
<annotation name='org.jetbrains.annotations.NotNull'/>

View File

@@ -29,7 +29,7 @@
<path id="classpath">
<file file="${bootstrap.runtime}"/>
<fileset dir="${idea.sdk}" includes="core/*.jar"/>
<fileset dir="${idea.sdk}" includes="lib/protobuf-2.5.0.jar"/>
<fileset dir="${idea.sdk}" includes="lib/protobuf-2.4.1.jar"/>
<fileset dir="${basedir}/lib" includes="**/*.jar"/>
<fileset dir="${dependencies.dir}" includes="jline.jar"/>
@@ -297,7 +297,7 @@
<zipgroupfileset dir="${basedir}/ideaSDK/core" includes="*.jar" excludes="util.jar"/>
<zipgroupfileset dir="${basedir}/ideaSDK/lib" includes="jna-utils.jar"/>
<zipgroupfileset dir="${basedir}/ideaSDK/lib" includes="oromatcher.jar"/>
<zipgroupfileset dir="${basedir}/ideaSDK/lib" includes="protobuf-2.5.0.jar"/>
<zipgroupfileset dir="${basedir}/ideaSDK/lib" includes="protobuf-2.4.1.jar"/>
<zipgroupfileset dir="${basedir}/ideaSDK/jps" includes="jps-model.jar"/>
<zipgroupfileset dir="${dependencies.dir}" includes="jline.jar"/>
<zipgroupfileset dir="${dependencies.dir}" includes="cli-parser-1.1.1.jar"/>

View File

@@ -282,7 +282,7 @@ public class JetTypeMapper extends BindingTraceAware {
if (descriptor instanceof TypeParameterDescriptor) {
TypeParameterDescriptor typeParameterDescriptor = (TypeParameterDescriptor) descriptor;
Type type = mapType(typeParameterDescriptor.getUpperBounds().iterator().next(), kind);
Type type = mapType(typeParameterDescriptor.getUpperBoundsAsType(), kind);
if (signatureVisitor != null) {
signatureVisitor.writeTypeVariable(typeParameterDescriptor.getName(), type);
}

View File

@@ -140,9 +140,9 @@ public class DiagnosticsWithSuppression implements Diagnostics {
*/
private boolean isSuppressedByAnnotated(@NotNull Diagnostic diagnostic, @NotNull JetAnnotated annotated, int debugDepth) {
if (LOG.isDebugEnabled()) {
LOG.debug("Annotated: ", annotated.getName());
LOG.debug("Depth: ", debugDepth);
LOG.debug("Cache size: ", suppressors.size(), "\n");
LOG.debug("Annotated: " + annotated.getName());
LOG.debug("Depth: " + debugDepth);
LOG.debug("Cache size: " + suppressors.size() + "\n");
}
Suppressor suppressor = getOrCreateSuppressor(annotated);

View File

@@ -56,7 +56,7 @@ public class JetCodeBlockModificationListener implements PsiTreeChangePreprocess
case CHILDREN_CHANGED:
// general childrenChanged() event after each change
if (!event.isGenericChange()) {
if (!event.isGenericChildrenChange()) {
processChange(event.getParent(), event.getParent(), null);
}
break;

View File

@@ -76,7 +76,7 @@ public class StubClassBuilder extends ClassBuilder {
@NotNull String[] interfaces
) {
assert v == null : "defineClass() called twice?";
v = new StubBuildingVisitor<Object>(null, EMPTY_STRATEGY, parent, access, null);
v = new StubBuildingVisitor<Object>(null, EMPTY_STRATEGY, parent, access);
super.defineClass(origin, version, access, name, signature, superName, interfaces);

View File

@@ -82,6 +82,11 @@ public class LightField extends LightElement implements PsiField {
return myField.getType();
}
@Override
public PsiType getTypeNoResolve() {
return getType();
}
@Override
public PsiTypeElement getTypeElement() {
return myField.getTypeElement();

View File

@@ -67,6 +67,9 @@ public class LightVariableBuilder<T extends LightVariableBuilder> extends LightE
return myType;
}
@Override
public PsiType getTypeNoResolve() { return myType; }
@Override
@NotNull
public PsiModifierList getModifierList() {

View File

@@ -1,7 +0,0 @@
import java.util.*;
public class max {
public static <T extends Object & Comparable<? super T>> T max(Collection<? extends T> coll) {
return Collections.max(coll);
}
}

View File

@@ -1,3 +0,0 @@
fun box(): String {
return max.max(java.util.Arrays.asList("AK", "OK", "EK"))!!
}

View File

@@ -1,7 +0,0 @@
import java.util.Collection;
public class unrelatedUpperBounds {
public static <T extends CharSequence & java.io.Serializable> T id(T p) {
return p;
}
}

View File

@@ -1,3 +0,0 @@
fun box(): String {
return unrelatedUpperBounds.id("OK" as java.lang.String)!! as jet.String
}

View File

@@ -1,9 +0,0 @@
package test;
import java.util.Collection;
public class Max {
public <T extends Object & Comparable<? super T>> T max(Collection<? extends T> coll) {
throw new UnsupportedOperationException();
}
}

View File

@@ -1,7 +0,0 @@
package test
public open class Max: Object() {
public open fun max<T : Any?>(p0 : Collection<T>?): T? where T : Comparable<T>? {
throw UnsupportedOperationException()
}
}

View File

@@ -1,6 +0,0 @@
package test
public open class Max : java.lang.Object {
public constructor Max()
public open fun </*0*/ T> max(/*0*/ p0: jet.Collection<T>?): T? where T : jet.Comparable<T>?
}

View File

@@ -17,7 +17,6 @@
package org.jetbrains.jet.cli;
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.util.ArrayUtil;
import com.intellij.util.Function;
import com.intellij.util.containers.ContainerUtil;
@@ -33,6 +32,7 @@ import org.junit.Rule;
import org.junit.rules.TestName;
import java.io.*;
import java.util.ArrayList;
import java.util.List;
public class CliBaseTest {
@@ -78,13 +78,23 @@ public class CliBaseTest {
JetTestUtils.assertEqualsToFile(new File(testDataDir + "/" + testName.getMethodName() + ".out"), actual);
}
@NotNull
public static List<String> loadLines(@NotNull BufferedReader reader) throws IOException {
List<String> lines = new ArrayList<String>();
String line;
while ((line = reader.readLine()) != null) {
lines.add(line);
}
return lines;
}
@NotNull
static String[] readArgs(
@NotNull String argsFilePath,
@NotNull final String testDataDir,
@NotNull final String tempDir
) throws IOException {
List<String> lines = FileUtil.loadLines(new FileInputStream(argsFilePath));
List<String> lines = loadLines(new BufferedReader(new FileReader(argsFilePath)));
return ArrayUtil.toStringArray(ContainerUtil.mapNotNull(lines, new Function<String, String>() {
@Override

View File

@@ -16,14 +16,17 @@
package org.jetbrains.jet.codegen.generated;
import junit.framework.Assert;
import junit.framework.Test;
import junit.framework.TestSuite;
import java.io.File;
import java.util.regex.Pattern;
import org.jetbrains.jet.JetTestUtils;
import org.jetbrains.jet.test.InnerTestClasses;
import org.jetbrains.jet.test.TestMetadata;
import java.io.File;
import java.util.regex.Pattern;
import org.jetbrains.jet.codegen.generated.AbstractBlackBoxCodegenTest;
/** This class is generated by {@link org.jetbrains.jet.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */
@SuppressWarnings("all")
@@ -134,11 +137,6 @@ public class BlackBoxWithJavaCodegenTestGenerated extends AbstractBlackBoxCodege
doTestWithJava("compiler/testData/codegen/boxWithJava/functions/constructor.kt");
}
@TestMetadata("max.kt")
public void testMax() throws Exception {
doTestWithJava("compiler/testData/codegen/boxWithJava/functions/max.kt");
}
@TestMetadata("referencesStaticInnerClassMethod.kt")
public void testReferencesStaticInnerClassMethod() throws Exception {
doTestWithJava("compiler/testData/codegen/boxWithJava/functions/referencesStaticInnerClassMethod.kt");
@@ -149,11 +147,6 @@ public class BlackBoxWithJavaCodegenTestGenerated extends AbstractBlackBoxCodege
doTestWithJava("compiler/testData/codegen/boxWithJava/functions/referencesStaticInnerClassMethodL2.kt");
}
@TestMetadata("unrelatedUpperBounds.kt")
public void testUnrelatedUpperBounds() throws Exception {
doTestWithJava("compiler/testData/codegen/boxWithJava/functions/unrelatedUpperBounds.kt");
}
}
@TestMetadata("compiler/testData/codegen/boxWithJava/innerClass")
@@ -171,12 +164,12 @@ public class BlackBoxWithJavaCodegenTestGenerated extends AbstractBlackBoxCodege
public void testKt3812() throws Exception {
doTestWithJava("compiler/testData/codegen/boxWithJava/innerClass/kt3812.kt");
}
@TestMetadata("kt4036.kt")
public void testKt4036() throws Exception {
doTestWithJava("compiler/testData/codegen/boxWithJava/innerClass/kt4036.kt");
// Doesn't work in idea 12
// doTestWithJava("compiler/testData/codegen/boxWithJava/innerClass/kt4036.kt");
}
}
@TestMetadata("compiler/testData/codegen/boxWithJava/property")

View File

@@ -1386,11 +1386,6 @@ public class LoadJavaTestGenerated extends AbstractLoadJavaTest {
doTestCompiledJavaCompareWithKotlin("compiler/testData/loadJava/compiledJavaCompareWithKotlin/library/LoadIterator.java");
}
@TestMetadata("Max.java")
public void testMax() throws Exception {
doTestCompiledJavaCompareWithKotlin("compiler/testData/loadJava/compiledJavaCompareWithKotlin/library/Max.java");
}
}
@TestMetadata("compiler/testData/loadJava/compiledJavaCompareWithKotlin/modality")

View File

@@ -2369,11 +2369,6 @@ public class LazyResolveRecursiveComparingTestGenerated extends AbstractLazyReso
doTestNotCheckingPrimaryConstructors("compiler/testData/loadJava/compiledJavaCompareWithKotlin/library/LoadIterator.kt");
}
@TestMetadata("Max.kt")
public void testMax() throws Exception {
doTestNotCheckingPrimaryConstructors("compiler/testData/loadJava/compiledJavaCompareWithKotlin/library/Max.kt");
}
}
@TestMetadata("compiler/testData/loadJava/compiledJavaCompareWithKotlin/modality")

View File

@@ -6,7 +6,7 @@
<version>@snapshot@</version>
<vendor url="http://www.jetbrains.com">JetBrains Inc.</vendor>
<idea-version since-build="133.0" until-build="134.0"/>
<idea-version since-build="129.1" until-build="129.99999"/>
<depends optional="true" config-file="junit.xml">JUnit</depends>
<depends optional="true" config-file="gradle.xml">org.jetbrains.plugins.gradle</depends>
@@ -336,9 +336,8 @@
<referencesSearch implementation="org.jetbrains.jet.plugin.search.ideaExtensions.KotlinReferencesSearcher"/>
<directClassInheritorsSearch implementation="org.jetbrains.jet.plugin.search.ideaExtensions.KotlinDirectInheritorsSearcher"/>
<definitionsScopedSearch implementation="org.jetbrains.jet.plugin.search.ideaExtensions.KotlinDefinitionsSearcher"/>
<definitionsSearch implementation="org.jetbrains.jet.plugin.search.ideaExtensions.KotlinDefinitionsSearcher"/>
<annotatedElementsSearch implementation="org.jetbrains.jet.plugin.search.ideaExtensions.KotlinAnnotatedElementsSearcher"/>
<methodReferencesSearch implementation="org.jetbrains.jet.plugin.search.ideaExtensions.KotlinLightMethodUsagesSearcher"/>
<exceptionFilter implementation="org.jetbrains.jet.plugin.filters.JetExceptionFilterFactory" order="first"/>

View File

@@ -1,5 +1,5 @@
<idea-plugin>
<extensions defaultExtensionNs="com.intellij">
<runConfigurationProducer implementation="org.jetbrains.jet.plugin.run.JetTestNgConfigurationProducer"/>
<configurationProducer implementation="org.jetbrains.jet.plugin.run.JetTestNgConfigurationProducer"/>
</extensions>
</idea-plugin>

View File

@@ -4,7 +4,7 @@ import com.google.common.base.Predicate;
import com.google.common.collect.Collections2;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.Messages;
import org.jetbrains.jet.plugin.configuration.ConfigureKotlinInProjectUtils;
@@ -17,7 +17,7 @@ public class ConfigureKotlinInProjectAction extends AnAction {
@Override
public void actionPerformed(AnActionEvent e) {
Project project = CommonDataKeys.PROJECT.getData(e.getDataContext());
Project project = PlatformDataKeys.PROJECT.getData(e.getDataContext());
if (project == null) {
return;
}

View File

@@ -2,7 +2,7 @@ package org.jetbrains.jet.plugin.actions;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.Messages;
import org.jetbrains.jet.plugin.configuration.ConfigureKotlinInProjectUtils;
@@ -13,7 +13,7 @@ public class ConfigureKotlinJsInProjectAction extends AnAction {
@Override
public void actionPerformed(AnActionEvent e) {
Project project = CommonDataKeys.PROJECT.getData(e.getDataContext());
Project project = PlatformDataKeys.PROJECT.getData(e.getDataContext());
if (project == null) {
return;
}

View File

@@ -19,7 +19,7 @@ package org.jetbrains.jet.plugin.actions;
import com.intellij.ide.highlighter.JavaFileType;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.command.CommandProcessor;
import com.intellij.openapi.fileEditor.FileEditorManager;
import com.intellij.openapi.project.Project;
@@ -39,9 +39,9 @@ import static org.jetbrains.jet.plugin.actions.JavaToKotlinActionUtil.*;
public class JavaToKotlinAction extends AnAction {
@Override
public void actionPerformed(AnActionEvent e) {
VirtualFile[] virtualFiles = e.getData(CommonDataKeys.VIRTUAL_FILE_ARRAY);
VirtualFile[] virtualFiles = e.getData(PlatformDataKeys.VIRTUAL_FILE_ARRAY);
assert virtualFiles != null;
final Project project = CommonDataKeys.PROJECT.getData(e.getDataContext());
final Project project = PlatformDataKeys.PROJECT.getData(e.getDataContext());
assert project != null;
final List<PsiFile> selectedJavaFiles = getAllJavaFiles(virtualFiles, project);
if (selectedJavaFiles.isEmpty()) {
@@ -112,7 +112,7 @@ public class JavaToKotlinAction extends AnAction {
@Override
public void update(AnActionEvent e) {
boolean enabled = e.getData(CommonDataKeys.VIRTUAL_FILE_ARRAY) != null;
boolean enabled = e.getData(PlatformDataKeys.VIRTUAL_FILE_ARRAY) != null;
e.getPresentation().setVisible(enabled);
e.getPresentation().setEnabled(enabled);
}

View File

@@ -16,7 +16,7 @@
package org.jetbrains.jet.plugin.actions;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.actionSystem.DefaultActionGroup;
import com.intellij.openapi.actionSystem.Presentation;
@@ -25,7 +25,7 @@ public class KotlinActionGroup extends DefaultActionGroup {
@Override
public void update(AnActionEvent event) {
Presentation p = event.getPresentation();
boolean hasProject = event.getData(CommonDataKeys.PROJECT) != null;
boolean hasProject = event.getData(PlatformDataKeys.PROJECT) != null;
p.setVisible(hasProject);
p.setEnabled(hasProject);

View File

@@ -20,10 +20,10 @@ import com.intellij.spellchecker.tokenizer.SuppressibleSpellcheckingStrategy
import com.intellij.psi.PsiElement
import com.intellij.spellchecker.tokenizer.Tokenizer
import com.intellij.spellchecker.tokenizer.SpellcheckingStrategy
import com.intellij.codeInspection.SuppressQuickFix
import com.intellij.spellchecker.tokenizer.PsiIdentifierOwnerTokenizer
import com.intellij.psi.PsiNameIdentifierOwner
import com.intellij.psi.PsiComment
import com.intellij.codeInspection.SuppressIntentionAction
class KotlinSpellcheckingStrategy: SuppressibleSpellcheckingStrategy() {
private val nameIdentifierTokenizer = PsiIdentifierOwnerTokenizer()
@@ -43,6 +43,6 @@ class KotlinSpellcheckingStrategy: SuppressibleSpellcheckingStrategy() {
}
public override fun isSuppressedFor(element : PsiElement, name : String) : Boolean = false
public override fun getSuppressActions(element : PsiElement, name : String) : Array<SuppressQuickFix> = SuppressQuickFix.EMPTY_ARRAY
public override fun getSuppressActions(element : PsiElement, name : String) : Array<SuppressIntentionAction> = SuppressIntentionAction.EMPTY_ARRAY;
}

View File

@@ -20,14 +20,12 @@ import com.intellij.codeInsight.completion.*;
import com.intellij.openapi.progress.ProcessCanceledException;
import com.intellij.patterns.PlatformPatterns;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiReference;
import com.intellij.psi.tree.IElementType;
import com.intellij.util.ProcessingContext;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.JetNodeTypes;
import org.jetbrains.jet.lang.psi.*;
import org.jetbrains.jet.lang.psi.JetExpression;
import org.jetbrains.jet.lang.psi.JetFile;
import org.jetbrains.jet.plugin.references.JetSimpleNameReference;
public class JetCompletionContributor extends CompletionContributor {
@@ -104,7 +102,7 @@ public class JetCompletionContributor extends CompletionContributor {
int offset = context.getStartOffset();
PsiElement tokenBefore = context.getFile().findElementAt(Math.max(0, offset - 1));
if (context.getCompletionType() == CompletionType.SMART) {
context.setDummyIdentifier(CompletionUtilCore.DUMMY_IDENTIFIER_TRIMMED + "$"); // add '$' to ignore context after the caret
context.setDummyIdentifier(CompletionUtil.DUMMY_IDENTIFIER_TRIMMED + "$"); // add '$' to ignore context after the caret
}
else {
if (JetPackagesContributor.ACTIVATION_PATTERN.accepts(tokenBefore)) {
@@ -114,7 +112,7 @@ public class JetCompletionContributor extends CompletionContributor {
context.setDummyIdentifier(JetExtensionReceiverTypeContributor.DUMMY_IDENTIFIER);
}
else{
context.setDummyIdentifier(CompletionUtilCore.DUMMY_IDENTIFIER_TRIMMED);
context.setDummyIdentifier(CompletionUtil.DUMMY_IDENTIFIER_TRIMMED);
}
}

View File

@@ -16,7 +16,7 @@
package org.jetbrains.jet.plugin.configuration;
import com.intellij.codeInsight.CodeInsightUtilCore;
import com.intellij.codeInsight.CodeInsightUtilBase;
import com.intellij.ide.actions.OpenFileAction;
import com.intellij.ide.highlighter.JavaFileType;
import com.intellij.openapi.application.Result;
@@ -120,7 +120,7 @@ public class KotlinMavenConfigurator implements KotlinProjectConfigurator {
addPluginIfNeeded(domModel, module, virtualFile);
addLibraryDependencyIfNeeded(domModel);
CodeInsightUtilCore.forcePsiPostprocessAndRestoreElement(file);
CodeInsightUtilBase.forcePsiPostprocessAndRestoreElement(file);
}
}.execute();

View File

@@ -16,7 +16,7 @@
package org.jetbrains.jet.plugin.configuration;
import com.intellij.codeInsight.CodeInsightUtilCore;
import com.intellij.codeInsight.CodeInsightUtilBase;
import com.intellij.ide.actions.OpenFileAction;
import com.intellij.openapi.application.Result;
import com.intellij.openapi.command.WriteCommandAction;
@@ -183,7 +183,7 @@ public abstract class KotlinWithGradleConfigurator implements KotlinProjectConfi
protected void run(Result result) {
addElements(groovyFile, version);
CodeInsightUtilCore.forcePsiPostprocessAndRestoreElement(groovyFile);
CodeInsightUtilBase.forcePsiPostprocessAndRestoreElement(groovyFile);
}
}.execute();

View File

@@ -32,7 +32,7 @@ class KotlinSpacingBuilder(val codeStyleSettings: CodeStyleSettings) {
fun getSpacing(parent: ASTBlock, left: ASTBlock, right: ASTBlock): Spacing?
}
inner class BasicSpacingBuilder() : SpacingBuilder(codeStyleSettings, JetLanguage.INSTANCE), Builder {
inner class BasicSpacingBuilder() : SpacingBuilder(codeStyleSettings), Builder {
override fun getSpacing(parent: ASTBlock, left: ASTBlock, right: ASTBlock): Spacing? {
return super<SpacingBuilder>.getSpacing(parent, left, right)
}

View File

@@ -1,15 +1,19 @@
package org.jetbrains.jet.plugin.hierarchy;
import com.intellij.codeInsight.TargetElementUtilBase;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.actionSystem.LangDataKeys;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.project.Project;
import com.intellij.psi.*;
import com.intellij.util.ArrayUtil;
import jet.Function1;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.lang.psi.*;
import org.jetbrains.jet.lang.psi.JetClassOrObject;
import org.jetbrains.jet.lang.psi.JetFile;
import org.jetbrains.jet.lang.psi.JetNamedFunction;
import org.jetbrains.jet.lang.psi.JetProperty;
import org.jetbrains.jet.lang.psi.psiUtil.PsiUtilPackage;
import org.jetbrains.jet.plugin.JetPluginUtil;
@@ -36,7 +40,7 @@ public class HierarchyUtils {
};
public static PsiElement getCurrentElement(DataContext dataContext, Project project) {
Editor editor = CommonDataKeys.EDITOR.getData(dataContext);
Editor editor = PlatformDataKeys.EDITOR.getData(dataContext);
if (editor != null) {
PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument());
if (file == null) return null;
@@ -47,7 +51,7 @@ public class HierarchyUtils {
return TargetElementUtilBase.findTargetElement(editor, TargetElementUtilBase.getInstance().getAllAccepted());
}
return CommonDataKeys.PSI_ELEMENT.getData(dataContext);
return LangDataKeys.PSI_ELEMENT.getData(dataContext);
}
public static PsiElement getCallHierarchyElement(PsiElement element) {

View File

@@ -20,7 +20,8 @@ import com.intellij.codeInsight.TargetElementUtilBase;
import com.intellij.ide.hierarchy.CallHierarchyBrowserBase;
import com.intellij.ide.hierarchy.HierarchyBrowser;
import com.intellij.ide.hierarchy.HierarchyProvider;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.LangDataKeys;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.project.Project;
@@ -34,14 +35,14 @@ import org.jetbrains.jet.plugin.hierarchy.HierarchyUtils;
public class KotlinCallHierarchyProvider implements HierarchyProvider {
@Override
public PsiElement getTarget(@NotNull DataContext dataContext) {
Project project = CommonDataKeys.PROJECT.getData(dataContext);
Project project = PlatformDataKeys.PROJECT.getData(dataContext);
if (project == null) return null;
return HierarchyUtils.getCallHierarchyElement(getCurrentElement(dataContext, project));
}
private static PsiElement getCurrentElement(DataContext dataContext, Project project) {
Editor editor = CommonDataKeys.EDITOR.getData(dataContext);
Editor editor = PlatformDataKeys.EDITOR.getData(dataContext);
if (editor != null) {
PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument());
if (file == null) return null;
@@ -52,7 +53,7 @@ public class KotlinCallHierarchyProvider implements HierarchyProvider {
return TargetElementUtilBase.findTargetElement(editor, TargetElementUtilBase.getInstance().getAllAccepted());
}
return CommonDataKeys.PSI_ELEMENT.getData(dataContext);
return LangDataKeys.PSI_ELEMENT.getData(dataContext);
}
@NotNull

View File

@@ -0,0 +1,33 @@
/*
* Copyright 2010-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.ide.hierarchy.method
import com.intellij.ide.hierarchy.HierarchyNodeDescriptor
import com.intellij.ide.util.treeView.NodeDescriptor
import javax.swing.JTree
import java.util.Comparator
import com.intellij.psi.PsiElement
// Proxy methods for access to the protected methods of MethodHierarchyBrowser
fun MethodHierarchyBrowser.getElementFromDescriptorByExtension(descriptor: HierarchyNodeDescriptor): PsiElement? = getElementFromDescriptor(descriptor)
fun MethodHierarchyBrowser.createTreesByExtension(trees: MutableMap<String, JTree>) = createTrees(trees)
fun MethodHierarchyBrowser.getComparatorByExtension(): Comparator<NodeDescriptor<out Any?>>? = getComparator()

View File

@@ -23,18 +23,33 @@ import com.intellij.ide.hierarchy.HierarchyTreeStructure
import com.intellij.openapi.project.Project
import org.jetbrains.jet.plugin.hierarchy.HierarchyUtils
import org.jetbrains.jet.plugin.JetBundle
import com.intellij.ide.hierarchy.method.MethodHierarchyBrowser
import org.jetbrains.jet.asJava.getRepresentativeLightMethod
import com.intellij.psi.PsiMethod
import java.text.MessageFormat
import com.intellij.psi.ElementDescriptionUtil
import com.intellij.refactoring.util.RefactoringDescriptionLocation
import org.jetbrains.jet.lang.psi.JetDeclaration
import java.util.Comparator
import com.intellij.ide.hierarchy.HierarchyNodeDescriptor
import javax.swing.JTree
import com.intellij.ide.util.treeView.NodeDescriptor
import com.intellij.ide.hierarchy.method.MethodHierarchyBrowser
import com.intellij.ide.hierarchy.method.getComparatorByExtension
import com.intellij.ide.hierarchy.method.createTreesByExtension
import com.intellij.ide.hierarchy.method.getElementFromDescriptorByExtension
import org.jetbrains.jet.asJava.unwrapped
class KotlinOverrideHierarchyBrowser(
project: Project, baseElement: PsiElement
) : MethodHierarchyBrowser(project, baseElement.getRepresentativeLightMethod()) {
) : MethodHierarchyBrowserBase(project, baseElement.getRepresentativeLightMethod()) {
val javaMethodHierarchyBrowser = MethodHierarchyBrowser(project, baseElement.getRepresentativeLightMethod())
override fun getElementFromDescriptor(descriptor: HierarchyNodeDescriptor): PsiElement? =
javaMethodHierarchyBrowser.getElementFromDescriptorByExtension(descriptor)
override fun createTrees(trees: MutableMap<String, JTree>) = javaMethodHierarchyBrowser.createTreesByExtension(trees)
override fun getComparator(): Comparator<NodeDescriptor<out Any?>>? = javaMethodHierarchyBrowser.getComparatorByExtension()
override fun createLegendPanel(): JPanel? =
MethodHierarchyBrowserBase.createStandardLegendPanel(
JetBundle.message("hierarchy.legend.member.is.defined.in.class"),
@@ -42,20 +57,13 @@ class KotlinOverrideHierarchyBrowser(
JetBundle.message("hierarchy.legend.member.should.be.defined")
)
override fun isApplicableElement(psiElement: PsiElement): Boolean =
HierarchyUtils.IS_OVERRIDE_HIERARCHY_ELEMENT(psiElement)
override fun isApplicableElement(element: PsiElement): Boolean =
HierarchyUtils.IS_OVERRIDE_HIERARCHY_ELEMENT(element)
[suppress("PARAMETER_NAME_CHANGED_ON_OVERRIDE")]
override fun createHierarchyTreeStructure(typeName: String, psiElement: PsiElement): HierarchyTreeStructure? =
if (typeName == MethodHierarchyBrowserBase.METHOD_TYPE) KotlinOverrideTreeStructure(myProject, psiElement) else null
override fun getBaseMethod(): PsiMethod? {
val builder = myBuilders.get(myCurrentViewType)
if (builder == null) return null
return (builder.getTreeStructure() as KotlinOverrideTreeStructure).javaTreeStructures.get(0).getBaseMethod()
}
override fun getContentDisplayName(typeName: String, element: PsiElement): String? {
val targetElement = element.unwrapped
if (targetElement is JetDeclaration) {

View File

@@ -20,14 +20,14 @@ import com.intellij.ide.hierarchy.HierarchyProvider
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.psi.PsiElement
import com.intellij.ide.hierarchy.HierarchyBrowser
import com.intellij.openapi.actionSystem.CommonDataKeys
import org.jetbrains.jet.plugin.hierarchy.HierarchyUtils
import com.intellij.ide.hierarchy.MethodHierarchyBrowserBase
import com.intellij.ide.hierarchy.HierarchyBrowserBaseEx
import com.intellij.openapi.actionSystem.PlatformDataKeys
import org.jetbrains.jet.plugin.hierarchy.HierarchyUtils
public class KotlinOverrideHierarchyProvider: HierarchyProvider {
override fun getTarget(dataContext: DataContext): PsiElement? {
return CommonDataKeys.PROJECT.getData(dataContext)?.let { project ->
return PlatformDataKeys.PROJECT.getData(dataContext)?.let { project ->
HierarchyUtils.getOverrideHierarchyElement(HierarchyUtils.getCurrentElement(dataContext, project))
}
}

View File

@@ -40,7 +40,6 @@ import com.intellij.psi.PsiClass
import java.util.Collections
import org.jetbrains.jet.lang.psi.JetPropertyAccessor
import org.jetbrains.jet.asJava.toLightMethods
import com.siyeh.ig.psiutils.CollectionUtils
import com.intellij.util.containers.ContainerUtil
import java.util.HashSet
@@ -51,7 +50,7 @@ class KotlinOverrideTreeStructure(project: Project, val element: PsiElement) : H
setBaseElement(javaTreeStructures.first!!.getBaseDescriptor()!!)
}
override fun buildChildren(descriptor: HierarchyNodeDescriptor): Array<Any> {
override fun buildChildren(descriptor: HierarchyNodeDescriptor?): Array<Any>? {
fun buildChildrenByTreeStructure(javaTreeStructure: MethodHierarchyTreeStructure): Array<Any> {
return javaTreeStructure.getChildElements(descriptor as MethodHierarchyNodeDescriptor) ?: ArrayUtil.EMPTY_OBJECT_ARRAY
}

View File

@@ -38,7 +38,6 @@ import com.intellij.openapi.ui.popup.JBPopupFactory;
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.*;
import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.psi.search.PsiElementProcessor;
import com.intellij.psi.search.PsiElementProcessorAdapter;
import com.intellij.psi.search.searches.AllOverridingMethodsSearch;
@@ -166,7 +165,7 @@ public class JetLineMarkerProvider implements LineMarkerProvider {
new LineMarkerNavigator() {
@Override
public void browse(@Nullable MouseEvent e, @Nullable final PsiElement element) {
public void browse(@Nullable MouseEvent e, @Nullable PsiElement element) {
if (element == null) return;
assert element.getParent() instanceof JetProperty : "This marker navigator should be placed only on identifies in properties";
@@ -184,7 +183,7 @@ public class JetLineMarkerProvider implements LineMarkerProvider {
Runnable jetPsiMethodProcessor = new Runnable() {
@Override
public void run() {
KotlinDefinitionsSearcher.processPropertyImplementationsMethods(psiPropertyMethods, GlobalSearchScope.allScope(element.getProject()), elementProcessor);
KotlinDefinitionsSearcher.processPropertyImplementationsMethods(psiPropertyMethods, elementProcessor);
}
};

View File

@@ -16,7 +16,7 @@
package org.jetbrains.jet.plugin.intentions.declarations;
import com.intellij.codeInsight.CodeInsightUtilCore;
import com.intellij.codeInsight.CodeInsightUtilBase;
import com.intellij.codeInsight.intention.impl.BaseIntentionAction;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.project.Project;
@@ -121,7 +121,7 @@ public class ConvertMemberToExtension extends BaseIntentionAction {
file.addAfter(JetPsiFactory.createNewLine(project), outermostParent);
member.delete();
CodeInsightUtilCore.forcePsiPostprocessAndRestoreElement(added);
CodeInsightUtilBase.forcePsiPostprocessAndRestoreElement(added);
int caretAnchor = added.getText().indexOf(CARET_ANCHOR);
if (caretAnchor >= 0) {

View File

@@ -17,6 +17,7 @@
package org.jetbrains.jet.plugin.k2jsrun;
import com.intellij.execution.ExecutionException;
import com.intellij.execution.Executor;
import com.intellij.execution.configurations.RunProfile;
import com.intellij.execution.configurations.RunProfileState;
import com.intellij.execution.runners.ExecutionEnvironment;
@@ -24,26 +25,24 @@ import com.intellij.execution.runners.GenericProgramRunner;
import com.intellij.execution.ui.RunContentDescriptor;
import com.intellij.openapi.project.Project;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import static org.jetbrains.jet.plugin.k2jsrun.K2JSRunnerUtils.copyJSFileFromOutputToDestination;
import static org.jetbrains.jet.plugin.k2jsrun.K2JSRunnerUtils.openBrowser;
public final class K2JSBrowserProgramRunner extends GenericProgramRunner {
@Nullable
@Override
protected RunContentDescriptor doExecute(
Project project,
Executor executor,
RunProfileState state,
RunContentDescriptor contentToReuse,
ExecutionEnvironment env
) throws ExecutionException {
ExecutionEnvironment env) throws ExecutionException {
if (project == null) {
return null;
}
try {
copyJSFileFromOutputToDestination(project, K2JSRunnerUtils.getSettings(env));
openBrowser(K2JSRunnerUtils.getSettings(env));
copyJSFileFromOutputToDestination(project, K2JSRunnerUtils.getSettings(state));
openBrowser(K2JSRunnerUtils.getSettings(state));
}
catch (Throwable e) {
throw new ExecutionException(e);

View File

@@ -30,6 +30,7 @@ import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleManager;
import com.intellij.openapi.options.SettingsEditor;
import com.intellij.openapi.util.InvalidDataException;
import com.intellij.openapi.util.JDOMExternalizable;
import com.intellij.openapi.util.WriteExternalException;
import com.intellij.util.xmlb.XmlSerializer;
import org.jdom.Element;
@@ -93,6 +94,16 @@ public final class K2JSRunConfiguration extends ModuleBasedConfiguration<RunConf
}
};
}
@Override
public RunnerSettings getRunnerSettings() {
return new RunnerSettings<JDOMExternalizable>(null, K2JSRunConfiguration.this);
}
@Override
public ConfigurationPerRunnerSettings getConfigurationSettings() {
return null;
}
}
@NotNull

View File

@@ -17,8 +17,8 @@
package org.jetbrains.jet.plugin.k2jsrun;
import com.intellij.execution.configurations.RunProfile;
import com.intellij.execution.runners.ExecutionEnvironment;
import com.intellij.ide.browsers.UrlOpener;
import com.intellij.execution.configurations.RunProfileState;
import com.intellij.ide.browsers.BrowsersConfiguration;
import com.intellij.openapi.compiler.CompilerPaths;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleManager;
@@ -80,13 +80,12 @@ public final class K2JSRunnerUtils {
}
String filePath = configurationSettings.getPageToOpenFilePath();
String url = VirtualFileManager.constructUrl(LocalFileSystem.PROTOCOL, filePath);
UrlOpener.launchBrowser(configurationSettings.getBrowserFamily(), url);
BrowsersConfiguration.launchBrowser(configurationSettings.getBrowserFamily(), url);
}
@NotNull
public static K2JSConfigurationSettings getSettings(@NotNull ExecutionEnvironment env) {
RunProfile profile = env.getRunProfile();
public static K2JSConfigurationSettings getSettings(@NotNull RunProfileState state) {
RunProfile profile = state.getRunnerSettings().getRunProfile();
assert profile instanceof K2JSRunConfiguration;
return ((K2JSRunConfiguration) profile).settings();
}

View File

@@ -28,7 +28,7 @@ import com.intellij.openapi.fileTypes.SyntaxHighlighter;
import com.intellij.openapi.project.DumbService;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.impl.PsiDocumentManagerBase;
import com.intellij.psi.impl.PsiDocumentManagerImpl;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.lang.psi.JetFile;
@@ -60,7 +60,7 @@ public final class JetContentBasedFileSubstitutor implements ContentBasedClassFi
private void processDeferredBindings(VirtualFile loadedFile, @NotNull Document document) {
JetFile file = deferredDocumentBinding.remove(loadedFile);
if (file != null) {
PsiDocumentManagerBase.cachePsi(document, file);
PsiDocumentManagerImpl.cachePsi(document, file);
}
}
});

View File

@@ -178,14 +178,6 @@ class JetDummyClassFileViewProvider extends UserDataHolderBase implements FileVi
throw new UnsupportedOperationException();
}
@NotNull
@Override
public PsiFile getStubBindingRoot() {
PsiFile psi = getPsi(getBaseLanguage());
assert psi != null;
return psi;
}
public static JetFile createJetFile(PsiManager psiManager, VirtualFile file, String text) {
return new JetDummyClassFileViewProvider(psiManager, file, text).getPsi(JetLanguage.INSTANCE);
}

View File

@@ -21,14 +21,14 @@ import com.intellij.openapi.components.State;
import com.intellij.openapi.components.Storage;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleComponent;
import com.intellij.openapi.roots.impl.storage.ClassPathStorageUtil;
import com.intellij.openapi.roots.impl.storage.ClasspathStorage;
import org.jetbrains.annotations.NotNull;
@Deprecated
@State(
name = "K2JSModule",
storages = @Storage(
id = ClassPathStorageUtil.DEFAULT_STORAGE,
id = ClasspathStorage.DEFAULT_STORAGE,
file = "$MODULE_FILE$"
)
)

View File

@@ -16,7 +16,7 @@
package org.jetbrains.jet.plugin.quickfix;
import com.intellij.codeInsight.FileModificationService;
import com.intellij.codeInsight.CodeInsightUtilBase;
import com.intellij.codeInsight.intention.IntentionAction;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.project.Project;
@@ -79,7 +79,7 @@ public class ExclExclCallFix implements IntentionAction {
@Override
public void invoke(@NotNull Project project, Editor editor, PsiFile file) throws IncorrectOperationException {
if (!FileModificationService.getInstance().prepareFileForWrite(file)) {
if (!CodeInsightUtilBase.prepareFileForWrite(file)) {
return;
}

View File

@@ -16,7 +16,7 @@
package org.jetbrains.jet.plugin.quickfix;
import com.intellij.codeInsight.FileModificationService;
import com.intellij.codeInsight.CodeInsightUtilBase;
import com.intellij.codeInsight.intention.IntentionAction;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.project.Project;
@@ -43,7 +43,7 @@ public abstract class JetIntentionAction<T extends PsiElement> implements Intent
@Override
public void invoke(@NotNull Project project, Editor editor, PsiFile file) throws IncorrectOperationException {
if (file instanceof JetFile) {
if (FileModificationService.getInstance().prepareFileForWrite(element.getContainingFile())) {
if (CodeInsightUtilBase.prepareFileForWrite(element.getContainingFile())) {
invoke(project, editor, (JetFile) file);
}
}

View File

@@ -37,9 +37,9 @@ public class KotlinSuppressIntentionAction(
override fun getFamilyName() = JetBundle.message("suppress.warnings.family")
override fun getText() = JetBundle.message("suppress.warning.for", diagnosticFactory.getName(), kind.kind, kind.name)
override fun isAvailable(project: Project, editor: Editor?, element: PsiElement) = element.isValid()
override fun isAvailable(project: Project, editor: Editor, element: PsiElement) = element.isValid()
override fun invoke(project: Project, editor: Editor?, element: PsiElement) {
override fun invoke(project: Project, editor: Editor, element: PsiElement) {
val id = "\"${diagnosticFactory.getName()}\""
if (suppressAt is JetModifierListOwner) {
suppressAtModifierListOwner(suppressAt, id)

View File

@@ -150,7 +150,7 @@ public class MapPlatformClassToKotlinFix extends JetIntentionAction<JetReference
caretModel.moveToOffset(file.getNode().getStartOffset());
TemplateBuilderImpl builder = new TemplateBuilderImpl(file);
Expression expression = new MyLookupExpression(primaryReplacedExpression.getText(), options, null, null, false,
Expression expression = new MyLookupExpression(primaryReplacedExpression.getText(), options, null, false,
JetBundle.message("map.platform.class.to.kotlin.advertisement"));
builder.replaceElement(primaryReplacedExpression, PRIMARY_USAGE, expression, true);

View File

@@ -198,19 +198,19 @@ public class JetChangeSignature(val project: Project,
private fun buildDialogOptions(isSingleFunctionSelected: Boolean): List<String> {
if (isSingleFunctionSelected) {
return arrayListOf(Messages.YES_BUTTON, Messages.NO_BUTTON, Messages.CANCEL_BUTTON)
return arrayListOf(CommonBundle.getYesButtonText(), CommonBundle.getNoButtonText(), CommonBundle.getCancelButtonText())
}
else {
return arrayListOf(Messages.OK_BUTTON, Messages.CANCEL_BUTTON)
return arrayListOf(CommonBundle.getOkButtonText(), CommonBundle.getCancelButtonText())
}
}
private fun performForWholeHierarchy(dialogButtons: List<String>, code: Int): Boolean {
return buttonPressed(code, dialogButtons, Messages.YES_BUTTON) || buttonPressed(code, dialogButtons, Messages.OK_BUTTON)
return buttonPressed(code, dialogButtons, CommonBundle.getYesButtonText()) || buttonPressed(code, dialogButtons, CommonBundle.getOkButtonText())
}
private fun performForSelectedFunctionOnly(dialogButtons: List<String>, code: Int): Boolean {
return buttonPressed(code, dialogButtons, Messages.NO_BUTTON)
return buttonPressed(code, dialogButtons, CommonBundle.getNoButtonText())
}
private fun buttonPressed(code: Int, dialogButtons: List<String>, button: String): Boolean {

View File

@@ -29,7 +29,6 @@ import com.intellij.psi.search.searches.ReferencesSearch;
import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.refactoring.safeDelete.JavaSafeDeleteProcessor;
import com.intellij.refactoring.safeDelete.NonCodeUsageSearchInfo;
import com.intellij.refactoring.safeDelete.usageInfo.SafeDeleteOverrideAnnotation;
import com.intellij.refactoring.safeDelete.usageInfo.SafeDeleteOverridingMethodUsageInfo;
import com.intellij.refactoring.safeDelete.usageInfo.SafeDeleteReferenceJavaDeleteUsageInfo;
import com.intellij.refactoring.safeDelete.usageInfo.SafeDeleteReferenceSimpleDeleteUsageInfo;
@@ -210,29 +209,6 @@ public class KotlinSafeDeleteProcessor extends JavaSafeDeleteProcessor {
? new KotlinSafeDeleteOverridingUsageInfo(usageElement, overrideUsageInfo.getReferencedElement())
: null;
}
else if (usageInfo instanceof SafeDeleteOverrideAnnotation) {
SafeDeleteOverrideAnnotation overrideAnnotationUsageInfo = (SafeDeleteOverrideAnnotation) usageInfo;
PsiElement targetElement = overrideAnnotationUsageInfo.getSmartPointer().getElement();
if (targetElement != null) {
boolean noSuperMethods = ContainerUtil.and(
AsJavaPackage.toLightMethods(targetElement),
new Condition<PsiMethod>() {
@Override
public boolean value(PsiMethod method) {
return method.findSuperMethods().length == 0;
}
}
);
usageInfo = noSuperMethods
? new KotlinSafeDeleteOverrideAnnotation(targetElement, overrideAnnotationUsageInfo.getReferencedElement())
: null;
}
else {
usageInfo = null;
}
}
else if (usageInfo instanceof SafeDeleteReferenceJavaDeleteUsageInfo) {
SafeDeleteReferenceJavaDeleteUsageInfo javaDeleteUsageInfo = (SafeDeleteReferenceJavaDeleteUsageInfo) usageInfo;
PsiElement usageElement = javaDeleteUsageInfo.getElement();
@@ -599,4 +575,4 @@ public class KotlinSafeDeleteProcessor extends JavaSafeDeleteProcessor {
result.add(method.getParameterList().getParameters()[parameterIndex]);
}
}
}
}

View File

@@ -35,8 +35,6 @@ import org.jetbrains.jet.plugin.JetMainDetector;
import org.jetbrains.jet.plugin.JetPluginUtil;
import org.jetbrains.jet.plugin.project.ProjectStructureUtil;
import java.util.List;
public class JetRunConfigurationProducer extends RuntimeConfigurationProducer implements Cloneable {
@Nullable
private PsiElement mySourceElement;
@@ -104,7 +102,7 @@ public class JetRunConfigurationProducer extends RuntimeConfigurationProducer im
@Override
protected RunnerAndConfigurationSettings findExistingByElement(
Location location,
@NotNull List<RunnerAndConfigurationSettings> existingConfigurations,
@NotNull RunnerAndConfigurationSettings[] existingConfigurations,
ConfigurationContext context
) {
JetFile file = getStartClassFile(location);

View File

@@ -19,10 +19,10 @@ package org.jetbrains.jet.plugin.run;
import com.intellij.execution.JavaRunConfigurationExtensionManager;
import com.intellij.execution.Location;
import com.intellij.execution.PsiLocation;
import com.intellij.execution.RunnerAndConfigurationSettings;
import com.intellij.execution.actions.ConfigurationContext;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Ref;
import com.intellij.psi.PsiClass;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiMethod;
@@ -31,33 +31,35 @@ import com.intellij.psi.util.PsiTreeUtil;
import com.theoryinpractice.testng.configuration.TestNGConfiguration;
import com.theoryinpractice.testng.configuration.TestNGConfigurationProducer;
import com.theoryinpractice.testng.util.TestNGUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.asJava.LightClassUtil;
import org.jetbrains.jet.lang.psi.*;
import org.jetbrains.jet.plugin.JetPluginUtil;
public class JetTestNgConfigurationProducer extends TestNGConfigurationProducer {
public JetTestNgConfigurationProducer() {
super();
}
private JetElement myElement = null;
@Override
protected boolean setupConfigurationFromContext(
TestNGConfiguration configuration, ConfigurationContext context, Ref<PsiElement> sourceElement
) {
public PsiElement getSourceElement() {
return myElement;
}
@Override
@Nullable
protected RunnerAndConfigurationSettings createConfigurationByElement(Location location, ConfigurationContext context) {
// TODO: check TestNG Pattern running first, before method/class (see TestNGInClassConfigurationProducer for logic)
// TODO: and PsiClassOwner not handled, which is in TestNGInClassConfigurationProducer
Location location = context.getLocation();
if (location == null) {
return false;
}
Project project = context.getProject();
Project project = location.getProject();
PsiElement leaf = location.getPsiElement();
if (!JetPluginUtil.isInSource(leaf, true)) {
return false;
}
if (!(leaf.getContainingFile() instanceof JetFile)) {
return false;
return null;
}
JetFile jetFile = (JetFile) leaf.getContainingFile();
@@ -73,7 +75,8 @@ public class JetTestNgConfigurationProducer extends TestNGConfigurationProducer
for (PsiMethod method : delegate.getMethods()) {
if (method.getNavigationElement() == function) {
if (TestNGUtil.hasTest(method)) {
return configure(configuration, location, context, project, delegate, method);
myElement = function;
return createRuntimeConfigSettings(location, context, project, delegate, method);
}
break;
}
@@ -89,25 +92,27 @@ public class JetTestNgConfigurationProducer extends TestNGConfigurationProducer
}
if (jetClass == null) {
return false;
return null;
}
PsiClass delegate = LightClassUtil.getPsiClass(jetClass);
if (!isTestNGClass(delegate)) {
return false;
return null;
}
return configure(configuration, location, context, project, delegate, null);
myElement = jetClass;
return createRuntimeConfigSettings(location, context, project, delegate, null);
}
private boolean configure(
TestNGConfiguration configuration, Location location, ConfigurationContext context, Project project,
@Nullable PsiClass delegate, @Nullable PsiMethod method
) {
private RunnerAndConfigurationSettings createRuntimeConfigSettings(
Location location, ConfigurationContext context, Project project,
@Nullable PsiClass delegate, @Nullable PsiMethod method) {
if (delegate == null) {
return false;
return null;
}
RunnerAndConfigurationSettings settings = cloneTemplateConfiguration(project, context);
TestNGConfiguration configuration = (TestNGConfiguration) settings.getConfiguration();
setupConfigurationModule(context, configuration);
Module originalModule = configuration.getConfigurationModule().getModule();
configuration.setClassConfiguration(delegate);
@@ -115,12 +120,17 @@ public class JetTestNgConfigurationProducer extends TestNGConfigurationProducer
configuration.setMethodConfiguration(PsiLocation.fromPsiElement(project, method));
}
configuration.restoreOriginalModule(originalModule);
configuration.setName(configuration.getName());
settings.setName(configuration.getName());
JavaRunConfigurationExtensionManager.getInstance().extendCreatedConfiguration(configuration, location);
return true;
return settings;
}
private static boolean isTestNGClass(PsiClass psiClass) {
return psiClass != null && PsiClassUtil.isRunnableClass(psiClass, true, false) && TestNGUtil.hasTest(psiClass);
}
@Override
public int compareTo(@NotNull Object o) {
return 0;
}
}

View File

@@ -18,77 +18,68 @@ package org.jetbrains.jet.plugin.search.ideaExtensions;
import com.intellij.codeInsight.navigation.MethodImplementationsSearch;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.application.QueryExecutorBase;
import com.intellij.openapi.util.Computable;
import com.intellij.psi.PsiClass;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiMethod;
import com.intellij.psi.search.SearchScope;
import com.intellij.psi.search.searches.ClassInheritorsSearch;
import com.intellij.psi.search.searches.DefinitionsScopedSearch;
import com.intellij.util.Processor;
import com.intellij.util.QueryExecutor;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.asJava.LightClassUtil;
import org.jetbrains.jet.lang.psi.*;
import org.jetbrains.jet.lang.resolve.java.jetAsJava.KotlinLightMethod;
public class KotlinDefinitionsSearcher implements QueryExecutor<PsiElement, DefinitionsScopedSearch.SearchParameters> {
public class KotlinDefinitionsSearcher extends QueryExecutorBase<PsiElement, PsiElement> {
@Override
public boolean execute(@NotNull DefinitionsScopedSearch.SearchParameters queryParameters, @NotNull Processor<PsiElement> consumer) {
PsiElement element = queryParameters.getElement();
SearchScope scope = queryParameters.getScope();
if (element instanceof JetClass) {
return processClassImplementations((JetClass) element, consumer);
public void processQuery(@NotNull PsiElement queryParameters, @NotNull Processor<PsiElement> consumer) {
if (queryParameters instanceof JetClass) {
processClassImplementations((JetClass) queryParameters, consumer);
}
if (element instanceof JetNamedFunction) {
return processFunctionImplementations((JetNamedFunction) element, scope, consumer);
if (queryParameters instanceof JetNamedFunction) {
processFunctionImplementations((JetNamedFunction) queryParameters, consumer);
}
if (element instanceof JetProperty) {
return processPropertyImplementations((JetProperty) element, scope, consumer);
if (queryParameters instanceof JetProperty) {
processPropertyImplementations((JetProperty) queryParameters, consumer);
}
if (element instanceof JetParameter) {
JetParameter parameter = (JetParameter) element;
if (queryParameters instanceof JetParameter) {
JetParameter parameter = (JetParameter) queryParameters;
if (JetPsiUtil.getClassIfParameterIsProperty(parameter) != null) {
return processPropertyImplementations((JetParameter) element, scope, consumer);
processPropertyImplementations(parameter, consumer);
}
}
}
return true;
}
private static boolean processClassImplementations(final JetClass klass, Processor<PsiElement> consumer) {
private static void processClassImplementations(final JetClass queryParameters, Processor<PsiElement> consumer) {
PsiClass psiClass = ApplicationManager.getApplication().runReadAction(new Computable<PsiClass>() {
@Override
public PsiClass compute() {
return LightClassUtil.getPsiClass(klass);
return LightClassUtil.getPsiClass(queryParameters);
}
});
if (psiClass != null) {
return ContainerUtil.process(ClassInheritorsSearch.search(psiClass, true), consumer);
ContainerUtil.process(ClassInheritorsSearch.search(psiClass, true), consumer);
}
return true;
}
private static boolean processFunctionImplementations(final JetNamedFunction function, SearchScope scope, Processor<PsiElement> consumer) {
private static void processFunctionImplementations(final JetNamedFunction queryParameters, Processor<PsiElement> consumer) {
PsiMethod psiMethod = ApplicationManager.getApplication().runReadAction(new Computable<PsiMethod>() {
@Override
public PsiMethod compute() {
return LightClassUtil.getLightClassMethod(function);
return LightClassUtil.getLightClassMethod(queryParameters);
}
});
if (psiMethod != null) {
ContainerUtil.process(MethodImplementationsSearch.getMethodImplementations(psiMethod, scope), consumer);
ContainerUtil.process(MethodImplementationsSearch.getMethodImplementations(psiMethod), consumer);
}
return true;
}
private static boolean processPropertyImplementations(@NotNull final JetParameter parameter, @NotNull SearchScope scope, @NotNull Processor<PsiElement> consumer) {
private static void processPropertyImplementations(@NotNull final JetParameter parameter, @NotNull Processor<PsiElement> consumer) {
LightClassUtil.PropertyAccessorsPsiMethods accessorsPsiMethods = ApplicationManager.getApplication().runReadAction(
new Computable<LightClassUtil.PropertyAccessorsPsiMethods>() {
@Override
@@ -97,10 +88,10 @@ public class KotlinDefinitionsSearcher implements QueryExecutor<PsiElement, Defi
}
});
return processPropertyImplementationsMethods(accessorsPsiMethods, scope, consumer);
processPropertyImplementationsMethods(accessorsPsiMethods, consumer);
}
private static boolean processPropertyImplementations(@NotNull final JetProperty property, @NotNull SearchScope scope, @NotNull Processor<PsiElement> consumer) {
private static void processPropertyImplementations(@NotNull final JetProperty property, @NotNull Processor<PsiElement> consumer) {
LightClassUtil.PropertyAccessorsPsiMethods accessorsPsiMethods = ApplicationManager.getApplication().runReadAction(
new Computable<LightClassUtil.PropertyAccessorsPsiMethods>() {
@Override
@@ -109,32 +100,25 @@ public class KotlinDefinitionsSearcher implements QueryExecutor<PsiElement, Defi
}
});
return processPropertyImplementationsMethods(accessorsPsiMethods, scope, consumer);
processPropertyImplementationsMethods(accessorsPsiMethods, consumer);
}
public static boolean processPropertyImplementationsMethods(LightClassUtil.PropertyAccessorsPsiMethods accessors, @NotNull SearchScope scope, @NotNull Processor<PsiElement> consumer) {
public static void processPropertyImplementationsMethods(LightClassUtil.PropertyAccessorsPsiMethods accessors, @NotNull Processor<PsiElement> consumer) {
for (PsiMethod method : accessors) {
PsiMethod[] implementations = MethodImplementationsSearch.getMethodImplementations(method, scope);
PsiMethod[] implementations = MethodImplementationsSearch.getMethodImplementations(method);
for (PsiMethod implementation : implementations) {
PsiElement mirrorElement = implementation instanceof KotlinLightMethod
? ((KotlinLightMethod) implementation).getOrigin() : null;
if (mirrorElement instanceof JetProperty || mirrorElement instanceof JetParameter) {
if (!consumer.process(mirrorElement)) {
return false;
}
consumer.process(mirrorElement);
}
else if (mirrorElement instanceof JetPropertyAccessor && mirrorElement.getParent() instanceof JetProperty) {
if (!consumer.process(mirrorElement.getParent())) {
return false;
}
consumer.process(mirrorElement.getParent());
}
else {
if (!consumer.process(implementation)) {
return false;
}
consumer.process(implementation);
}
}
}
return true;
}
}

View File

@@ -1,29 +0,0 @@
package org.jetbrains.jet.plugin.search.ideaExtensions;
import com.intellij.psi.PsiClass;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiMethod;
import com.intellij.psi.PsiReference;
import com.intellij.psi.impl.search.MethodTextOccurrenceProcessor;
import com.intellij.util.Processor;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.asJava.LightClassUtil;
import org.jetbrains.jet.lang.psi.JetNamedFunction;
public class KotlinLightMethodTextOccurrenceProcessor extends MethodTextOccurrenceProcessor {
public KotlinLightMethodTextOccurrenceProcessor(@NotNull PsiClass aClass, boolean strictSignatureSearch, PsiMethod... methods) {
super(aClass, strictSignatureSearch, methods);
}
@Override
protected boolean processInexactReference(
PsiReference ref, PsiElement refElement, PsiMethod method, Processor<PsiReference> consumer
) {
if (refElement instanceof JetNamedFunction) {
PsiMethod lightMethod = LightClassUtil.getLightClassMethod((JetNamedFunction) refElement);
if (lightMethod != null) return super.processInexactReference(ref, lightMethod, method, consumer);
}
return true;
}
}

View File

@@ -1,15 +0,0 @@
package org.jetbrains.jet.plugin.search.ideaExtensions;
import com.intellij.psi.PsiClass;
import com.intellij.psi.PsiMethod;
import com.intellij.psi.impl.search.MethodTextOccurrenceProcessor;
import com.intellij.psi.impl.search.MethodUsagesSearcher;
public class KotlinLightMethodUsagesSearcher extends MethodUsagesSearcher {
@Override
protected MethodTextOccurrenceProcessor getTextOccurrenceProcessor(
PsiMethod[] methods, PsiClass aClass, boolean strictSignatureSearch
) {
return new KotlinLightMethodTextOccurrenceProcessor(aClass, strictSignatureSearch, methods);
}
}

View File

@@ -2,4 +2,4 @@ fun testing() {
<caret>SomeClass<List<String>>()
}
// INFO: <b>public</b> <b>constructor</b> SomeClass&lt;T : jet.List&lt;jet.Any?&gt;?>() <i>defined in</i> SomeClass<br/>Java declaration:<br/>[light_idea_test_case] public class SomeClass&lt;T extends java.util.List&gt; extends Object
// INFO: <b>public</b> <b>constructor</b> SomeClass&lt;T : jet.List&lt;jet.Any?&gt;?>() <i>defined in</i> SomeClass<br/>Java declaration:<br/>[light_idea_test_case] public class SomeClass<T extends java.util.List> extends Object

View File

@@ -1,11 +1,11 @@
<node text="packageVal ()" base="true">
<node text="JA ()"/>
<node text="KClient ()"/>
<node text="JA.getName()(2 usages) ()"/>
<node text="KClient ()"/>
<node text="KClient ()"/>
<node text="KClient.bar() ()"/>
<node text="KClient.bar(2 usages) ()"/>
<node text="KClientObj(2 usages) ()"/>
<node text="bar.localFun() ()"/>
<node text="JA ()"/>
<node text="KClient.bar(2 usages) ()"/>
<node text="KClient.bar() ()"/>
<node text="KClient ()"/>
<node text="packageFun(String) ()"/>
<node text="KClientObj(2 usages) ()"/>
</node>

View File

@@ -1,12 +1,12 @@
<node text="KA.name ()" base="true">
<node text="JA(2 usages) ()"/>
<node text="JA.getName()(2 usages) ()"/>
<node text="KClient(2 usages) ()"/>
<node text="KClient(2 usages) ()"/>
<node text="KClient.bar()(2 usages) ()"/>
<node text="KClient.bar(4 usages) ()"/>
<node text="KClientObj(4 usages) ()"/>
<node text="bar.localFun()(2 usages) ()"/>
<node text="main0.kt(2 usages) ()"/>
<node text="packageFun(String)(2 usages) ()"/>
<node text="KClient ()"/>
<node text="KClient ()"/>
<node text="KClient.bar() ()"/>
<node text="KClient.bar(2 usages) ()"/>
<node text="KClientObj(2 usages) ()"/>
<node text="bar.localFun() ()"/>
<node text="main0.kt ()"/>
<node text="packageFun(String) ()"/>
</node>

View File

@@ -1,4 +1,4 @@
// ERROR: Cannot perform refactoring.\nCannot find a single definition to inline
// ERROR: Cannot perform refactoring.\nCannot find a single definition to inline.
fun f() {
val v: Int

View File

@@ -1,4 +1,4 @@
// ERROR: Cannot perform refactoring.\nVariable v has no initializer
// ERROR: Cannot perform refactoring.\nVariable v has no initializer.
fun f() {
val v: Int

View File

@@ -1 +1,2 @@
class test.A has 1 usage that is not safe to delete.
class test.A has 1 usage that is not safe to delete.
Of those 0 usages are in strings, comments, or non-code files.

View File

@@ -1 +1,2 @@
class test.A has 3 usages that are not safe to delete.Of those 2 usages are in strings, comments, non-code files or generated code.
class test.A has 3 usages that are not safe to delete.
Of those 2 usages are in strings, comments, or non-code files.

View File

@@ -1 +1,2 @@
class foo.A has 1 usage that is not safe to delete.
class foo.A has 1 usage that is not safe to delete.
Of those 0 usages are in strings, comments, or non-code files.

View File

@@ -1 +1,2 @@
class test.A.C has 1 usage that is not safe to delete.
class test.A.C has 1 usage that is not safe to delete.
Of those 0 usages are in strings, comments, or non-code files.

View File

@@ -1 +1,2 @@
trait test.A has 1 usage that is not safe to delete.
trait test.A has 1 usage that is not safe to delete.
Of those 0 usages are in strings, comments, or non-code files.

View File

@@ -1 +1,2 @@
class test.A has 1 usage that is not safe to delete.
class test.A has 1 usage that is not safe to delete.
Of those 0 usages are in strings, comments, or non-code files.

View File

@@ -1 +1,2 @@
function test.foo has 1 usage that is not safe to delete.
function test.foo has 1 usage that is not safe to delete.
Of those 0 usages are in strings, comments, or non-code files.

View File

@@ -1 +1,2 @@
function test.foo has 1 usage that is not safe to delete.
function test.foo has 1 usage that is not safe to delete.
Of those 0 usages are in strings, comments, or non-code files.

View File

@@ -1 +1,2 @@
function foo.bar has 1 usage that is not safe to delete.
function foo.bar has 1 usage that is not safe to delete.
Of those 0 usages are in strings, comments, or non-code files.

View File

@@ -1 +1,2 @@
function foo.bar has 1 usage that is not safe to delete.
function foo.bar has 1 usage that is not safe to delete.
Of those 0 usages are in strings, comments, or non-code files.

View File

@@ -1 +1,2 @@
function test.foo has 1 usage that is not safe to delete.
function test.foo has 1 usage that is not safe to delete.
Of those 0 usages are in strings, comments, or non-code files.

View File

@@ -3,7 +3,7 @@ class B extends A {
foo();
}
public void foo() {
private void foo() {
}
}

View File

@@ -1 +1,2 @@
object foo.A has 1 usage that is not safe to delete.
object foo.A has 1 usage that is not safe to delete.
Of those 0 usages are in strings, comments, or non-code files.

View File

@@ -1 +1,2 @@
object test.A.O has 1 usage that is not safe to delete.
object test.A.O has 1 usage that is not safe to delete.
Of those 0 usages are in strings, comments, or non-code files.

View File

@@ -1 +1,2 @@
object test.A has 1 usage that is not safe to delete.
object test.A has 1 usage that is not safe to delete.
Of those 0 usages are in strings, comments, or non-code files.

View File

@@ -1 +1,2 @@
object test.A has 1 usage that is not safe to delete.
object test.A has 1 usage that is not safe to delete.
Of those 0 usages are in strings, comments, or non-code files.

View File

@@ -1 +1,2 @@
property test.foo has 1 usage that is not safe to delete.
property test.foo has 1 usage that is not safe to delete.
Of those 0 usages are in strings, comments, or non-code files.

View File

@@ -1 +1,2 @@
property test.foo has 1 usage that is not safe to delete.
property test.foo has 1 usage that is not safe to delete.
Of those 0 usages are in strings, comments, or non-code files.

View File

@@ -3,7 +3,7 @@ class B extends A {
System.out.println(getFoo());
}
public String getFoo() {
private String getFoo() {
return "foo";
}
}

View File

@@ -4,11 +4,11 @@ class B extends A {
System.out.println(getFoo());
}
public String getFoo() {
private String getFoo() {
return "foo";
}
public void setFoo(String value) {
private void setFoo(String value) {
}
}

View File

@@ -1 +1,2 @@
property test.foo has 1 usage that is not safe to delete.
property test.foo has 1 usage that is not safe to delete.
Of those 0 usages are in strings, comments, or non-code files.

View File

@@ -1 +1,2 @@
type parameter X has 1 usage that is not safe to delete.
type parameter X has 1 usage that is not safe to delete.
Of those 0 usages are in strings, comments, or non-code files.

View File

@@ -1 +1,2 @@
type parameter Y has 1 usage that is not safe to delete.
type parameter Y has 1 usage that is not safe to delete.
Of those 0 usages are in strings, comments, or non-code files.

View File

@@ -1 +1,2 @@
type parameter X has 2 usages that are not safe to delete.
type parameter X has 2 usages that are not safe to delete.
Of those 0 usages are in strings, comments, or non-code files.

View File

@@ -1 +1,2 @@
type parameter X has 1 usage that is not safe to delete.
type parameter X has 1 usage that is not safe to delete.
Of those 0 usages are in strings, comments, or non-code files.

View File

@@ -1 +1,2 @@
type parameter X has 1 usage that is not safe to delete.
type parameter X has 1 usage that is not safe to delete.
Of those 0 usages are in strings, comments, or non-code files.

View File

@@ -1 +1,2 @@
type parameter X has 1 usage that is not safe to delete.
type parameter X has 1 usage that is not safe to delete.
Of those 0 usages are in strings, comments, or non-code files.

View File

@@ -1 +1,2 @@
type parameter Y has 1 usage that is not safe to delete.
type parameter Y has 1 usage that is not safe to delete.
Of those 0 usages are in strings, comments, or non-code files.

View File

@@ -1 +1,2 @@
type parameter X has 2 usages that are not safe to delete.
type parameter X has 2 usages that are not safe to delete.
Of those 0 usages are in strings, comments, or non-code files.

View File

@@ -1 +1,2 @@
type parameter X has 1 usage that is not safe to delete.
type parameter X has 1 usage that is not safe to delete.
Of those 0 usages are in strings, comments, or non-code files.

View File

@@ -1 +1,2 @@
type parameter X has 1 usage that is not safe to delete.
type parameter X has 1 usage that is not safe to delete.
Of those 0 usages are in strings, comments, or non-code files.

View File

@@ -1 +1,2 @@
parameter a has 1 usage that is not safe to delete.
parameter a has 1 usage that is not safe to delete.
Of those 0 usages are in strings, comments, or non-code files.

View File

@@ -1 +1,2 @@
parameter a has 1 usage that is not safe to delete.
parameter a has 1 usage that is not safe to delete.
Of those 0 usages are in strings, comments, or non-code files.

View File

@@ -1 +1,2 @@
parameter a has 1 usage that is not safe to delete.
parameter a has 1 usage that is not safe to delete.
Of those 0 usages are in strings, comments, or non-code files.

Some files were not shown because too many files have changed in this diff Show More